@ronin/compiler
Advanced tools
Comparing version 0.17.13 to 0.17.14
@@ -0,1 +1,9 @@ | ||
/** Query types used for reading data. */ | ||
declare const DML_READ_QUERY_TYPES: readonly ["get", "count"]; | ||
/** Query types used for writing data. */ | ||
declare const DML_WRITE_QUERY_TYPES: readonly ["set", "add", "remove"]; | ||
/** Query types used for interacting with data. */ | ||
declare const DML_QUERY_TYPES: readonly ["get", "count", "set", "add", "remove"]; | ||
/** Query types used for interacting with the database schema. */ | ||
declare const DDL_QUERY_TYPES: readonly ["create", "alter", "drop"]; | ||
/** | ||
@@ -18,42 +26,5 @@ * A list of placeholders that can be located inside queries after those queries were | ||
}; | ||
type RoninErrorCode = 'MODEL_NOT_FOUND' | 'FIELD_NOT_FOUND' | 'INDEX_NOT_FOUND' | 'TRIGGER_NOT_FOUND' | 'PRESET_NOT_FOUND' | 'INVALID_WITH_VALUE' | 'INVALID_TO_VALUE' | 'INVALID_INCLUDING_VALUE' | 'INVALID_FOR_VALUE' | 'INVALID_BEFORE_OR_AFTER_INSTRUCTION' | 'INVALID_MODEL_VALUE' | 'EXISTING_MODEL_ENTITY' | 'REQUIRED_MODEL_ENTITY' | 'MUTUALLY_EXCLUSIVE_INSTRUCTIONS' | 'MISSING_INSTRUCTION' | 'MISSING_FIELD'; | ||
interface Issue { | ||
message: string; | ||
path: Array<string | number>; | ||
} | ||
interface Details { | ||
message: string; | ||
code: RoninErrorCode; | ||
field?: string; | ||
fields?: Array<string>; | ||
issues?: Array<Issue>; | ||
queries?: Array<Query> | null; | ||
} | ||
declare class RoninError extends Error { | ||
code: Details['code']; | ||
field?: Details['field']; | ||
fields?: Details['fields']; | ||
issues?: Details['issues']; | ||
queries?: Details['queries']; | ||
constructor(details: Details); | ||
} | ||
/** | ||
* Checks if the provided value contains a RONIN model symbol (a represenation of a | ||
* particular entity inside a query, such as an expression or a sub query) and returns | ||
* its type and value. | ||
* | ||
* @param value - The value that should be checked. | ||
* | ||
* @returns The type and value of the symbol, if the provided value contains one. | ||
*/ | ||
declare const getQuerySymbol: (value: unknown) => { | ||
type: "query"; | ||
value: Query; | ||
} | { | ||
type: "expression"; | ||
value: string; | ||
} | null; | ||
type QueryTypeEnum = 'get' | 'set' | 'add' | 'remove' | 'count'; | ||
type ModelQueryTypeEnum = 'create' | 'alter' | 'drop'; | ||
type QueryTypeEnum = (typeof DML_QUERY_TYPES)[number]; | ||
type ModelQueryTypeEnum = (typeof DDL_QUERY_TYPES)[number]; | ||
type ModelEntityEnum = 'field' | 'index' | 'trigger' | 'preset'; | ||
@@ -430,2 +401,40 @@ type FieldValue = string | number | boolean | null | unknown; | ||
type RoninErrorCode = 'MODEL_NOT_FOUND' | 'FIELD_NOT_FOUND' | 'INDEX_NOT_FOUND' | 'TRIGGER_NOT_FOUND' | 'PRESET_NOT_FOUND' | 'INVALID_WITH_VALUE' | 'INVALID_TO_VALUE' | 'INVALID_INCLUDING_VALUE' | 'INVALID_FOR_VALUE' | 'INVALID_BEFORE_OR_AFTER_INSTRUCTION' | 'INVALID_MODEL_VALUE' | 'EXISTING_MODEL_ENTITY' | 'REQUIRED_MODEL_ENTITY' | 'MUTUALLY_EXCLUSIVE_INSTRUCTIONS' | 'MISSING_INSTRUCTION' | 'MISSING_FIELD'; | ||
interface Issue { | ||
message: string; | ||
path: Array<string | number>; | ||
} | ||
interface Details { | ||
message: string; | ||
code: RoninErrorCode; | ||
field?: string; | ||
fields?: Array<string>; | ||
issues?: Array<Issue>; | ||
queries?: Array<Query> | null; | ||
} | ||
declare class RoninError extends Error { | ||
code: Details['code']; | ||
field?: Details['field']; | ||
fields?: Details['fields']; | ||
issues?: Details['issues']; | ||
queries?: Details['queries']; | ||
constructor(details: Details); | ||
} | ||
/** | ||
* Checks if the provided value contains a RONIN model symbol (a represenation of a | ||
* particular entity inside a query, such as an expression or a sub query) and returns | ||
* its type and value. | ||
* | ||
* @param value - The value that should be checked. | ||
* | ||
* @returns The type and value of the symbol, if the provided value contains one. | ||
*/ | ||
declare const getQuerySymbol: (value: unknown) => { | ||
type: "query"; | ||
value: Query; | ||
} | { | ||
type: "expression"; | ||
value: string; | ||
} | null; | ||
interface TransactionOptions { | ||
@@ -469,2 +478,2 @@ /** A list of models that already exist in the database. */ | ||
export { type AddInstructions, type AddQuery, type AddInstructions as AddQueryInstructions, type AlterQuery, type CombinedInstructions, type CountInstructions, type CountQuery, type CountInstructions as CountQueryInstructions, type CreateQuery, type DropQuery, type ExpandedResult, type GetInstructions, type GetQuery, type GetInstructions as GetQueryInstructions, type PublicModel as Model, type ModelField, type ModelIndex, type ModelPreset, type ModelTrigger, QUERY_SYMBOLS, type Query, type QueryInstructionType as QueryInstruction, type QuerySchemaType, type QueryType, CLEAN_ROOT_MODEL as ROOT_MODEL, type RegularResult, type RemoveInstructions, type RemoveQuery, type RemoveInstructions as RemoveQueryInstructions, type Result, type ResultRecord, RoninError, type SetInstructions, type SetQuery, type SetInstructions as SetQueryInstructions, type Statement, type StoredObject, Transaction, type WithInstruction, getQuerySymbol }; | ||
export { type AddInstructions, type AddQuery, type AddInstructions as AddQueryInstructions, type AlterQuery, type CombinedInstructions, type CountInstructions, type CountQuery, type CountInstructions as CountQueryInstructions, type CreateQuery, DDL_QUERY_TYPES, DML_QUERY_TYPES, DML_READ_QUERY_TYPES, DML_WRITE_QUERY_TYPES, type DropQuery, type ExpandedResult, type GetInstructions, type GetQuery, type GetInstructions as GetQueryInstructions, type PublicModel as Model, type ModelField, type ModelIndex, type ModelPreset, type ModelTrigger, QUERY_SYMBOLS, type Query, type QueryInstructionType as QueryInstruction, type QuerySchemaType, type QueryType, CLEAN_ROOT_MODEL as ROOT_MODEL, type RegularResult, type RemoveInstructions, type RemoveQuery, type RemoveInstructions as RemoveQueryInstructions, type Result, type ResultRecord, RoninError, type SetInstructions, type SetQuery, type SetInstructions as SetQueryInstructions, type Statement, type StoredObject, Transaction, type WithInstruction, getQuerySymbol }; |
{ | ||
"name": "@ronin/compiler", | ||
"version": "0.17.13", | ||
"version": "0.17.14", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "Compiles RONIN queries to SQL statements.", |
Sorry, the diff of this file is too big to display
122535
2843