@prisma-next/sql-schema-ir 0.3.0-dev.76 → 0.3.0-dev.77

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.
@@ -0,0 +1,5 @@
1
+ //#region src/exports/naming.d.ts
2
+ declare function defaultIndexName(tableName: string, columns: readonly string[]): string;
3
+ //#endregion
4
+ export { defaultIndexName };
5
+ //# sourceMappingURL=naming.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"naming.d.mts","names":[],"sources":["../../src/exports/naming.ts"],"sourcesContent":[],"mappings":";iBAAgB,gBAAA"}
@@ -0,0 +1,8 @@
1
+ //#region src/exports/naming.ts
2
+ function defaultIndexName(tableName, columns) {
3
+ return `${tableName}_${columns.join("_")}_idx`;
4
+ }
5
+
6
+ //#endregion
7
+ export { defaultIndexName };
8
+ //# sourceMappingURL=naming.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"naming.mjs","names":[],"sources":["../../src/exports/naming.ts"],"sourcesContent":["export function defaultIndexName(tableName: string, columns: readonly string[]): string {\n return `${tableName}_${columns.join('_')}_idx`;\n}\n"],"mappings":";AAAA,SAAgB,iBAAiB,WAAmB,SAAoC;AACtF,QAAO,GAAG,UAAU,GAAG,QAAQ,KAAK,IAAI,CAAC"}
@@ -1,2 +1,2 @@
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 };
1
+ import { a as SqlForeignKeyIR, c as SqlSchemaIR, d as SqlTypeMetadataRegistry, f as SqlUniqueIR, i as SqlColumnIR, l as SqlTableIR, n as PrimaryKey, o as SqlIndexIR, r as SqlAnnotations, s as SqlReferentialAction, t as DependencyIR, u as SqlTypeMetadata } from "../types-C98F0mec.mjs";
2
+ export { DependencyIR, 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 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 };
1
+ import { a as SqlForeignKeyIR, c as SqlSchemaIR, d as SqlTypeMetadataRegistry, f as SqlUniqueIR, i as SqlColumnIR, l as SqlTableIR, n as PrimaryKey, o as SqlIndexIR, r as SqlAnnotations, s as SqlReferentialAction, t as DependencyIR, u as SqlTypeMetadata } from "./types-C98F0mec.mjs";
2
+ export { DependencyIR, PrimaryKey, SqlAnnotations, SqlColumnIR, SqlForeignKeyIR, SqlIndexIR, SqlReferentialAction, SqlSchemaIR, SqlTableIR, SqlTypeMetadata, SqlTypeMetadataRegistry, SqlUniqueIR };
@@ -77,14 +77,17 @@ type SqlTableIR = {
77
77
  readonly indexes: readonly SqlIndexIR[];
78
78
  readonly annotations?: SqlAnnotations;
79
79
  };
80
+ type DependencyIR = {
81
+ readonly id: string;
82
+ };
80
83
  /**
81
84
  * SQL Schema IR representing the complete database schema.
82
85
  * This is the target-agnostic representation used for verification and migration planning.
83
86
  */
84
87
  type SqlSchemaIR = {
85
88
  readonly tables: Record<string, SqlTableIR>;
86
- readonly extensions: readonly string[];
87
89
  readonly annotations?: SqlAnnotations;
90
+ readonly dependencies: readonly DependencyIR[];
88
91
  };
89
92
  /**
90
93
  * SQL type metadata for control-plane and execution-plane type availability and mapping.
@@ -119,5 +122,5 @@ interface SqlTypeMetadataRegistry {
119
122
  values(): IterableIterator<SqlTypeMetadata>;
120
123
  }
121
124
  //#endregion
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
125
+ export { SqlForeignKeyIR as a, SqlSchemaIR as c, SqlTypeMetadataRegistry as d, SqlUniqueIR as f, SqlColumnIR as i, SqlTableIR as l, PrimaryKey as n, SqlIndexIR as o, SqlAnnotations as r, SqlReferentialAction as s, DependencyIR as t, SqlTypeMetadata as u };
126
+ //# sourceMappingURL=types-C98F0mec.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-C98F0mec.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;AAGvC;AAQA;;AACmB,KArEP,WAAA,GAqEO;EACM,SAAA,IAAA,EAAA,MAAA;EACS,SAAA,UAAA,EAAA,MAAA;EAAY,SAAA,QAAA,EAAA,OAAA;EAO7B,SAAA,OAAA,CAAA,EAAe,MAAA;EAyBf,SAAA,WAAA,CAAA,EAlGQ,cAkGe;;;;;;KA3F5B,oBAAA;;;;KAKA,eAAA;;;;;sBAKU;sBACA;yBACG;;;;;KAMb,WAAA;;;yBAGa;;;;;KAMb,UAAA;;;;yBAIa;;;;;;KAOb,UAAA;;oBAEQ,eAAe;wBACX;iCACS;6BACJ;6BACA;yBACJ;;KAGb,YAAA;;;;;;;KAQA,WAAA;mBACO,eAAe;yBACT;kCACS;;;;;;UAOjB,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.76",
3
+ "version": "0.3.0-dev.77",
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.76"
8
+ "@prisma-next/contract": "0.3.0-dev.77"
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",
15
14
  "@prisma-next/tsdown": "0.0.0",
16
- "@prisma-next/test-utils": "0.0.1"
15
+ "@prisma-next/test-utils": "0.0.1",
16
+ "@prisma-next/tsconfig": "0.0.0"
17
17
  },
18
18
  "files": [
19
19
  "dist",
@@ -24,6 +24,7 @@
24
24
  },
25
25
  "exports": {
26
26
  ".": "./dist/index.mjs",
27
+ "./naming": "./dist/exports/naming.mjs",
27
28
  "./types": "./dist/exports/types.mjs",
28
29
  "./package.json": "./package.json"
29
30
  },
@@ -0,0 +1,3 @@
1
+ export function defaultIndexName(tableName: string, columns: readonly string[]): string {
2
+ return `${tableName}_${columns.join('_')}_idx`;
3
+ }
@@ -1,4 +1,5 @@
1
1
  export type {
2
+ DependencyIR,
2
3
  PrimaryKey,
3
4
  SqlAnnotations,
4
5
  SqlColumnIR,
package/src/types.ts CHANGED
@@ -85,14 +85,18 @@ export type SqlTableIR = {
85
85
  readonly annotations?: SqlAnnotations; // table-level metadata
86
86
  };
87
87
 
88
+ export type DependencyIR = {
89
+ readonly id: string;
90
+ };
91
+
88
92
  /**
89
93
  * SQL Schema IR representing the complete database schema.
90
94
  * This is the target-agnostic representation used for verification and migration planning.
91
95
  */
92
96
  export type SqlSchemaIR = {
93
97
  readonly tables: Record<string, SqlTableIR>;
94
- readonly extensions: readonly string[]; // logical extension ids or DB extension names
95
98
  readonly annotations?: SqlAnnotations; // extensible global metadata
99
+ readonly dependencies: readonly DependencyIR[];
96
100
  };
97
101
 
98
102
  /**
@@ -1 +0,0 @@
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"}