@prisma-next/extension-paradedb 0.12.0-dev.5 → 0.12.0-dev.51

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/README.md CHANGED
@@ -73,16 +73,9 @@ ParadeDB BM25 indexes require a `key_field` — a unique column that identifies
73
73
 
74
74
  ## Authoring (maintainers)
75
75
 
76
- The extension's contract + baseline migration are emitted on-disk inside this package using the same pipeline application authors use:
76
+ After changing the contract source, run `pnpm migrations:regen` from the repo root to keep migration metadata, `refs/head.json`, and `end-contract.*` consistent with the freshly-built `src/contract.json`; it is also wired into `pnpm fixtures:emit` automatically.
77
77
 
78
- - `pnpm build:contract-space`runs `prisma-next contract emit` to produce `src/contract.{json,d.ts}` from `emptyContract({ output: 'src/contract.json', target })` in `prisma-next.config.ts` (migrations-only space: no `contract.prisma` source file).
79
- - `pnpm exec prisma-next migration plan --name <slug>` (run from this package directory) — scaffolds a new migration directory under `migrations/<dirName>/` for schema changes. **Not chained into `pnpm build`**: `migration plan` is non-idempotent (each invocation generates a new timestamped directory), so it runs manually when the contract changes. Note: paradedb's contract declares no tables or models, so the planner currently refuses to scaffold the baseline migration (this is **Path B** authoring per [ADR 212](../../../docs/architecture%20docs/adrs/ADR%20212%20-%20Contract%20spaces.md#contract-space-package-layout)). That directory was hand-authored once (Migration subclass + seed `migration.json` preserving the full `toContract`) and `pnpm tsx migrations/<dirName>/migration.ts` re-emits `ops.json` + `migration.json` deterministically. Future migrations that add tables or models can use `migration plan` directly (Path A).
80
- - `pnpm tsx migrations/<dirName>/migration.ts` (run from this package directory) — re-emits `ops.json` + `migration.json` from the hand-edited subclass. Use `tsx`, not bare `node`, because the Migration subclass imports relative TypeScript siblings which Node's native loader can't resolve without a TS-aware loader.
81
- - `migrations/refs/head.json` is hand-pinned with the latest migration's `to` hash + `providedInvariants`.
82
-
83
- The descriptor at `src/exports/control.ts` then JSON-imports those artefacts and synthesises the framework's `MigrationPackage` shape.
84
-
85
- See [ADR 212 — Contract spaces](../../../docs/architecture%20docs/adrs/ADR%20212%20-%20Contract%20spaces.md) ("Contract-space package layout") for the canonical layout and rationale.
78
+ See [ADR 212Contract spaces](../../../docs/architecture%20docs/adrs/ADR%20212%20-%20Contract%20spaces.md) ("Contract-space package layout") for the layout and rationale.
86
79
 
87
80
  ## Not yet implemented
88
81
 
