@prisma-next/target-postgres 0.3.0-dev.55 → 0.3.0-dev.63

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.
package/package.json CHANGED
@@ -1,32 +1,32 @@
1
1
  {
2
2
  "name": "@prisma-next/target-postgres",
3
- "version": "0.3.0-dev.55",
3
+ "version": "0.3.0-dev.63",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "Postgres target pack for Prisma Next",
7
7
  "dependencies": {
8
8
  "arktype": "^2.0.0",
9
- "@prisma-next/cli": "0.3.0-dev.55",
10
- "@prisma-next/contract": "0.3.0-dev.55",
11
- "@prisma-next/core-control-plane": "0.3.0-dev.55",
12
- "@prisma-next/core-execution-plane": "0.3.0-dev.55",
13
- "@prisma-next/family-sql": "0.3.0-dev.55",
14
- "@prisma-next/sql-contract": "0.3.0-dev.55",
15
- "@prisma-next/sql-errors": "0.3.0-dev.55",
16
- "@prisma-next/sql-relational-core": "0.3.0-dev.55",
17
- "@prisma-next/sql-runtime": "0.3.0-dev.55",
18
- "@prisma-next/sql-schema-ir": "0.3.0-dev.55",
19
- "@prisma-next/utils": "0.3.0-dev.55"
9
+ "@prisma-next/contract": "0.3.0-dev.63",
10
+ "@prisma-next/core-control-plane": "0.3.0-dev.63",
11
+ "@prisma-next/family-sql": "0.3.0-dev.63",
12
+ "@prisma-next/cli": "0.3.0-dev.63",
13
+ "@prisma-next/sql-contract": "0.3.0-dev.63",
14
+ "@prisma-next/sql-errors": "0.3.0-dev.63",
15
+ "@prisma-next/sql-relational-core": "0.3.0-dev.63",
16
+ "@prisma-next/core-execution-plane": "0.3.0-dev.63",
17
+ "@prisma-next/sql-runtime": "0.3.0-dev.63",
18
+ "@prisma-next/sql-schema-ir": "0.3.0-dev.63",
19
+ "@prisma-next/utils": "0.3.0-dev.63"
20
20
  },
21
21
  "devDependencies": {
22
22
  "tsdown": "0.18.4",
23
23
  "typescript": "5.9.3",
24
24
  "vitest": "4.0.17",
25
- "@prisma-next/driver-postgres": "0.3.0-dev.55",
26
- "@prisma-next/adapter-postgres": "0.3.0-dev.55",
25
+ "@prisma-next/adapter-postgres": "0.3.0-dev.63",
27
26
  "@prisma-next/test-utils": "0.0.1",
28
27
  "@prisma-next/tsconfig": "0.0.0",
29
- "@prisma-next/tsdown": "0.0.0"
28
+ "@prisma-next/tsdown": "0.0.0",
29
+ "@prisma-next/driver-postgres": "0.3.0-dev.63"
30
30
  },
31
31
  "files": [
32
32
  "dist",
@@ -1,3 +1,5 @@
1
+ import { expandParameterizedNativeType } from '@prisma-next/adapter-postgres/control';
2
+ import type { ContractIR } from '@prisma-next/contract/ir';
1
3
  import type {
2
4
  ControlTargetInstance,
3
5
  MigrationPlanner,
@@ -7,6 +9,8 @@ import type {
7
9
  SqlControlFamilyInstance,
8
10
  SqlControlTargetDescriptor,
9
11
  } from '@prisma-next/family-sql/control';
12
+ import { contractToSchemaIR } from '@prisma-next/family-sql/control';
13
+ import type { SqlStorage } from '@prisma-next/sql-contract/types';
10
14
  import { postgresTargetDescriptorMeta } from '../core/descriptor-meta';
11
15
  import type { PostgresPlanTargetDetails } from '../core/migrations/planner';
12
16
  import { createPostgresMigrationPlanner } from '../core/migrations/planner';
@@ -16,11 +20,6 @@ const postgresTargetDescriptor: SqlControlTargetDescriptor<'postgres', PostgresP
16
20
  {
17
21
  ...postgresTargetDescriptorMeta,
18
22
  operationSignatures: () => [],
19
- /**
20
- * Migrations capability for CLI to access planner/runner via core types.
21
- * The SQL-specific planner/runner types are compatible with the generic
22
- * MigrationPlanner/MigrationRunner interfaces at runtime.
23
- */
24
23
  migrations: {
25
24
  createPlanner(_family: SqlControlFamilyInstance) {
26
25
  return createPostgresMigrationPlanner() as MigrationPlanner<'sql', 'postgres'>;
@@ -28,6 +27,10 @@ const postgresTargetDescriptor: SqlControlTargetDescriptor<'postgres', PostgresP
28
27
  createRunner(family) {
29
28
  return createPostgresMigrationRunner(family) as MigrationRunner<'sql', 'postgres'>;
30
29
  },
30
+ contractToSchema(contract: ContractIR | null) {
31
+ const storage = contract ? (contract.storage as SqlStorage) : { tables: {} };
32
+ return contractToSchemaIR(storage, expandParameterizedNativeType);
33
+ },
31
34
  },
32
35
  create(): ControlTargetInstance<'sql', 'postgres'> {
33
36
  return {