@prisma-next/sql-schema-ir 0.3.0-dev.40 → 0.3.0-dev.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- import { a as SqlIndexIR, c as SqlTypeMetadata, i as SqlForeignKeyIR, l as SqlTypeMetadataRegistry, n as SqlAnnotations, o as SqlSchemaIR, r as SqlColumnIR, s as SqlTableIR, t as PrimaryKey, u as SqlUniqueIR } from "../types-wvzVmlnk.mjs";
2
- export { PrimaryKey, SqlAnnotations, SqlColumnIR, SqlForeignKeyIR, SqlIndexIR, SqlSchemaIR, SqlTableIR, SqlTypeMetadata, SqlTypeMetadataRegistry, SqlUniqueIR };
1
+ import { a as SqlIndexIR, c as SqlTableIR, d as SqlUniqueIR, i as SqlForeignKeyIR, l as SqlTypeMetadata, n as SqlAnnotations, o as SqlReferentialAction, r as SqlColumnIR, s as SqlSchemaIR, t as PrimaryKey, u as SqlTypeMetadataRegistry } from "../types-t7S29aXW.mjs";
2
+ export { PrimaryKey, SqlAnnotations, SqlColumnIR, SqlForeignKeyIR, SqlIndexIR, SqlReferentialAction, SqlSchemaIR, SqlTableIR, SqlTypeMetadata, SqlTypeMetadataRegistry, SqlUniqueIR };
package/dist/index.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as SqlIndexIR, c as SqlTypeMetadata, i as SqlForeignKeyIR, l as SqlTypeMetadataRegistry, n as SqlAnnotations, o as SqlSchemaIR, r as SqlColumnIR, s as SqlTableIR, t as PrimaryKey, u as SqlUniqueIR } from "./types-wvzVmlnk.mjs";
2
- export { PrimaryKey, SqlAnnotations, SqlColumnIR, SqlForeignKeyIR, SqlIndexIR, SqlSchemaIR, SqlTableIR, SqlTypeMetadata, SqlTypeMetadataRegistry, SqlUniqueIR };
1
+ import { a as SqlIndexIR, c as SqlTableIR, d as SqlUniqueIR, i as SqlForeignKeyIR, l as SqlTypeMetadata, n as SqlAnnotations, o as SqlReferentialAction, r as SqlColumnIR, s as SqlSchemaIR, t as PrimaryKey, u as SqlTypeMetadataRegistry } from "./types-t7S29aXW.mjs";
2
+ export { PrimaryKey, SqlAnnotations, SqlColumnIR, SqlForeignKeyIR, SqlIndexIR, SqlReferentialAction, SqlSchemaIR, SqlTableIR, SqlTypeMetadata, SqlTypeMetadataRegistry, SqlUniqueIR };
@@ -30,6 +30,11 @@ type SqlColumnIR = {
30
30
  readonly default?: string;
31
31
  readonly annotations?: SqlAnnotations;
32
32
  };
33
+ /**
34
+ * Referential action for foreign keys in the schema IR.
35
+ * Defined here independently from the contract package to avoid coupling.
36
+ */
37
+ type SqlReferentialAction = 'noAction' | 'restrict' | 'cascade' | 'setNull' | 'setDefault';
33
38
  /**
34
39
  * SQL foreign key IR.
35
40
  */
@@ -38,6 +43,8 @@ type SqlForeignKeyIR = {
38
43
  readonly referencedTable: string;
39
44
  readonly referencedColumns: readonly string[];
40
45
  readonly name?: string;
46
+ readonly onDelete?: SqlReferentialAction;
47
+ readonly onUpdate?: SqlReferentialAction;
41
48
  readonly annotations?: SqlAnnotations;
42
49
  };
