@prisma-next/family-sql 0.14.0-dev.31 → 0.14.0-dev.33

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,4 +1,6 @@
1
1
  import { T as SqlPlanTargetDetails, p as SqlMigrationPlanOperation } from "./types-BxsFkHYv.mjs";
2
+ import { Contract } from "@prisma-next/contract/types";
3
+ import { SqlStorage } from "@prisma-next/sql-contract/types";
2
4
  import { Migration } from "@prisma-next/migration-tools/migration";
3
5
 
4
6
  //#region src/core/sql-migration.d.ts
@@ -13,10 +15,17 @@ import { Migration } from "@prisma-next/migration-tools/migration";
13
15
  * fully concrete operation shape. Target-free code in SQL family / tooling
14
16
  * parameterises over `TDetails` (and usually `TTargetId = string`).
15
17
  *
18
+ * The `Start` / `End` contract generics are forwarded to the framework
19
+ * `Migration` base so the derived `describe()` and the per-target view getters
20
+ * (`PostgresMigration` / `SqliteMigration`) carry each migration's precise
21
+ * contract types. The view getters themselves live on the per-target bases
22
+ * because the SQL ContractView shapes differ per target (SQLite unwraps its
23
+ * sole namespace to the root; Postgres is schema-qualified).
24
+ *
16
25
  * Keeps target-free contract/runtime features in the family layer while
17
26
  * letting adapters own target shape.
18
27
  */
