@ronin/schema
Advanced tools
Comparing version 0.1.4-corny-ron-1071-experimental-15 to 0.1.4-corny-ron-1071-experimental-16
@@ -272,3 +272,9 @@ /** | ||
interface RoninFields { | ||
/** | ||
* The unique identifier for this record. | ||
*/ | ||
id: string; | ||
/** | ||
* Contains metadata about the record like creation date, last update, etc. | ||
*/ | ||
ronin: string; | ||
@@ -281,7 +287,19 @@ } | ||
interface Model<Fields> extends Omit<PublicModel, 'fields' | 'indexes' | 'triggers' | 'presets'> { | ||
/** | ||
* The fields that make up this model's schema. | ||
*/ | ||
fields?: Fields; | ||
/** | ||
* Predefined queries that can be reused across the application. | ||
*/ | ||
presets?: Record<string, GetInstructions | WithInstruction>; | ||
/** | ||
* Database indexes to optimize query performance. | ||
*/ | ||
indexes?: Array<ModelIndex<Array<ModelField & { | ||
slug: keyof Fields; | ||
}>>>; | ||
/** | ||
* Functions that run automatically in response to database events. | ||
*/ | ||
triggers?: Array<ModelTrigger<Array<ModelField & { | ||
@@ -317,6 +335,18 @@ slug: keyof Fields; | ||
interface LinkField { | ||
/** | ||
* Defines referential integrity behavior when linked records are modified. | ||
*/ | ||
actions?: { | ||
/** | ||
* Action to take when the referenced record is deleted. | ||
*/ | ||
onDelete?: 'cascade' | 'restrict' | 'set null' | 'no action'; | ||
/** | ||
* Action to take when the referenced record's key is updated. | ||
*/ | ||
onUpdate?: 'cascade' | 'restrict' | 'set null' | 'no action'; | ||
}; | ||
/** | ||
* The model that this field links to. | ||
*/ | ||
model: RoninFields | { | ||
@@ -323,0 +353,0 @@ slug: string; |
{ | ||
"name": "@ronin/schema", | ||
"version": "0.1.4-corny-ron-1071-experimental-15", | ||
"version": "0.1.4-corny-ron-1071-experimental-16", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "Allows for defining the schema of a RONIN database in code.", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
70546
1663
0