43
50
  /**
@@ -112,5 +119,5 @@ interface SqlTypeMetadataRegistry {
112
119
  values(): IterableIterator<SqlTypeMetadata>;
113
120
  }
114
121
  //#endregion
115
- export { SqlIndexIR as a, SqlTypeMetadata as c, SqlForeignKeyIR as i, SqlTypeMetadataRegistry as l, SqlAnnotations as n, SqlSchemaIR as o, SqlColumnIR as r, SqlTableIR as s, PrimaryKey as t, SqlUniqueIR as u };
116
- //# sourceMappingURL=types-wvzVmlnk.d.mts.map
122
+ export { SqlIndexIR as a, SqlTableIR as c, SqlUniqueIR as d, SqlForeignKeyIR as i, SqlTypeMetadata as l, SqlAnnotations as n, SqlReferentialAction as o, SqlColumnIR as r, SqlSchemaIR as s, PrimaryKey as t, SqlTypeMetadataRegistry as u };
123
+ //# sourceMappingURL=types-t7S29aXW.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-t7S29aXW.d.mts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;AAWA;AASA;AAOA;AAYA;AAKA;;;;;AAaY,KA9CA,UAAA,GA8CW;EASX,SAAA,OAAU,EAAA,SAIG,MAAA,EAAA;EAOb,SAAA,IAAU,CAAA,EAAA,MAAA;CAEa;;;;;AAIN,KA/DjB,cAAA,GA+DiB;EACJ,UAAA,SAAA,EAAA,MAAA,CAAA,EAAA,OAAA;CAAc;AAOvC;;;AAGyB,KAnEb,WAAA,GAmEa;EAAc,SAAA,IAAA,EAAA,MAAA;EAOtB,SAAA,UAAe,EAAA,MAAA;EAyBf,SAAA,QAAA,EAAA,OAAuB;;yBA9Ff;;;;;;KAOb,oBAAA;;;;KAKA,eAAA;;;;;sBAKU;sBACA;yBACG;;;;;KAMb,WAAA;;;yBAGa;;;;;KAMb,UAAA;;;;yBAIa;;;;;;KAOb,UAAA;;oBAEQ,eAAe;wBACX;iCACS;6BACJ;6BACA;yBACJ;;;;;;KAOb,WAAA;mBACO,eAAe;;yBAET;;;;;;UAOR,eAAA;;;;;;;;;;;;;;;;;;;;;;UAyBA,uBAAA;;;;YAIL,iBAAiB"}
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@prisma-next/sql-schema-ir",
3
- "version": "0.3.0-dev.40",
3
+ "version": "0.3.0-dev.43",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "SQL Schema IR types for schema introspection and verification",
7
7
  "dependencies": {
8
- "@prisma-next/contract": "0.3.0-dev.40"
8
+ "@prisma-next/contract": "0.3.0-dev.43"
9
9
  },
10
10
  "devDependencies": {
11
11
  "tsdown": "0.18.4",
12
12
  "typescript": "5.9.3",
13
13
  "vitest": "4.0.17",
14
+ "@prisma-next/tsconfig": "0.0.0",
14
15
  "@prisma-next/test-utils": "0.0.1",
15
- "@prisma-next/tsdown": "0.0.0",
16
- "@prisma-next/tsconfig": "0.0.0"
16
+ "@prisma-next/tsdown": "0.0.0"
17
17
  },
18
18
  "files": [
19
19
  "dist",
@@ -4,6 +4,7 @@ export type {
4
4
  SqlColumnIR,
5
5
  SqlForeignKeyIR,
6
6
  SqlIndexIR,
7
+ SqlReferentialAction,
7
8
  SqlSchemaIR,
8
9
  SqlTableIR,
9
10
  SqlTypeMetadata,
package/src/types.ts CHANGED
@@ -33,6 +33,12 @@ export type SqlColumnIR = {
33
33
  readonly annotations?: SqlAnnotations; // column-level metadata
34
34
  };
35
35
 
36
+ /**
37
+ * Referential action for foreign keys in the schema IR.
38
+ * Defined here independently from the contract package to avoid coupling.
39
+ */
40
+ export type SqlReferentialAction = 'noAction' | 'restrict' | 'cascade' | 'setNull' | 'setDefault';
41
+
36
42
  /**
37
43
  * SQL foreign key IR.
38
44
  */
@@ -41,6 +47,8 @@ export type SqlForeignKeyIR = {
41
47
  readonly referencedTable: string;
42
48
  readonly referencedColumns: readonly string[];
43
49
  readonly name?: string;
50
+ readonly onDelete?: SqlReferentialAction;
51
+ readonly onUpdate?: SqlReferentialAction;
44
52
  readonly annotations?: SqlAnnotations;
45
53
  };
46
54
 
@@ -1 +0,0 @@
1
- {"version":3,"file":"types-wvzVmlnk.d.mts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;AAWA;AASA;AAOA;AAWA;AAWA;AASA;AAWA;;;AAGwB,KA7DZ,UAAA,GA6DY;EACS,SAAA,OAAA,EAAA,SAAA,MAAA,EAAA;EACJ,SAAA,IAAA,CAAA,EAAA,MAAA;CACA;;;AAQ7B;;AACmB,KAhEP,cAAA,GAgEO;EAEM,UAAA,SAAA,EAAA,MAAA,CAAA,EAAA,OAAA;CAAc;AAOvC;AAyBA;;KA3FY,WAAA;;;;;yBAKa;;;;;KAMb,eAAA;;;;;yBAKa;;;;;KAMb,WAAA;;;yBAGa;;;;;KAMb,UAAA;;;;yBAIa;;;;;;KAOb,UAAA;;oBAEQ,eAAe;wBACX;iCACS;6BACJ;6BACA;yBACJ;;;;;;KAOb,WAAA;mBACO,eAAe;;yBAET;;;;;;UAOR,eAAA;;;;;;;;;;;;;;;;;;;;;;UAyBA,uBAAA;;;;YAIL,iBAAiB"}