19
- declare abstract class SqlMigration<TDetails extends SqlPlanTargetDetails, TTargetId extends string = string> extends Migration<SqlMigrationPlanOperation<TDetails>, 'sql', TTargetId> {
28
+ declare abstract class SqlMigration<TDetails extends SqlPlanTargetDetails, TTargetId extends string = string, Start extends Contract<SqlStorage> = Contract<SqlStorage>, End extends Contract<SqlStorage> = Contract<SqlStorage>> extends Migration<SqlMigrationPlanOperation<TDetails>, 'sql', TTargetId, Start, End> {
20
29
  /**
21
30
  * Sorted, deduplicated invariant ids declared by this migration's
22
31
  * data-transform ops. Derived from `this.operations` so the field remains
@@ -1 +1 @@
1
- {"version":3,"file":"migration.d.mts","names":[],"sources":["../src/core/sql-migration.ts"],"mappings":";;;;;;AAmBA;;;;;;;;;;;;uBAAsB,YAAA,kBACH,oBAAA,6CAET,SAAA,CAAU,yBAAA,CAA0B,QAAA,UAAkB,SAAA;EAAtD;;;;;;AAWc;;;;EAXd,IAWJ,kBAAA;AAAA"}
1
+ {"version":3,"file":"migration.d.mts","names":[],"sources":["../src/core/sql-migration.ts"],"mappings":";;;;;;;;AA4BA;;;;;;;;;;;;;;;;;;;uBAAsB,YAAA,kBACH,oBAAA,mDAEH,QAAA,CAAS,UAAA,IAAc,QAAA,CAAS,UAAA,eAClC,QAAA,CAAS,UAAA,IAAc,QAAA,CAAS,UAAA,WACpC,SAAA,CAAU,yBAAA,CAA0B,QAAA,UAAkB,SAAA,EAAW,KAAA,EAAO,GAAA;EAJhF;;;;;;;;;;EAAA,IAeI,kBAAA;AAAA"}
@@ -13,6 +13,13 @@ import { isThenable } from "@prisma-next/utils/promise";
13
13
  * fully concrete operation shape. Target-free code in SQL family / tooling
14
14
  * parameterises over `TDetails` (and usually `TTargetId = string`).
15
15
  *
16
+ * The `Start` / `End` contract generics are forwarded to the framework
17
+ * `Migration` base so the derived `describe()` and the per-target view getters
18
+ * (`PostgresMigration` / `SqliteMigration`) carry each migration's precise
19
+ * contract types. The view getters themselves live on the per-target bases
20
+ * because the SQL ContractView shapes differ per target (SQLite unwraps its
21
+ * sole namespace to the root; Postgres is schema-qualified).
22
+ *
16
23
  * Keeps target-free contract/runtime features in the family layer while
17
24
  * letting adapters own target shape.
18
25
  */
@@ -1 +1 @@
1
- {"version":3,"file":"migration.mjs","names":[],"sources":["../src/core/sql-migration.ts"],"sourcesContent":["import { deriveProvidedInvariants } from '@prisma-next/migration-tools/invariants';\nimport { Migration } from '@prisma-next/migration-tools/migration';\nimport { isThenable } from '@prisma-next/utils/promise';\nimport type { SqlMigrationPlanOperation, SqlPlanTargetDetails } from './migrations/types';\n\n/**\n * Family-owned base class for SQL migrations.\n *\n * Generic in `TDetails` (family plan target details, e.g. Postgres vs SQLite)\n * and in `TTargetId` (the literal target identifier, e.g. `'postgres'`).\n *\n * Adapters (Postgres, SQLite, …) extend this with a concrete `TDetails` and\n * a fixed `TTargetId` literal, so the public `Migration<TOp>` base sees the\n * fully concrete operation shape. Target-free code in SQL family / tooling\n * parameterises over `TDetails` (and usually `TTargetId = string`).\n *\n * Keeps target-free contract/runtime features in the family layer while\n * letting adapters own target shape.\n */\nexport abstract class SqlMigration<\n TDetails extends SqlPlanTargetDetails,\n TTargetId extends string = string,\n> extends Migration<SqlMigrationPlanOperation<TDetails>, 'sql', TTargetId> {\n /**\n * Sorted, deduplicated invariant ids declared by this migration's\n * data-transform ops. Derived from `this.operations` so the field remains\n * consistent with the operation list — planner-built plans (`db init`,\n * `db update`) yield `[]` because they emit no data-transform ops.\n *\n * Required by `SqlMigrationPlan.providedInvariants` (tightened from\n * optional at the SQL-family layer); the framework-level\n * `MigrationPlan.providedInvariants?` stays optional.\n */\n get providedInvariants(): readonly string[] {\n const ops = this.operations.filter(\n (op): op is SqlMigrationPlanOperation<TDetails> => !isThenable(op),\n );\n return deriveProvidedInvariants(ops);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,IAAsB,eAAtB,cAGU,UAAiE;;;;;;;;;;;CAWzE,IAAI,qBAAwC;EAI1C,OAAO,yBAHK,KAAK,WAAW,QACzB,OAAkD,CAAC,WAAW,EAAE,CAEjC,CAAC;CACrC;AACF"}
1
+ {"version":3,"file":"migration.mjs","names":[],"sources":["../src/core/sql-migration.ts"],"sourcesContent":["import type { Contract } from '@prisma-next/contract/types';\nimport { deriveProvidedInvariants } from '@prisma-next/migration-tools/invariants';\nimport { Migration } from '@prisma-next/migration-tools/migration';\nimport type { SqlStorage } from '@prisma-next/sql-contract/types';\nimport { isThenable } from '@prisma-next/utils/promise';\nimport type { SqlMigrationPlanOperation, SqlPlanTargetDetails } from './migrations/types';\n\n/**\n * Family-owned base class for SQL migrations.\n *\n * Generic in `TDetails` (family plan target details, e.g. Postgres vs SQLite)\n * and in `TTargetId` (the literal target identifier, e.g. `'postgres'`).\n *\n * Adapters (Postgres, SQLite, …) extend this with a concrete `TDetails` and\n * a fixed `TTargetId` literal, so the public `Migration<TOp>` base sees the\n * fully concrete operation shape. Target-free code in SQL family / tooling\n * parameterises over `TDetails` (and usually `TTargetId = string`).\n *\n * The `Start` / `End` contract generics are forwarded to the framework\n * `Migration` base so the derived `describe()` and the per-target view getters\n * (`PostgresMigration` / `SqliteMigration`) carry each migration's precise\n * contract types. The view getters themselves live on the per-target bases\n * because the SQL ContractView shapes differ per target (SQLite unwraps its\n * sole namespace to the root; Postgres is schema-qualified).\n *\n * Keeps target-free contract/runtime features in the family layer while\n * letting adapters own target shape.\n */\nexport abstract class SqlMigration<\n TDetails extends SqlPlanTargetDetails,\n TTargetId extends string = string,\n Start extends Contract<SqlStorage> = Contract<SqlStorage>,\n End extends Contract<SqlStorage> = Contract<SqlStorage>,\n> extends Migration<SqlMigrationPlanOperation<TDetails>, 'sql', TTargetId, Start, End> {\n /**\n * Sorted, deduplicated invariant ids declared by this migration's\n * data-transform ops. Derived from `this.operations` so the field remains\n * consistent with the operation list — planner-built plans (`db init`,\n * `db update`) yield `[]` because they emit no data-transform ops.\n *\n * Required by `SqlMigrationPlan.providedInvariants` (tightened from\n * optional at the SQL-family layer); the framework-level\n * `MigrationPlan.providedInvariants?` stays optional.\n */\n get providedInvariants(): readonly string[] {\n const ops = this.operations.filter(\n (op): op is SqlMigrationPlanOperation<TDetails> => !isThenable(op),\n );\n return deriveProvidedInvariants(ops);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,IAAsB,eAAtB,cAKU,UAA6E;;;;;;;;;;;CAWrF,IAAI,qBAAwC;EAI1C,OAAO,yBAHK,KAAK,WAAW,QACzB,OAAkD,CAAC,WAAW,EAAE,CAEjC,CAAC;CACrC;AACF"}
package/package.json CHANGED
@@ -1,34 +1,34 @@
1
1
  {
2
2
  "name": "@prisma-next/family-sql",
3
- "version": "0.14.0-dev.31",
3
+ "version": "0.14.0-dev.33",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "description": "SQL family descriptor for Prisma Next",
8
8
  "dependencies": {
9
- "@prisma-next/contract": "0.14.0-dev.31",
10
- "@prisma-next/emitter": "0.14.0-dev.31",
11
- "@prisma-next/framework-components": "0.14.0-dev.31",
12
- "@prisma-next/migration-tools": "0.14.0-dev.31",
13
- "@prisma-next/operations": "0.14.0-dev.31",
14
- "@prisma-next/sql-contract": "0.14.0-dev.31",
15
- "@prisma-next/sql-contract-emitter": "0.14.0-dev.31",
16
- "@prisma-next/sql-contract-ts": "0.14.0-dev.31",
17
- "@prisma-next/sql-operations": "0.14.0-dev.31",
18
- "@prisma-next/sql-relational-core": "0.14.0-dev.31",
19
- "@prisma-next/sql-runtime": "0.14.0-dev.31",
20
- "@prisma-next/sql-schema-ir": "0.14.0-dev.31",
21
- "@prisma-next/utils": "0.14.0-dev.31",
9
+ "@prisma-next/contract": "0.14.0-dev.33",
10
+ "@prisma-next/emitter": "0.14.0-dev.33",
11
+ "@prisma-next/framework-components": "0.14.0-dev.33",
12
+ "@prisma-next/migration-tools": "0.14.0-dev.33",
13
+ "@prisma-next/operations": "0.14.0-dev.33",
14
+ "@prisma-next/sql-contract": "0.14.0-dev.33",
15
+ "@prisma-next/sql-contract-emitter": "0.14.0-dev.33",
16
+ "@prisma-next/sql-contract-ts": "0.14.0-dev.33",
17
+ "@prisma-next/sql-operations": "0.14.0-dev.33",
18
+ "@prisma-next/sql-relational-core": "0.14.0-dev.33",
19
+ "@prisma-next/sql-runtime": "0.14.0-dev.33",
20
+ "@prisma-next/sql-schema-ir": "0.14.0-dev.33",
21
+ "@prisma-next/utils": "0.14.0-dev.33",
22
22
  "arktype": "^2.2.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@prisma-next/driver-postgres": "0.14.0-dev.31",
26
- "@prisma-next/psl-parser": "0.14.0-dev.31",
27
- "@prisma-next/psl-printer": "0.14.0-dev.31",
28
- "@prisma-next/sql-contract-psl": "0.14.0-dev.31",
29
- "@prisma-next/test-utils": "0.14.0-dev.31",
30
- "@prisma-next/tsconfig": "0.14.0-dev.31",
31
- "@prisma-next/tsdown": "0.14.0-dev.31",
25
+ "@prisma-next/driver-postgres": "0.14.0-dev.33",
26
+ "@prisma-next/psl-parser": "0.14.0-dev.33",
27
+ "@prisma-next/psl-printer": "0.14.0-dev.33",
28
+ "@prisma-next/sql-contract-psl": "0.14.0-dev.33",
29
+ "@prisma-next/test-utils": "0.14.0-dev.33",
30
+ "@prisma-next/tsconfig": "0.14.0-dev.33",
31
+ "@prisma-next/tsdown": "0.14.0-dev.33",
32
32
  "tsdown": "0.22.1",
33
33
  "typescript": "5.9.3",
34
34
  "vitest": "4.1.8"
@@ -1,5 +1,7 @@
1
+ import type { Contract } from '@prisma-next/contract/types';
1
2
  import { deriveProvidedInvariants } from '@prisma-next/migration-tools/invariants';
2
3
  import { Migration } from '@prisma-next/migration-tools/migration';
4
+ import type { SqlStorage } from '@prisma-next/sql-contract/types';
3
5
  import { isThenable } from '@prisma-next/utils/promise';
4
6
  import type { SqlMigrationPlanOperation, SqlPlanTargetDetails } from './migrations/types';
5
7
 
@@ -14,13 +16,22 @@ import type { SqlMigrationPlanOperation, SqlPlanTargetDetails } from './migratio
14
16
  * fully concrete operation shape. Target-free code in SQL family / tooling
15
17
  * parameterises over `TDetails` (and usually `TTargetId = string`).
16
18
  *
19
+ * The `Start` / `End` contract generics are forwarded to the framework
20
+ * `Migration` base so the derived `describe()` and the per-target view getters
21
+ * (`PostgresMigration` / `SqliteMigration`) carry each migration's precise
22
+ * contract types. The view getters themselves live on the per-target bases
23
+ * because the SQL ContractView shapes differ per target (SQLite unwraps its
24
+ * sole namespace to the root; Postgres is schema-qualified).
25
+ *
17
26
  * Keeps target-free contract/runtime features in the family layer while
18
27
  * letting adapters own target shape.
19
28
  */
20
29
  export abstract class SqlMigration<
21
30
  TDetails extends SqlPlanTargetDetails,
22
31
  TTargetId extends string = string,
23
- > extends Migration<SqlMigrationPlanOperation<TDetails>, 'sql', TTargetId> {
32
+ Start extends Contract<SqlStorage> = Contract<SqlStorage>,
33
+ End extends Contract<SqlStorage> = Contract<SqlStorage>,
34
+ > extends Migration<SqlMigrationPlanOperation<TDetails>, 'sql', TTargetId, Start, End> {
24
35
  /**
25
36
  * Sorted, deduplicated invariant ids declared by this migration's
26
37
  * data-transform ops. Derived from `this.operations` so the field remains