package/dist/control.mjs CHANGED
@@ -11,12 +11,19 @@ const paradedbContractSpace = contractSpaceFromJson({
11
11
  roots: {},
12
12
  domain: { "namespaces": { "public": { "models": {} } } },
13
13
  storage: {
14
- "namespaces": { "public": {
15
- "id": "public",
16
- "kind": "postgres-schema",
17
- "tables": {}
18
- } },
19
- "storageHash": "sha256:5dde71f8985299c9eb464edb00d06e2bdef0501bd30b072a614afb48ed4dc21b"
14
+ "namespaces": {
15
+ "__unbound__": {
16
+ "entries": { "table": {} },
17
+ "id": "__unbound__",
18
+ "kind": "postgres-unbound-schema"
19
+ },
20
+ "public": {
21
+ "entries": { "table": {} },
22
+ "id": "public",
23
+ "kind": "postgres-schema"
24
+ }
25
+ },
26
+ "storageHash": "sha256:6214fc543ea5ffa1c5bdf6f663e62c61b6a3f04460e1e27bf7f47f1544f11603"
20
27
  },
21
28
  capabilities: {
22
29
  "postgres": {
@@ -46,10 +53,10 @@ const paradedbContractSpace = contractSpaceFromJson({
46
53
  dirName: "20260601T0000_install_pg_search_extension",
47
54
  metadata: {
48
55
  from: null,
49
- to: "sha256:5dde71f8985299c9eb464edb00d06e2bdef0501bd30b072a614afb48ed4dc21b",
56
+ to: "sha256:6214fc543ea5ffa1c5bdf6f663e62c61b6a3f04460e1e27bf7f47f1544f11603",
50
57
  providedInvariants: ["paradedb:install-pg-search-v1"],
51
58
  createdAt: "2026-06-01T00:00:00.000Z",
52
- migrationHash: "sha256:9e41d989a1c9715d67ced43dd0ee4210b06641a6fd78a124b77798d27272e704"
59
+ migrationHash: "sha256:71fba51945d5d0d8f6a7e2e7e6a58d1c90d789d4affe348c195db586f088d971"
53
60
  },
54
61
  ops: [{
55
62
  "id": "paradedb.install-pg-search-extension",
@@ -79,7 +86,7 @@ const paradedbContractSpace = contractSpaceFromJson({
79
86
  }]
80
87
  }],
81
88
  headRef: {
82
- hash: "sha256:5dde71f8985299c9eb464edb00d06e2bdef0501bd30b072a614afb48ed4dc21b",
89
+ hash: "sha256:6214fc543ea5ffa1c5bdf6f663e62c61b6a3f04460e1e27bf7f47f1544f11603",
83
90
  invariants: ["paradedb:install-pg-search-v1"]
84
91
  }
85
92
  });
@@ -1 +1 @@
1
- {"version":3,"file":"control.mjs","names":["baselineMetadata","baselineOps"],"sources":["../migrations/20260601T0000_install_pg_search_extension/migration.json","../migrations/20260601T0000_install_pg_search_extension/ops.json","../migrations/refs/head.json","../src/contract.json","../src/exports/control.ts"],"sourcesContent":["","","","","/**\n * Control-plane descriptor for the paradedb extension.\n *\n * **Contract-space package layout.** The extension's contract\n * + migrations are emitted by the same pipeline application authors use:\n *\n * `prisma-next contract emit` → `<package>/src/contract.{json,d.ts}`\n * `prisma-next migration plan` → `<package>/migrations/<dir>/...`\n *\n * The descriptor wires those JSON artefacts via JSON-import declarations\n * so they flow through the consuming application's module resolver\n * without filesystem assumptions, and synthesises the canonical\n * {@link import('@prisma-next/framework-components/control').MigrationPackage}\n * shape for the framework's runner / verifier to consume. Readers in\n * `@prisma-next/migration-tools` add `dirPath` when loading from disk\n * (`OnDiskMigrationPackage`); descriptor-bundled packages do not need\n * it because the framework reads them directly from the descriptor.\n *\n * Wired surfaces:\n *\n * - `contractSpace.{contractJson,migrations,headRef}` — sourced from\n * the on-disk artefacts emitted by `build:contract-space`.\n * - `queryOperations` — BM25 full-text search operations registered\n * via `paradedbQueryOperations()`.\n *\n * @see docs/architecture docs/adrs/ADR 212 - Contract spaces.md\n * (contract-space package layout convention).\n */\n\nimport type { Contract } from '@prisma-next/contract/types';\nimport type { SqlControlExtensionDescriptor } from '@prisma-next/family-sql/control';\nimport { contractSpaceFromJson } from '@prisma-next/migration-tools/spaces';\nimport type { SqlStorage } from '@prisma-next/sql-contract/types';\nimport baselineMetadata from '../../migrations/20260601T0000_install_pg_search_extension/migration.json' with {\n type: 'json',\n};\nimport baselineOps from '../../migrations/20260601T0000_install_pg_search_extension/ops.json' with {\n type: 'json',\n};\nimport headRef from '../../migrations/refs/head.json' with { type: 'json' };\nimport contractJson from '../contract.json' with { type: 'json' };\nimport { PARADEDB_SPACE_ID } from '../core/constants';\nimport { paradedbPackMeta, paradedbQueryOperations } from '../core/descriptor-meta';\n\nconst BASELINE_DIR_NAME = '20260601T0000_install_pg_search_extension';\n\nconst paradedbContractSpace = contractSpaceFromJson<Contract<SqlStorage>>({\n contractJson,\n migrations: [\n {\n dirName: BASELINE_DIR_NAME,\n metadata: baselineMetadata,\n ops: baselineOps,\n },\n ],\n headRef,\n});\n\nconst paradedbExtensionDescriptor: SqlControlExtensionDescriptor<'postgres'> = {\n ...paradedbPackMeta,\n id: PARADEDB_SPACE_ID,\n contractSpace: paradedbContractSpace,\n queryOperations: () => paradedbQueryOperations(),\n create: () => ({\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n }),\n};\n\nexport { paradedbExtensionDescriptor, paradedbPackMeta };\nexport default paradedbExtensionDescriptor;\n"],"mappings":";;;;AI8CA,MAAM,wBAAwB,sBAA4C;CACxE,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAA;CACA,YAAY,CACV;EACE,SAAS;EACT,UAAUA;;;;;;EAAAA;EACV,KAAKC;;;;;;;;;;;;;;;;;;;;;;;;;GAAAA;CACP,CACF;CACA,SAAA;;;CAAA;AACF,CAAC;AAED,MAAM,8BAAyE;CAC7E,GAAG;CACH,IAAI;CACJ,eAAe;CACf,uBAAuB,wBAAwB;CAC/C,eAAe;EACb,UAAU;EACV,UAAU;CACZ;AACF"}
1
+ {"version":3,"file":"control.mjs","names":["baselineMetadata","baselineOps"],"sources":["../migrations/20260601T0000_install_pg_search_extension/migration.json","../migrations/20260601T0000_install_pg_search_extension/ops.json","../migrations/refs/head.json","../src/contract.json","../src/exports/control.ts"],"sourcesContent":["","","","","/**\n * Control-plane descriptor for the paradedb extension.\n *\n * **Contract-space package layout.** The extension's contract\n * + migrations are emitted by the same pipeline application authors use:\n *\n * `prisma-next contract emit` → `<package>/src/contract.{json,d.ts}`\n * `prisma-next migration plan` → `<package>/migrations/<dir>/...`\n *\n * The descriptor wires those JSON artefacts via JSON-import declarations\n * so they flow through the consuming application's module resolver\n * without filesystem assumptions, and synthesises the canonical\n * {@link import('@prisma-next/framework-components/control').MigrationPackage}\n * shape for the framework's runner / verifier to consume. Readers in\n * `@prisma-next/migration-tools` add `dirPath` when loading from disk\n * (`OnDiskMigrationPackage`); descriptor-bundled packages do not need\n * it because the framework reads them directly from the descriptor.\n *\n * Wired surfaces:\n *\n * - `contractSpace.{contractJson,migrations,headRef}` — sourced from\n * the on-disk artefacts emitted by `build:contract-space`.\n * - `queryOperations` — BM25 full-text search operations registered\n * via `paradedbQueryOperations()`.\n *\n * @see docs/architecture docs/adrs/ADR 212 - Contract spaces.md\n * (contract-space package layout convention).\n */\n\nimport type { Contract } from '@prisma-next/contract/types';\nimport type { SqlControlExtensionDescriptor } from '@prisma-next/family-sql/control';\nimport { contractSpaceFromJson } from '@prisma-next/migration-tools/spaces';\nimport type { SqlStorage } from '@prisma-next/sql-contract/types';\nimport baselineMetadata from '../../migrations/20260601T0000_install_pg_search_extension/migration.json' with {\n type: 'json',\n};\nimport baselineOps from '../../migrations/20260601T0000_install_pg_search_extension/ops.json' with {\n type: 'json',\n};\nimport headRef from '../../migrations/refs/head.json' with { type: 'json' };\nimport contractJson from '../contract.json' with { type: 'json' };\nimport { PARADEDB_SPACE_ID } from '../core/constants';\nimport { paradedbPackMeta, paradedbQueryOperations } from '../core/descriptor-meta';\n\nconst BASELINE_DIR_NAME = '20260601T0000_install_pg_search_extension';\n\nconst paradedbContractSpace = contractSpaceFromJson<Contract<SqlStorage>>({\n contractJson,\n migrations: [\n {\n dirName: BASELINE_DIR_NAME,\n metadata: baselineMetadata,\n ops: baselineOps,\n },\n ],\n headRef,\n});\n\nconst paradedbExtensionDescriptor: SqlControlExtensionDescriptor<'postgres'> = {\n ...paradedbPackMeta,\n id: PARADEDB_SPACE_ID,\n contractSpace: paradedbContractSpace,\n queryOperations: () => paradedbQueryOperations(),\n create: () => ({\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n }),\n};\n\nexport { paradedbExtensionDescriptor, paradedbPackMeta };\nexport default paradedbExtensionDescriptor;\n"],"mappings":";;;;AI8CA,MAAM,wBAAwB,sBAA4C;CACxE,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAA;CACA,YAAY,CACV;EACE,SAAS;EACT,UAAUA;;;;;;EAAAA;EACV,KAAKC;;;;;;;;;;;;;;;;;;;;;;;;;GAAAA;CACP,CACF;CACA,SAAA;;;CAAA;AACF,CAAC;AAED,MAAM,8BAAyE;CAC7E,GAAG;CACH,IAAI;CACJ,eAAe;CACf,uBAAuB,wBAAwB;CAC/C,eAAe;EACb,UAAU;EACV,UAAU;CACZ;AACF"}
package/package.json CHANGED
@@ -1,30 +1,30 @@
1
1
  {
2
2
  "name": "@prisma-next/extension-paradedb",
3
- "version": "0.12.0-dev.5",
3
+ "version": "0.12.0-dev.51",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "dependencies": {
8
- "@prisma-next/contract": "0.12.0-dev.5",
9
- "@prisma-next/contract-authoring": "0.12.0-dev.5",
10
- "@prisma-next/family-sql": "0.12.0-dev.5",
11
- "@prisma-next/framework-components": "0.12.0-dev.5",
12
- "@prisma-next/migration-tools": "0.12.0-dev.5",
13
- "@prisma-next/sql-contract": "0.12.0-dev.5",
14
- "@prisma-next/sql-operations": "0.12.0-dev.5",
15
- "@prisma-next/sql-relational-core": "0.12.0-dev.5",
16
- "@prisma-next/sql-runtime": "0.12.0-dev.5",
8
+ "@prisma-next/contract": "0.12.0-dev.51",
9
+ "@prisma-next/contract-authoring": "0.12.0-dev.51",
10
+ "@prisma-next/family-sql": "0.12.0-dev.51",
11
+ "@prisma-next/framework-components": "0.12.0-dev.51",
12
+ "@prisma-next/migration-tools": "0.12.0-dev.51",
13
+ "@prisma-next/sql-contract": "0.12.0-dev.51",
14
+ "@prisma-next/sql-operations": "0.12.0-dev.51",
15
+ "@prisma-next/sql-relational-core": "0.12.0-dev.51",
16
+ "@prisma-next/sql-runtime": "0.12.0-dev.51",
17
17
  "arktype": "^2.2.0"
18
18
  },
19
19
  "devDependencies": {
20
- "@prisma-next/adapter-postgres": "0.12.0-dev.5",
21
- "@prisma-next/cli": "0.12.0-dev.5",
22
- "@prisma-next/operations": "0.12.0-dev.5",
23
- "@prisma-next/sql-contract-ts": "0.12.0-dev.5",
24
- "@prisma-next/target-postgres": "0.12.0-dev.5",
25
- "@prisma-next/test-utils": "0.12.0-dev.5",
26
- "@prisma-next/tsconfig": "0.12.0-dev.5",
27
- "@prisma-next/tsdown": "0.12.0-dev.5",
20
+ "@prisma-next/adapter-postgres": "0.12.0-dev.51",
21
+ "@prisma-next/cli": "0.12.0-dev.51",
22
+ "@prisma-next/operations": "0.12.0-dev.51",
23
+ "@prisma-next/sql-contract-ts": "0.12.0-dev.51",
24
+ "@prisma-next/target-postgres": "0.12.0-dev.51",
25
+ "@prisma-next/test-utils": "0.12.0-dev.51",
26
+ "@prisma-next/tsconfig": "0.12.0-dev.51",
27
+ "@prisma-next/tsdown": "0.12.0-dev.51",
28
28
  "tsdown": "0.22.0",
29
29
  "typescript": "5.9.3",
30
30
  "vitest": "4.1.6"
package/src/contract.d.ts CHANGED
@@ -23,7 +23,7 @@ import type {
23
23
  } from '@prisma-next/sql-contract/types';
24
24
  import type {
25
25
  Contract as ContractType,
26
- ContractModelsMap,
26
+ ContractModelDefinitions,
27
27
  ExecutionHashBase,
28
28
  NamespaceId,
29
29
  ProfileHashBase,
@@ -31,7 +31,7 @@ import type {
31
31
  } from '@prisma-next/contract/types';
32
32
 
33
33
  export type StorageHash =
34
- StorageHashBase<'sha256:5dde71f8985299c9eb464edb00d06e2bdef0501bd30b072a614afb48ed4dc21b'>;
34
+ StorageHashBase<'sha256:6214fc543ea5ffa1c5bdf6f663e62c61b6a3f04460e1e27bf7f47f1544f11603'>;
35
35
  export type ExecutionHash = ExecutionHashBase<string>;
36
36
  export type ProfileHash =
37
37
  ProfileHashBase<'sha256:9c8aa3114e84ed3b7ea2bd57526d9c2e1bf7c5292be694e9d3801f566fda7ccb'>;
@@ -56,10 +56,15 @@ type ContractBase = Omit<
56
56
  ContractType<
57
57
  {
58
58
  readonly namespaces: {
59
+ readonly __unbound__: {
60
+ readonly id: '__unbound__';
61
+ readonly kind: 'sql-namespace';
62
+ readonly entries: { readonly table: {} };
63
+ };
59
64
  readonly public: {
60
65
  readonly id: 'public';
61
66
  readonly kind: 'sql-namespace';
62
- readonly tables: {};
67
+ readonly entries: { readonly table: {} };
63
68
  };
64
69
  };
65
70
  readonly storageHash: StorageHash;
@@ -100,7 +105,8 @@ type ContractBase = Omit<
100
105
  readonly profileHash: ProfileHash;
101
106
  };
102
107
 
108
+ export type Models = ContractModelDefinitions<Contract>;
109
+
103
110
  export type Contract = ContractWithTypeMaps<ContractBase, TypeMaps>;
104
111
 
105
112
  export type Namespaces = Contract['storage']['namespaces'];
106
- export type Models = ContractModelsMap<Contract>;
package/src/contract.json CHANGED
@@ -13,13 +13,22 @@
13
13
  },
14
14
  "storage": {
15
15
  "namespaces": {
16
+ "__unbound__": {
17
+ "entries": {
18
+ "table": {}
19
+ },
20
+ "id": "__unbound__",
21
+ "kind": "postgres-unbound-schema"
22
+ },
16
23
  "public": {
24
+ "entries": {
25
+ "table": {}
26
+ },
17
27
  "id": "public",
18
- "kind": "postgres-schema",
19
- "tables": {}
28
+ "kind": "postgres-schema"
20
29
  }
21
30
  },
22
- "storageHash": "sha256:5dde71f8985299c9eb464edb00d06e2bdef0501bd30b072a614afb48ed4dc21b"
31
+ "storageHash": "sha256:6214fc543ea5ffa1c5bdf6f663e62c61b6a3f04460e1e27bf7f47f1544f11603"
23
32
  },
24
33
  "capabilities": {
25
34
  "postgres": {