@ronin/compiler
Advanced tools
Comparing version 0.13.4 to 0.13.5-leo-ron-1071-experimental-297
@@ -150,2 +150,3 @@ /** | ||
type ModelFieldCollation = 'BINARY' | 'NOCASE' | 'RTRIM'; | ||
type ModelFieldLinkAction = 'CASCADE' | 'RESTRICT' | 'SET NULL' | 'SET DEFAULT' | 'NO ACTION'; | ||
type ModelFieldBasics = { | ||
@@ -184,27 +185,36 @@ /** The label that should be used when displaying the field on the RONIN dashboard. */ | ||
check?: Expression; | ||
/** | ||
* If the field is of type `string`, setting this attribute defines the collation | ||
* sequence to use for the field value. | ||
*/ | ||
}; | ||
type ModelField = (ModelFieldBasics & { | ||
/** The kind of value that should be stored inside the field. */ | ||
type?: never; | ||
}) | (ModelFieldBasics & { | ||
/** The kind of value that should be stored inside the field. */ | ||
type: 'boolean' | 'date' | 'json'; | ||
}) | (ModelFieldBasics & { | ||
/** The kind of value that should be stored inside the field. */ | ||
type: 'string'; | ||
/** The collation sequence to use for the field value. */ | ||
collation?: ModelFieldCollation; | ||
}) | (ModelFieldBasics & { | ||
/** The kind of value that should be stored inside the field. */ | ||
type: 'number'; | ||
/** | ||
* If the field is of type `number`, setting this attribute will automatically increment | ||
* the value of the field with every new record that gets inserted. | ||
* Automatically increments the value of the field with every new inserted record. | ||
*/ | ||
increment?: boolean; | ||
}; | ||
type ModelFieldNormal = ModelFieldBasics & { | ||
type?: 'string' | 'number' | 'boolean' | 'date' | 'json'; | ||
}; | ||
type ModelFieldReferenceAction = 'CASCADE' | 'RESTRICT' | 'SET NULL' | 'SET DEFAULT' | 'NO ACTION'; | ||
type ModelFieldReference = ModelFieldBasics & { | ||
}) | (ModelFieldBasics & { | ||
/** The kind of value that should be stored inside the field. */ | ||
type: 'link'; | ||
/** The target model of the relationship that is being established. */ | ||
target: string; | ||
/** Whether the field should be related to one record, or many records. */ | ||
kind?: 'one' | 'many'; | ||
/** | ||
* If the target record is updated or deleted, the defined actions maybe executed. | ||
*/ | ||
actions?: { | ||
onDelete?: ModelFieldReferenceAction; | ||
onUpdate?: ModelFieldReferenceAction; | ||
onDelete?: ModelFieldLinkAction; | ||
onUpdate?: ModelFieldLinkAction; | ||
}; | ||
}; | ||
type ModelField = ModelFieldNormal | ModelFieldReference; | ||
}); | ||
type ModelIndexField<T extends Array<ModelField> = Array<ModelField>> = { | ||
@@ -211,0 +221,0 @@ /** The collating sequence used for text placed inside the field. */ |
{ | ||
"name": "@ronin/compiler", | ||
"version": "0.13.4", | ||
"version": "0.13.5-leo-ron-1071-experimental-297", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "Compiles RONIN queries to SQL statements.", |
Sorry, the diff of this file is too big to display
102447
2314