@prisma-next/extension-paradedb 0.11.0-dev.9 → 0.12.0

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
@@ -75,8 +75,8 @@ ParadeDB BM25 indexes require a `key_field` — a unique column that identifies
75
75
 
76
76
  The extension's contract + baseline migration are emitted on-disk inside this package using the same pipeline application authors use:
77
77
 
78
- - `pnpm build:contract-space` — runs `prisma-next contract emit` to produce `src/contract.{json,d.ts}` from the PSL source at `src/contract.prisma`.
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 source 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).
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
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
81
  - `migrations/refs/head.json` is hand-pinned with the latest migration's `to` hash + `providedInvariants`.
82
82
 
@@ -1 +1 @@
1
- {"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/descriptor-meta.ts","../src/exports/control.ts"],"mappings":";;;;cAmMa,gBAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;cCzIP,2BAAA,EAA6B,6BAAA"}
1
+ {"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/descriptor-meta.ts","../src/exports/control.ts"],"mappings":";;;;cAmMa,gBAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;cCzIP,2BAAA,EAA6B,6BAA6B"}
package/dist/control.mjs CHANGED
@@ -7,19 +7,20 @@ const paradedbContractSpace = contractSpaceFromJson({
7
7
  schemaVersion: "1",
8
8
  targetFamily: "sql",
9
9
  target: "postgres",
10
- profileHash: "sha256:1a8dbe044289f30a1de958fe800cc5a8378b285d2e126a8c44b58864bac2c18e",
10
+ profileHash: "sha256:9c8aa3114e84ed3b7ea2bd57526d9c2e1bf7c5292be694e9d3801f566fda7ccb",
11
11
  roots: {},
12
- models: {},
12
+ domain: { "namespaces": { "public": { "models": {} } } },
13
13
  storage: {
14
- "namespaces": { "__unbound__": {
15
- "id": "__unbound__",
16
- "kind": "postgres-unbound-schema",
14
+ "namespaces": { "public": {
15
+ "id": "public",
16
+ "kind": "postgres-schema",
17
17
  "tables": {}
18
18
  } },
19
- "storageHash": "sha256:59877923532fc526703f572f1d54bdd6050502ef30ede3333ee1393ea93b9716"
19
+ "storageHash": "sha256:5dde71f8985299c9eb464edb00d06e2bdef0501bd30b072a614afb48ed4dc21b"
20
20
  },
21
21
  capabilities: {
22
22
  "postgres": {
23
+ "distinctOn": true,
23
24
  "jsonAgg": true,
24
25
  "lateral": true,
25
26
  "limit": true,
@@ -29,6 +30,7 @@ const paradedbContractSpace = contractSpaceFromJson({
29
30
  "sql": {
30
31
  "defaultInInsert": true,
31
32
  "enums": true,
33
+ "lateral": true,
32
34
  "returning": true
33
35
  }
34
36
  },
@@ -44,16 +46,10 @@ const paradedbContractSpace = contractSpaceFromJson({
44
46
  dirName: "20260601T0000_install_pg_search_extension",
45
47
  metadata: {
46
48
  from: null,
47
- to: "sha256:59877923532fc526703f572f1d54bdd6050502ef30ede3333ee1393ea93b9716",
48
- labels: [],
49
+ to: "sha256:5dde71f8985299c9eb464edb00d06e2bdef0501bd30b072a614afb48ed4dc21b",
49
50
  providedInvariants: ["paradedb:install-pg-search-v1"],
50
51
  createdAt: "2026-06-01T00:00:00.000Z",
51
- hints: {
52
- "used": [],
53
- "applied": [],
54
- "plannerVersion": "2.0.0"
55
- },
56
- migrationHash: "sha256:b5e39b2ca76fcf9fb4fc0cb989c702549d984d09236742ad950658b7ed05bdc3"
52
+ migrationHash: "sha256:9e41d989a1c9715d67ced43dd0ee4210b06641a6fd78a124b77798d27272e704"
57
53
  },
58
54
  ops: [{
59
55
  "id": "paradedb.install-pg-search-extension",
@@ -83,7 +79,7 @@ const paradedbContractSpace = contractSpaceFromJson({
83
79
  }]
84
80
  }],
85
81
  headRef: {
86
- hash: "sha256:59877923532fc526703f572f1d54bdd6050502ef30ede3333ee1393ea93b9716",
82
+ hash: "sha256:5dde71f8985299c9eb464edb00d06e2bdef0501bd30b072a614afb48ed4dc21b",
87
83
  invariants: ["paradedb:install-pg-search-v1"]
88
84
  }
89
85
  });
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;CACA,YAAY,CACV;EACE,SAAS;EACT,UAAUA;;;;;;;;;;;;GAAAA;EACV,KAAKC;;;;;;;;;;;;;;;;;;;;;;;;;IAAAA;EACN,CACF;CACD,SAAA;;;EAAA;CACD,CAAC;AAEF,MAAM,8BAAyE;CAC7E,GAAG;CACH,IAAI;CACJ,eAAe;CACf,uBAAuB,yBAAyB;CAChD,eAAe;EACb,UAAU;EACV,UAAU;EACX;CACF"}
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 +1 @@
1
- {"version":3,"file":"descriptor-meta-CPQfeTa-.mjs","names":["TEXT","TEXT_REF"],"sources":["../src/core/constants.ts","../src/core/proximity-chain.ts","../src/core/descriptor-meta.ts"],"sourcesContent":["/**\n * Extension ID for ParadeDB pg_search.\n */\nexport const PARADEDB_EXTENSION_ID = 'paradedb' as const;\n\n/**\n * Static names and identifiers used across paradedb's contract space.\n *\n * Centralised here so the contract IR (`./contract`), the baseline\n * migration ops (`./migrations`), the head ref, and the descriptor\n * (`../exports/control`) all reference the same values without typos.\n *\n * The space identifier `'paradedb'` is what the framework writes to\n * `migrations/` in the user's repo and what the marker table's\n * `space` column carries for paradedb-owned rows.\n *\n * The `paradedb:*` invariantId namespace is locked here — once\n * published, an invariantId is immutable so downstream consumers can\n * reference it by literal string match.\n */\nexport const PARADEDB_SPACE_ID = 'paradedb' as const;\n\nexport const PARADEDB_BASELINE_MIGRATION_NAME =\n '20260601T0000_install_pg_search_extension' as const;\n\n/**\n * `paradedb:*` invariantIds emitted by the baseline migration. Each id,\n * once published, is immutable: downstream consumers reference them by\n * literal string match.\n */\nexport const PARADEDB_INVARIANTS = {\n installPgSearch: 'paradedb:install-pg-search-v1',\n} as const;\n","import {\n type AnyExpression,\n LiteralExpr,\n OperationExpr,\n} from '@prisma-next/sql-relational-core/ast';\nimport { type Expression, toExpr } from '@prisma-next/sql-relational-core/expression';\n\nconst TEXT = 'pg/text@1' as const;\nconst TEXT_REF = { codecId: TEXT } as const;\n\nexport type ProximityTerm = unknown;\n\nexport interface ProximityWithinOptions {\n readonly ordered?: boolean;\n}\n\ninterface ProximityStep {\n readonly distance: number;\n readonly term: ProximityTerm;\n readonly ordered: boolean;\n}\n\n// https://docs.paradedb.com/documentation/full-text/proximity\nexport class ParadeDbProximityChain\n implements Expression<{ codecId: 'pg/text@1'; nullable: false }>\n{\n readonly returnType = { codecId: TEXT, nullable: false } as const;\n\n private readonly start: ProximityTerm;\n private readonly steps: readonly ProximityStep[];\n\n constructor(start: ProximityTerm, steps: readonly ProximityStep[] = []) {\n this.start = start;\n this.steps = steps;\n }\n\n within(\n distance: number,\n term: ProximityTerm,\n options?: ProximityWithinOptions,\n ): ParadeDbProximityChain {\n if (!Number.isInteger(distance) || distance < 0) {\n throw new Error(\n `paradeDbProximity.within: distance must be a non-negative integer; got ${String(distance)}`,\n );\n }\n return new ParadeDbProximityChain(this.start, [\n ...this.steps,\n { distance, term, ordered: options?.ordered === true },\n ]);\n }\n\n buildAst(): AnyExpression {\n if (this.steps.length === 0) {\n throw new Error(\n 'paradeDbProximity: chain must have at least one .within(distance, term) step',\n );\n }\n const args: AnyExpression[] = [toExpr(this.start, TEXT_REF)];\n let template = '({{self}}';\n this.steps.forEach((step, i) => {\n const op = step.ordered ? '##>' : '##';\n args.push(LiteralExpr.of(step.distance));\n args.push(toExpr(step.term, TEXT_REF));\n template += ` ${op} {{arg${2 * i}}} ${op} {{arg${2 * i + 1}}}`;\n });\n template += ')';\n const [self, ...rest] = args;\n if (!self) {\n throw new Error('paradeDbProximity: invariant violation — empty args');\n }\n return new OperationExpr({\n method: 'paradeDbProximity',\n self,\n args: rest.length > 0 ? rest : undefined,\n returns: this.returnType,\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template,\n },\n });\n }\n}\n","import { LiteralExpr } from '@prisma-next/sql-relational-core/ast';\nimport { buildOperation, toExpr } from '@prisma-next/sql-relational-core/expression';\nimport { paradedbIndexTypes } from '../types/index-types';\nimport type { QueryOperationTypes } from '../types/operation-types';\nimport { PARADEDB_EXTENSION_ID } from './constants';\nimport { ParadeDbProximityChain } from './proximity-chain';\n\ntype CodecTypesBase = Record<string, { readonly input: unknown; readonly output: unknown }>;\n\nconst TEXT = 'pg/text@1' as const;\nconst BOOL = 'pg/bool@1' as const;\nconst FLOAT4 = 'pg/float4@1' as const;\nconst INT4 = 'pg/int4@1' as const;\n\nconst TEXT_REF = { codecId: TEXT } as const;\nconst INT4_REF = { codecId: INT4 } as const;\n\nexport function paradedbQueryOperations<CT extends CodecTypesBase>(): QueryOperationTypes<CT> {\n return {\n // `@@@` accepts both text and structured query types on its RHS.\n // https://docs.paradedb.com/documentation/full-text/match\n paradeDbMatch: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbMatch',\n args: [toExpr(self, TEXT_REF), toExpr(query, TEXT_REF)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} @@@ {{arg0}}',\n },\n }),\n },\n paradeDbMatchAny: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbMatchAny',\n args: [toExpr(self, TEXT_REF), toExpr(query, TEXT_REF)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} ||| {{arg0}}',\n },\n }),\n },\n paradeDbMatchAll: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbMatchAll',\n args: [toExpr(self, TEXT_REF), toExpr(query, TEXT_REF)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} &&& {{arg0}}',\n },\n }),\n },\n // https://docs.paradedb.com/documentation/full-text/term\n paradeDbTerm: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbTerm',\n args: [toExpr(self, TEXT_REF), toExpr(query, TEXT_REF)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} === {{arg0}}',\n },\n }),\n },\n // https://docs.paradedb.com/documentation/full-text/phrase\n paradeDbPhrase: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbPhrase',\n args: [toExpr(self, TEXT_REF), toExpr(query, TEXT_REF)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} ### {{arg0}}',\n },\n }),\n },\n // https://docs.paradedb.com/documentation/sorting/score\n paradeDbScore: {\n self: { codecId: INT4 },\n impl: (self) =>\n buildOperation({\n method: 'paradeDbScore',\n args: [toExpr(self, INT4_REF)],\n returns: { codecId: FLOAT4, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: 'pdb.score({{self}})',\n },\n }),\n },\n // PG rejects parameterized typmods, so the cast argument lowers to a literal.\n // https://docs.paradedb.com/documentation/full-text/fuzzy\n paradeDbFuzzy: {\n self: { codecId: TEXT },\n impl: (self, distance) => {\n if (!Number.isInteger(distance) || distance < 0 || distance > 2) {\n throw new Error(\n `paradeDbFuzzy: distance must be an integer in [0, 2]; got ${String(distance)}`,\n );\n }\n return buildOperation({\n method: 'paradeDbFuzzy',\n args: [toExpr(self, TEXT_REF), LiteralExpr.of(distance)],\n returns: { codecId: TEXT, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}}::pdb.fuzzy({{arg0}})',\n },\n });\n },\n },\n // https://docs.paradedb.com/documentation/sorting/boost\n paradeDbBoost: {\n self: { codecId: TEXT },\n impl: (self, weight) => {\n if (!Number.isInteger(weight) || weight < -2048 || weight > 2048) {\n throw new Error(\n `paradeDbBoost: boost must be an integer in [-2048, 2048]; got ${String(weight)}`,\n );\n }\n return buildOperation({\n method: 'paradeDbBoost',\n args: [toExpr(self, TEXT_REF), LiteralExpr.of(weight)],\n returns: { codecId: TEXT, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}}::pdb.boost({{arg0}})',\n },\n });\n },\n },\n paradeDbConst: {\n self: { codecId: TEXT },\n impl: (self, value) => {\n if (!Number.isInteger(value)) {\n throw new Error(`paradeDbConst: value must be an integer; got ${String(value)}`);\n }\n return buildOperation({\n method: 'paradeDbConst',\n args: [toExpr(self, TEXT_REF), LiteralExpr.of(value)],\n returns: { codecId: TEXT, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}}::pdb.const({{arg0}})',\n },\n });\n },\n },\n paradeDbSlop: {\n self: { codecId: TEXT },\n impl: (self, slop) => {\n if (!Number.isInteger(slop) || slop < 0) {\n throw new Error(`paradeDbSlop: slop must be a non-negative integer; got ${String(slop)}`);\n }\n return buildOperation({\n method: 'paradeDbSlop',\n args: [toExpr(self, TEXT_REF), LiteralExpr.of(slop)],\n returns: { codecId: TEXT, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}}::pdb.slop({{arg0}})',\n },\n });\n },\n },\n // https://docs.paradedb.com/documentation/full-text/proximity\n paradeDbProximity: {\n self: { codecId: TEXT },\n impl: (start) => new ParadeDbProximityChain(start),\n },\n };\n}\n\nexport const paradedbPackMeta = {\n kind: 'extension',\n id: PARADEDB_EXTENSION_ID,\n familyId: 'sql',\n targetId: 'postgres',\n version: '0.0.1',\n capabilities: {\n postgres: {\n 'paradedb/bm25': true,\n },\n },\n indexTypes: paradedbIndexTypes,\n types: {\n queryOperationTypes: {\n import: {\n package: '@prisma-next/extension-paradedb/operation-types',\n named: 'QueryOperationTypes',\n alias: 'ParadeDbQueryOperationTypes',\n },\n },\n },\n} as const;\n"],"mappings":";;;;;;;AAGA,MAAa,wBAAwB;;;;;;;;;;;;;;;;AAiBrC,MAAa,oBAAoB;;;ACbjC,MAAMA,SAAO;AACb,MAAMC,aAAW,EAAE,SAASD,QAAM;AAelC,IAAa,yBAAb,MAAa,uBAEb;CACE,aAAsB;EAAE,SAASA;EAAM,UAAU;EAAO;CAExD;CACA;CAEA,YAAY,OAAsB,QAAkC,EAAE,EAAE;EACtE,KAAK,QAAQ;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,UAAU;MACV,UAAU;MACX;KACF,CAAC;;GAEL;EACD,cAAc;GACZ,MAAM,EAAE,SAAS,MAAM;GACvB,OAAO,MAAM,SAAS;IACpB,IAAI,CAAC,OAAO,UAAU,KAAK,IAAI,OAAO,GACpC,MAAM,IAAI,MAAM,0DAA0D,OAAO,KAAK,GAAG;IAE3F,OAAO,eAAe;KACpB,QAAQ;KACR,MAAM,CAAC,OAAO,MAAM,SAAS,EAAE,YAAY,GAAG,KAAK,CAAC;KACpD,SAAS;MAAE,SAAS;MAAM,UAAU;MAAO;KAC3C,UAAU;MACR,cAAc;MACd,UAAU;MACV,UAAU;MACX;KACF,CAAC;;GAEL;EAED,mBAAmB;GACjB,MAAM,EAAE,SAAS,MAAM;GACvB,OAAO,UAAU,IAAI,uBAAuB,MAAM;GACnD;EACF;;AAGH,MAAa,mBAAmB;CAC9B,MAAM;CACN,IAAI;CACJ,UAAU;CACV,UAAU;CACV,SAAS;CACT,cAAc,EACZ,UAAU,EACR,iBAAiB,MAClB,EACF;CACD,YAAY;CACZ,OAAO,EACL,qBAAqB,EACnB,QAAQ;EACN,SAAS;EACT,OAAO;EACP,OAAO;EACR,EACF,EACF;CACF"}
1
+ {"version":3,"file":"descriptor-meta-CPQfeTa-.mjs","names":["TEXT","TEXT_REF"],"sources":["../src/core/constants.ts","../src/core/proximity-chain.ts","../src/core/descriptor-meta.ts"],"sourcesContent":["/**\n * Extension ID for ParadeDB pg_search.\n */\nexport const PARADEDB_EXTENSION_ID = 'paradedb' as const;\n\n/**\n * Static names and identifiers used across paradedb's contract space.\n *\n * Centralised here so the contract IR (`./contract`), the baseline\n * migration ops (`./migrations`), the head ref, and the descriptor\n * (`../exports/control`) all reference the same values without typos.\n *\n * The space identifier `'paradedb'` is what the framework writes to\n * `migrations/` in the user's repo and what the marker table's\n * `space` column carries for paradedb-owned rows.\n *\n * The `paradedb:*` invariantId namespace is locked here — once\n * published, an invariantId is immutable so downstream consumers can\n * reference it by literal string match.\n */\nexport const PARADEDB_SPACE_ID = 'paradedb' as const;\n\nexport const PARADEDB_BASELINE_MIGRATION_NAME =\n '20260601T0000_install_pg_search_extension' as const;\n\n/**\n * `paradedb:*` invariantIds emitted by the baseline migration. Each id,\n * once published, is immutable: downstream consumers reference them by\n * literal string match.\n */\nexport const PARADEDB_INVARIANTS = {\n installPgSearch: 'paradedb:install-pg-search-v1',\n} as const;\n","import {\n type AnyExpression,\n LiteralExpr,\n OperationExpr,\n} from '@prisma-next/sql-relational-core/ast';\nimport { type Expression, toExpr } from '@prisma-next/sql-relational-core/expression';\n\nconst TEXT = 'pg/text@1' as const;\nconst TEXT_REF = { codecId: TEXT } as const;\n\nexport type ProximityTerm = unknown;\n\nexport interface ProximityWithinOptions {\n readonly ordered?: boolean;\n}\n\ninterface ProximityStep {\n readonly distance: number;\n readonly term: ProximityTerm;\n readonly ordered: boolean;\n}\n\n// https://docs.paradedb.com/documentation/full-text/proximity\nexport class ParadeDbProximityChain\n implements Expression<{ codecId: 'pg/text@1'; nullable: false }>\n{\n readonly returnType = { codecId: TEXT, nullable: false } as const;\n\n private readonly start: ProximityTerm;\n private readonly steps: readonly ProximityStep[];\n\n constructor(start: ProximityTerm, steps: readonly ProximityStep[] = []) {\n this.start = start;\n this.steps = steps;\n }\n\n within(\n distance: number,\n term: ProximityTerm,\n options?: ProximityWithinOptions,\n ): ParadeDbProximityChain {\n if (!Number.isInteger(distance) || distance < 0) {\n throw new Error(\n `paradeDbProximity.within: distance must be a non-negative integer; got ${String(distance)}`,\n );\n }\n return new ParadeDbProximityChain(this.start, [\n ...this.steps,\n { distance, term, ordered: options?.ordered === true },\n ]);\n }\n\n buildAst(): AnyExpression {\n if (this.steps.length === 0) {\n throw new Error(\n 'paradeDbProximity: chain must have at least one .within(distance, term) step',\n );\n }\n const args: AnyExpression[] = [toExpr(this.start, TEXT_REF)];\n let template = '({{self}}';\n this.steps.forEach((step, i) => {\n const op = step.ordered ? '##>' : '##';\n args.push(LiteralExpr.of(step.distance));\n args.push(toExpr(step.term, TEXT_REF));\n template += ` ${op} {{arg${2 * i}}} ${op} {{arg${2 * i + 1}}}`;\n });\n template += ')';\n const [self, ...rest] = args;\n if (!self) {\n throw new Error('paradeDbProximity: invariant violation — empty args');\n }\n return new OperationExpr({\n method: 'paradeDbProximity',\n self,\n args: rest.length > 0 ? rest : undefined,\n returns: this.returnType,\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template,\n },\n });\n }\n}\n","import { LiteralExpr } from '@prisma-next/sql-relational-core/ast';\nimport { buildOperation, toExpr } from '@prisma-next/sql-relational-core/expression';\nimport { paradedbIndexTypes } from '../types/index-types';\nimport type { QueryOperationTypes } from '../types/operation-types';\nimport { PARADEDB_EXTENSION_ID } from './constants';\nimport { ParadeDbProximityChain } from './proximity-chain';\n\ntype CodecTypesBase = Record<string, { readonly input: unknown; readonly output: unknown }>;\n\nconst TEXT = 'pg/text@1' as const;\nconst BOOL = 'pg/bool@1' as const;\nconst FLOAT4 = 'pg/float4@1' as const;\nconst INT4 = 'pg/int4@1' as const;\n\nconst TEXT_REF = { codecId: TEXT } as const;\nconst INT4_REF = { codecId: INT4 } as const;\n\nexport function paradedbQueryOperations<CT extends CodecTypesBase>(): QueryOperationTypes<CT> {\n return {\n // `@@@` accepts both text and structured query types on its RHS.\n // https://docs.paradedb.com/documentation/full-text/match\n paradeDbMatch: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbMatch',\n args: [toExpr(self, TEXT_REF), toExpr(query, TEXT_REF)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} @@@ {{arg0}}',\n },\n }),\n },\n paradeDbMatchAny: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbMatchAny',\n args: [toExpr(self, TEXT_REF), toExpr(query, TEXT_REF)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} ||| {{arg0}}',\n },\n }),\n },\n paradeDbMatchAll: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbMatchAll',\n args: [toExpr(self, TEXT_REF), toExpr(query, TEXT_REF)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} &&& {{arg0}}',\n },\n }),\n },\n // https://docs.paradedb.com/documentation/full-text/term\n paradeDbTerm: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbTerm',\n args: [toExpr(self, TEXT_REF), toExpr(query, TEXT_REF)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} === {{arg0}}',\n },\n }),\n },\n // https://docs.paradedb.com/documentation/full-text/phrase\n paradeDbPhrase: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbPhrase',\n args: [toExpr(self, TEXT_REF), toExpr(query, TEXT_REF)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} ### {{arg0}}',\n },\n }),\n },\n // https://docs.paradedb.com/documentation/sorting/score\n paradeDbScore: {\n self: { codecId: INT4 },\n impl: (self) =>\n buildOperation({\n method: 'paradeDbScore',\n args: [toExpr(self, INT4_REF)],\n returns: { codecId: FLOAT4, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: 'pdb.score({{self}})',\n },\n }),\n },\n // PG rejects parameterized typmods, so the cast argument lowers to a literal.\n // https://docs.paradedb.com/documentation/full-text/fuzzy\n paradeDbFuzzy: {\n self: { codecId: TEXT },\n impl: (self, distance) => {\n if (!Number.isInteger(distance) || distance < 0 || distance > 2) {\n throw new Error(\n `paradeDbFuzzy: distance must be an integer in [0, 2]; got ${String(distance)}`,\n );\n }\n return buildOperation({\n method: 'paradeDbFuzzy',\n args: [toExpr(self, TEXT_REF), LiteralExpr.of(distance)],\n returns: { codecId: TEXT, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}}::pdb.fuzzy({{arg0}})',\n },\n });\n },\n },\n // https://docs.paradedb.com/documentation/sorting/boost\n paradeDbBoost: {\n self: { codecId: TEXT },\n impl: (self, weight) => {\n if (!Number.isInteger(weight) || weight < -2048 || weight > 2048) {\n throw new Error(\n `paradeDbBoost: boost must be an integer in [-2048, 2048]; got ${String(weight)}`,\n );\n }\n return buildOperation({\n method: 'paradeDbBoost',\n args: [toExpr(self, TEXT_REF), LiteralExpr.of(weight)],\n returns: { codecId: TEXT, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}}::pdb.boost({{arg0}})',\n },\n });\n },\n },\n paradeDbConst: {\n self: { codecId: TEXT },\n impl: (self, value) => {\n if (!Number.isInteger(value)) {\n throw new Error(`paradeDbConst: value must be an integer; got ${String(value)}`);\n }\n return buildOperation({\n method: 'paradeDbConst',\n args: [toExpr(self, TEXT_REF), LiteralExpr.of(value)],\n returns: { codecId: TEXT, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}}::pdb.const({{arg0}})',\n },\n });\n },\n },\n paradeDbSlop: {\n self: { codecId: TEXT },\n impl: (self, slop) => {\n if (!Number.isInteger(slop) || slop < 0) {\n throw new Error(`paradeDbSlop: slop must be a non-negative integer; got ${String(slop)}`);\n }\n return buildOperation({\n method: 'paradeDbSlop',\n args: [toExpr(self, TEXT_REF), LiteralExpr.of(slop)],\n returns: { codecId: TEXT, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}}::pdb.slop({{arg0}})',\n },\n });\n },\n },\n // https://docs.paradedb.com/documentation/full-text/proximity\n paradeDbProximity: {\n self: { codecId: TEXT },\n impl: (start) => new ParadeDbProximityChain(start),\n },\n };\n}\n\nexport const paradedbPackMeta = {\n kind: 'extension',\n id: PARADEDB_EXTENSION_ID,\n familyId: 'sql',\n targetId: 'postgres',\n version: '0.0.1',\n capabilities: {\n postgres: {\n 'paradedb/bm25': true,\n },\n },\n indexTypes: paradedbIndexTypes,\n types: {\n queryOperationTypes: {\n import: {\n package: '@prisma-next/extension-paradedb/operation-types',\n named: 'QueryOperationTypes',\n alias: 'ParadeDbQueryOperationTypes',\n },\n },\n },\n} as const;\n"],"mappings":";;;;;;;AAGA,MAAa,wBAAwB;;;;;;;;;;;;;;;;AAiBrC,MAAa,oBAAoB;;;ACbjC,MAAMA,SAAO;AACb,MAAMC,aAAW,EAAE,SAASD,OAAK;AAejC,IAAa,yBAAb,MAAa,uBAEb;CACE,aAAsB;EAAE,SAASA;EAAM,UAAU;CAAM;CAEvD;CACA;CAEA,YAAY,OAAsB,QAAkC,CAAC,GAAG;EACtE,KAAK,QAAQ;EACb,KAAK,QAAQ;CACf;CAEA,OACE,UACA,MACA,SACwB;EACxB,IAAI,CAAC,OAAO,UAAU,QAAQ,KAAK,WAAW,GAC5C,MAAM,IAAI,MACR,0EAA0E,OAAO,QAAQ,GAC3F;EAEF,OAAO,IAAI,uBAAuB,KAAK,OAAO,CAC5C,GAAG,KAAK,OACR;GAAE;GAAU;GAAM,SAAS,SAAS,YAAY;EAAK,CACvD,CAAC;CACH;CAEA,WAA0B;EACxB,IAAI,KAAK,MAAM,WAAW,GACxB,MAAM,IAAI,MACR,8EACF;EAEF,MAAM,OAAwB,CAAC,OAAO,KAAK,OAAOC,UAAQ,CAAC;EAC3D,IAAI,WAAW;EACf,KAAK,MAAM,SAAS,MAAM,MAAM;GAC9B,MAAM,KAAK,KAAK,UAAU,QAAQ;GAClC,KAAK,KAAK,YAAY,GAAG,KAAK,QAAQ,CAAC;GACvC,KAAK,KAAK,OAAO,KAAK,MAAMA,UAAQ,CAAC;GACrC,YAAY,IAAI,GAAG,QAAQ,IAAI,EAAE,KAAK,GAAG,QAAQ,IAAI,IAAI,EAAE;EAC7D,CAAC;EACD,YAAY;EACZ,MAAM,CAAC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YAAY;CACZ,OAAO,EACL,qBAAqB,EACnB,QAAQ;EACN,SAAS;EACT,OAAO;EACP,OAAO;CACT,EACF,EACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"index-types-BZqoAhWT.mjs","names":[],"sources":["../src/types/index-types.ts"],"sourcesContent":["import { defineIndexTypes } from '@prisma-next/sql-contract/index-types';\nimport { type } from 'arktype';\n\nexport const paradedbIndexTypes = defineIndexTypes().add('bm25', {\n options: type({\n '+': 'reject',\n key_field: 'string',\n }),\n});\n\nexport type IndexTypes = typeof paradedbIndexTypes.IndexTypes;\nexport type Bm25IndexOptions = IndexTypes['bm25']['options'];\n"],"mappings":";;;AAGA,MAAa,qBAAqB,kBAAkB,CAAC,IAAI,QAAQ,EAC/D,SAAS,KAAK;CACZ,KAAK;CACL,WAAW;CACZ,CAAC,EACH,CAAC"}
1
+ {"version":3,"file":"index-types-BZqoAhWT.mjs","names":[],"sources":["../src/types/index-types.ts"],"sourcesContent":["import { defineIndexTypes } from '@prisma-next/sql-contract/index-types';\nimport { type } from 'arktype';\n\nexport const paradedbIndexTypes = defineIndexTypes().add('bm25', {\n options: type({\n '+': 'reject',\n key_field: 'string',\n }),\n});\n\nexport type IndexTypes = typeof paradedbIndexTypes.IndexTypes;\nexport type Bm25IndexOptions = IndexTypes['bm25']['options'];\n"],"mappings":";;;AAGA,MAAa,qBAAqB,iBAAiB,EAAE,IAAI,QAAQ,EAC/D,SAAS,KAAK;CACZ,KAAK;CACL,WAAW;AACb,CAAC,EACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index-types.d.mts","names":[],"sources":["../src/types/index-types.ts"],"mappings":";;;cAGa,kBAAA,EAAkB,wCAAA,CAAA,gBAAA,CAAA,MAAA,iBAAA,MAAA;EAAA;;;;KAOnB,UAAA,UAAoB,kBAAA,CAAmB,UAAA;AAAA,KACvC,gBAAA,GAAmB,UAAA"}
1
+ {"version":3,"file":"index-types.d.mts","names":[],"sources":["../src/types/index-types.ts"],"mappings":";;;cAGa,kBAAA,EAAkB,wCAAA,CAAA,gBAAA,CAAA,MAAA,iBAAA,MAAA;EAAA;;;;KAOnB,UAAA,UAAoB,kBAAA,CAAmB,UAAU;AAAA,KACjD,gBAAA,GAAmB,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"operation-types-DXmTJ7jd.d.mts","names":[],"sources":["../src/core/proximity-chain.ts","../src/types/operation-types.ts"],"mappings":";;;;;KAUY,aAAA;AAAA,UAEK,sBAAA;EAAA,SACN,OAAA;AAAA;AAAA,UAGD,aAAA;EAAA,SACC,QAAA;EAAA,SACA,IAAA,EAAM,aAAA;EAAA,SACN,OAAA;AAAA;AAAA,cAIE,sBAAA,YACA,UAAA;EAAa,OAAA;EAAsB,QAAA;AAAA;EAAA,SAErC,UAAA;IAAA;;;mBAEQ,KAAA;EAAA,iBACA,KAAA;cAEL,KAAA,EAAO,aAAA,EAAe,KAAA,YAAgB,aAAA;EAKlD,MAAA,CACE,QAAA,UACA,IAAA,EAAM,aAAA,EACN,OAAA,GAAU,sBAAA,GACT,sBAAA;EAYH,QAAA,CAAA,GAAY,aAAA;AAAA;;;KChDT,cAAA,GAAiB,MAAA;EAAA,SAA0B,KAAA;EAAA,SAAyB,MAAA;AAAA;AAAA,KAE7D,mBAAA,YAA+B,cAAA,IAAkB,sBAAA,CAC3D,EAAA;EAAA,SAEW,aAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,uBAAsC,EAAA,GAC5C,KAAA,EAAO,eAAA,uBAAsC,EAAA,MAC1C,UAAA;MAAa,OAAA;MAAsB,QAAA;IAAA;EAAA;EAAA,SAEjC,gBAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,uBAAsC,EAAA,GAC5C,KAAA,EAAO,eAAA,uBAAsC,EAAA,MAC1C,UAAA;MAAa,OAAA;MAAsB,QAA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IAAA,GACP,IAAA,EAAM,eAAA,uBAAsC,EAAA,GAC5C,KAAA,aACG,UAAA;MAAa,OAAA;MAAsB,QAAA;IAAA;EAAA;EAAA,SAEjC,YAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,uBAAsC,EAAA,GAC5C,IAAA,aACG,UAAA;MAAa,OAAA;MAAsB,QAAA;IAAA;EAAA;EAAA,SAEjC,iBAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GAAO,KAAA,EAAO,eAAA,uBAAsC,EAAA,MAAQ,sBAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"operation-types-DXmTJ7jd.d.mts","names":[],"sources":["../src/core/proximity-chain.ts","../src/types/operation-types.ts"],"mappings":";;;;;KAUY,aAAA;AAAA,UAEK,sBAAA;EAAA,SACN,OAAO;AAAA;AAAA,UAGR,aAAA;EAAA,SACC,QAAA;EAAA,SACA,IAAA,EAAM,aAAa;EAAA,SACnB,OAAA;AAAA;AAAA,cAIE,sBAAA,YACA,UAAA;EAAa,OAAA;EAAsB,QAAA;AAAA;EAAA,SAErC,UAAA;IAAA;;;mBAEQ,KAAA;EAAA,iBACA,KAAA;cAEL,KAAA,EAAO,aAAA,EAAe,KAAA,YAAgB,aAAA;EAKlD,MAAA,CACE,QAAA,UACA,IAAA,EAAM,aAAA,EACN,OAAA,GAAU,sBAAA,GACT,sBAAA;EAYH,QAAA,CAAA,GAAY,aAAA;AAAA;;;KChDT,cAAA,GAAiB,MAAM;EAAA,SAAoB,KAAA;EAAA,SAAyB,MAAA;AAAA;AAAA,KAE7D,mBAAA,YAA+B,cAAA,IAAkB,sBAAA,CAC3D,EAAA;EAAA,SAEW,aAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,uBAAsC,EAAA,GAC5C,KAAA,EAAO,eAA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AA;EAAA;EAAA,SAEjC,aAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,uBAAsC,EAAA,GAC5C,MAAA,aACG,UAAA;MAAa,OAAA;MAAsB,QAAA;IAAA;EAAA;EAAA,SAEjC,aAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,uBAAsC,EAAA,GAC5C,KAAA,aACG,UAAA;MAAa,OAAA;MAAsB,QAAA;IAAA;EAAA;EAAA,SAEjC,YAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,uBAAsC,EAAA,GAC5C,IAAA,aACG,UAAA;MAAa,OAAA;MAAsB,QAAA;IAAA;EAAA;EAAA,SAEjC,iBAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GAAO,KAAA,EAAO,eAAA,uBAAsC,EAAA,MAAQ,sBAAA;EAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.mts","names":[],"sources":["../src/exports/runtime.ts"],"mappings":";;;cAGM,yBAAA,EAA2B,6BAAA"}
1
+ {"version":3,"file":"runtime.d.mts","names":[],"sources":["../src/exports/runtime.ts"],"mappings":";;;cAGM,yBAAA,EAA2B,6BAA6B"}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.mjs","names":[],"sources":["../src/exports/runtime.ts"],"sourcesContent":["import type { SqlRuntimeExtensionDescriptor } from '@prisma-next/sql-runtime';\nimport { paradedbPackMeta, paradedbQueryOperations } from '../core/descriptor-meta';\n\nconst paradedbRuntimeDescriptor: SqlRuntimeExtensionDescriptor<'postgres'> = {\n kind: 'extension' as const,\n id: paradedbPackMeta.id,\n version: paradedbPackMeta.version,\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n codecs: () => [],\n queryOperations: () => paradedbQueryOperations(),\n create() {\n return {\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n };\n },\n};\n\nexport default paradedbRuntimeDescriptor;\n"],"mappings":";;AAGA,MAAM,4BAAuE;CAC3E,MAAM;CACN,IAAI,iBAAiB;CACrB,SAAS,iBAAiB;CAC1B,UAAU;CACV,UAAU;CACV,cAAc,EAAE;CAChB,uBAAuB,yBAAyB;CAChD,SAAS;EACP,OAAO;GACL,UAAU;GACV,UAAU;GACX;;CAEJ"}
1
+ {"version":3,"file":"runtime.mjs","names":[],"sources":["../src/exports/runtime.ts"],"sourcesContent":["import type { SqlRuntimeExtensionDescriptor } from '@prisma-next/sql-runtime';\nimport { paradedbPackMeta, paradedbQueryOperations } from '../core/descriptor-meta';\n\nconst paradedbRuntimeDescriptor: SqlRuntimeExtensionDescriptor<'postgres'> = {\n kind: 'extension' as const,\n id: paradedbPackMeta.id,\n version: paradedbPackMeta.version,\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n codecs: () => [],\n queryOperations: () => paradedbQueryOperations(),\n create() {\n return {\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n };\n },\n};\n\nexport default paradedbRuntimeDescriptor;\n"],"mappings":";;AAGA,MAAM,4BAAuE;CAC3E,MAAM;CACN,IAAI,iBAAiB;CACrB,SAAS,iBAAiB;CAC1B,UAAU;CACV,UAAU;CACV,cAAc,CAAC;CACf,uBAAuB,wBAAwB;CAC/C,SAAS;EACP,OAAO;GACL,UAAU;GACV,UAAU;EACZ;CACF;AACF"}
package/package.json CHANGED
@@ -1,34 +1,42 @@
1
1
  {
2
2
  "name": "@prisma-next/extension-paradedb",
3
- "version": "0.11.0-dev.9",
3
+ "version": "0.12.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "dependencies": {
8
- "@prisma-next/contract": "0.11.0-dev.9",
9
- "@prisma-next/contract-authoring": "0.11.0-dev.9",
10
- "@prisma-next/family-sql": "0.11.0-dev.9",
11
- "@prisma-next/framework-components": "0.11.0-dev.9",
12
- "@prisma-next/migration-tools": "0.11.0-dev.9",
13
- "@prisma-next/sql-contract": "0.11.0-dev.9",
14
- "@prisma-next/sql-operations": "0.11.0-dev.9",
15
- "@prisma-next/sql-relational-core": "0.11.0-dev.9",
16
- "@prisma-next/sql-runtime": "0.11.0-dev.9",
8
+ "@prisma-next/contract": "0.12.0",
9
+ "@prisma-next/contract-authoring": "0.12.0",
10
+ "@prisma-next/family-sql": "0.12.0",
11
+ "@prisma-next/framework-components": "0.12.0",
12
+ "@prisma-next/migration-tools": "0.12.0",
13
+ "@prisma-next/sql-contract": "0.12.0",
14
+ "@prisma-next/sql-operations": "0.12.0",
15
+ "@prisma-next/sql-relational-core": "0.12.0",
16
+ "@prisma-next/sql-runtime": "0.12.0",
17
17
  "arktype": "^2.2.0"
18
18
  },
19
19
  "devDependencies": {
20
- "@prisma-next/adapter-postgres": "0.11.0-dev.9",
21
- "@prisma-next/cli": "0.11.0-dev.9",
22
- "@prisma-next/operations": "0.11.0-dev.9",
23
- "@prisma-next/sql-contract-ts": "0.11.0-dev.9",
24
- "@prisma-next/target-postgres": "0.11.0-dev.9",
25
- "@prisma-next/test-utils": "0.11.0-dev.9",
26
- "@prisma-next/tsconfig": "0.11.0-dev.9",
27
- "@prisma-next/tsdown": "0.11.0-dev.9",
20
+ "@prisma-next/adapter-postgres": "0.12.0",
21
+ "@prisma-next/cli": "0.12.0",
22
+ "@prisma-next/operations": "0.12.0",
23
+ "@prisma-next/sql-contract-ts": "0.12.0",
24
+ "@prisma-next/target-postgres": "0.12.0",
25
+ "@prisma-next/test-utils": "0.12.0",
26
+ "@prisma-next/tsconfig": "0.12.0",
27
+ "@prisma-next/tsdown": "0.12.0",
28
28
  "tsdown": "0.22.0",
29
29
  "typescript": "5.9.3",
30
30
  "vitest": "4.1.6"
31
31
  },
32
+ "peerDependencies": {
33
+ "typescript": ">=5.9"
34
+ },
35
+ "peerDependenciesMeta": {
36
+ "typescript": {
37
+ "optional": true
38
+ }
39
+ },
32
40
  "files": [
33
41
  "dist",
34
42
  "src"
@@ -41,6 +49,9 @@
41
49
  "./runtime": "./dist/runtime.mjs",
42
50
  "./package.json": "./package.json"
43
51
  },
52
+ "engines": {
53
+ "node": ">=24"
54
+ },
44
55
  "repository": {
45
56
  "type": "git",
46
57
  "url": "https://github.com/prisma/prisma-next.git",
package/src/contract.d.ts CHANGED
@@ -1,19 +1,21 @@
1
1
  // ⚠️ GENERATED FILE - DO NOT EDIT
2
2
  // This file is automatically generated by 'prisma-next contract emit'.
3
3
  // To regenerate, run: prisma-next contract emit
4
- import type { CodecTypes as PgTypes } from '@prisma-next/target-postgres/codec-types';
5
- import type { JsonValue } from '@prisma-next/target-postgres/codec-types';
6
- import type { Char } from '@prisma-next/target-postgres/codec-types';
7
- import type { Varchar } from '@prisma-next/target-postgres/codec-types';
8
- import type { Numeric } from '@prisma-next/target-postgres/codec-types';
9
- import type { Bit } from '@prisma-next/target-postgres/codec-types';
10
- import type { VarBit } from '@prisma-next/target-postgres/codec-types';
11
- import type { Timestamp } from '@prisma-next/target-postgres/codec-types';
12
- import type { Timestamptz } from '@prisma-next/target-postgres/codec-types';
13
- import type { Time } from '@prisma-next/target-postgres/codec-types';
14
- import type { Timetz } from '@prisma-next/target-postgres/codec-types';
15
- import type { Interval } from '@prisma-next/target-postgres/codec-types';
16
4
  import type { QueryOperationTypes as PgAdapterQueryOps } from '@prisma-next/adapter-postgres/operation-types';
5
+ import type {
6
+ Bit,
7
+ Char,
8
+ CodecTypes as PgTypes,
9
+ Interval,
10
+ JsonValue,
11
+ Numeric,
12
+ Time,
13
+ Timestamp,
14
+ Timestamptz,
15
+ Timetz,
16
+ VarBit,
17
+ Varchar,
18
+ } from '@prisma-next/target-postgres/codec-types';
17
19
 
18
20
  import type {
19
21
  ContractWithTypeMaps,
@@ -21,16 +23,18 @@ import type {
21
23
  } from '@prisma-next/sql-contract/types';
22
24
  import type {
23
25
  Contract as ContractType,
26
+ ContractModelsMap,
24
27
  ExecutionHashBase,
28
+ NamespaceId,
25
29
  ProfileHashBase,
26
30
  StorageHashBase,
27
31
  } from '@prisma-next/contract/types';
28
32
 
29
33
  export type StorageHash =
30
- StorageHashBase<'sha256:59877923532fc526703f572f1d54bdd6050502ef30ede3333ee1393ea93b9716'>;
34
+ StorageHashBase<'sha256:5dde71f8985299c9eb464edb00d06e2bdef0501bd30b072a614afb48ed4dc21b'>;
31
35
  export type ExecutionHash = ExecutionHashBase<string>;
32
36
  export type ProfileHash =
33
- ProfileHashBase<'sha256:1a8dbe044289f30a1de958fe800cc5a8378b285d2e126a8c44b58864bac2c18e'>;
37
+ ProfileHashBase<'sha256:9c8aa3114e84ed3b7ea2bd57526d9c2e1bf7c5292be694e9d3801f566fda7ccb'>;
34
38
 
35
39
  export type CodecTypes = PgTypes;
36
40
  export type LaneCodecTypes = CodecTypes;
@@ -48,24 +52,35 @@ export type TypeMaps = TypeMapsType<
48
52
  FieldInputTypes
49
53
  >;
50
54
 
51
- type ContractBase = ContractType<
52
- {
53
- readonly namespaces: {
54
- readonly __unbound__: {
55
- readonly id: '__unbound__';
56
- readonly kind: 'sql-namespace';
57
- readonly tables: {};
55
+ type ContractBase = Omit<
56
+ ContractType<
57
+ {
58
+ readonly namespaces: {
59
+ readonly public: {
60
+ readonly id: 'public';
61
+ readonly kind: 'sql-namespace';
62
+ readonly tables: {};
63
+ };
58
64
  };
59
- };
60
- readonly storageHash: StorageHash;
61
- },
62
- Record<string, never>
65
+ readonly storageHash: StorageHash;
66
+ },
67
+ Record<string, never>
68
+ >,
69
+ 'roots' | 'domain'
63
70
  > & {
64
71
  readonly target: 'postgres';
65
72
  readonly targetFamily: 'sql';
66
- readonly roots: Record<string, string>;
73
+ readonly roots: Record<string, never>;
74
+ readonly domain: {
75
+ readonly namespaces: {
76
+ readonly public: {
77
+ readonly models: Record<string, never>;
78
+ };
79
+ };
80
+ };
67
81
  readonly capabilities: {
68
82
  readonly postgres: {
83
+ readonly distinctOn: true;
69
84
  readonly jsonAgg: true;
70
85
  readonly lateral: true;
71
86
  readonly limit: true;
@@ -75,6 +90,7 @@ type ContractBase = ContractType<
75
90
  readonly sql: {
76
91
  readonly defaultInInsert: true;
77
92
  readonly enums: true;
93
+ readonly lateral: true;
78
94
  readonly returning: true;
79
95
  };
80
96
  };
@@ -87,4 +103,4 @@ type ContractBase = ContractType<
87
103
  export type Contract = ContractWithTypeMaps<ContractBase, TypeMaps>;
88
104
 
89
105
  export type Namespaces = Contract['storage']['namespaces'];
90
- export type Models = Contract['models'];
106
+ export type Models = ContractModelsMap<Contract>;
package/src/contract.json CHANGED
@@ -2,21 +2,28 @@
2
2
  "schemaVersion": "1",
3
3
  "targetFamily": "sql",
4
4
  "target": "postgres",
5
- "profileHash": "sha256:1a8dbe044289f30a1de958fe800cc5a8378b285d2e126a8c44b58864bac2c18e",
5
+ "profileHash": "sha256:9c8aa3114e84ed3b7ea2bd57526d9c2e1bf7c5292be694e9d3801f566fda7ccb",
6
6
  "roots": {},
7
- "models": {},
7
+ "domain": {
8
+ "namespaces": {
9
+ "public": {
10
+ "models": {}
11
+ }
12
+ }
13
+ },
8
14
  "storage": {
9
15
  "namespaces": {
10
- "__unbound__": {
11
- "id": "__unbound__",
12
- "kind": "postgres-unbound-schema",
16
+ "public": {
17
+ "id": "public",
18
+ "kind": "postgres-schema",
13
19
  "tables": {}
14
20
  }
15
21
  },
16
- "storageHash": "sha256:59877923532fc526703f572f1d54bdd6050502ef30ede3333ee1393ea93b9716"
22
+ "storageHash": "sha256:5dde71f8985299c9eb464edb00d06e2bdef0501bd30b072a614afb48ed4dc21b"
17
23
  },
18
24
  "capabilities": {
19
25
  "postgres": {
26
+ "distinctOn": true,
20
27
  "jsonAgg": true,
21
28
  "lateral": true,
22
29
  "limit": true,
@@ -26,6 +33,7 @@
26
33
  "sql": {
27
34
  "defaultInInsert": true,
28
35
  "enums": true,
36
+ "lateral": true,
29
37
  "returning": true
30
38
  }
31
39
  },
@@ -1,22 +0,0 @@
1
- // PSL contract source for the `extension-paradedb` package.
2
- //
3
- // Authored against the contract-space package layout convention. The same
4
- // emit pipeline application authors use is applied here:
5
- //
6
- // `prisma-next contract emit` → `<package>/src/contract.{json,d.ts}`
7
- // `prisma-next migration plan` → `<package>/migrations/<dirName>/`
8
- //
9
- // The descriptor at `src/exports/control.ts` then wires the emitted JSON
10
- // artefacts via JSON-import declarations.
11
- //
12
- // ## IR coverage
13
- //
14
- // paradedb ships **no tables** and **no native types** of its own. Its
15
- // baseline migration installs the `pg_search` Postgres extension; all
16
- // BM25 index configuration is carried by the user contract's own models
17
- // (via the `'bm25'` index-type entry registered in `src/types/index-types.ts`).
18
- // The contract IR is therefore intentionally empty — the space is still
19
- // required so the migration runner can track the `pg_search` installation
20
- // invariant independently of any user models.
21
- //
22
- // @see docs/architecture docs/adrs/ADR 212 - Contract spaces.md