@prisma/orm-extension-pgvector 8.0.0-rc.24-dev.28 → 8.0.0-rc.24-dev.30

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
@@ -11,11 +11,11 @@ pnpm add @prisma/orm-extension-pgvector
11
11
  | Namespace | Surface |
12
12
  | --- | --- |
13
13
  | `/pack` | the extension pack an application composes into `extensions: [...]` — pure, no runtime imports |
14
- | `/column-types` | the `Vector(n)` column author |
14
+ | `/column-types` | the `vector()` or `vector(n)` column author |
15
15
  | `/codec-types`, `/operation-types` | types emitted contracts reference |
16
16
  | `/runtime` | the runtime extension that registers the codec and operations |
17
17
  | `/control` | the control descriptor and baseline migration that install the server extension |
18
18
 
19
19
  ## Responsibilities
20
20
 
21
- Dimensioned vector storage and search: the `pg/vector@1` codec (`number[]` at runtime, `Vector<N>` in `contract.d.ts`), similarity operations such as `cosineDistance`, and a baseline migration that runs `CREATE EXTENSION IF NOT EXISTS vector` when the pack is composed into an application.
21
+ Variable or fixed-dimension vector storage and search: the `pg/vector@1` codec (`number[]` at runtime; in `contract.d.ts`, `Vector<N>` for `vector(n)` and `number[]` for `vector()`), similarity operations such as `cosineDistance`, and a baseline migration that runs `CREATE EXTENSION IF NOT EXISTS vector` when the pack is composed into an application.
@@ -4,15 +4,15 @@ import { ExtractCodecTypes, ProjectionExpr } from "@prisma/orm-family-sql/relati
4
4
  import { PostgresCodecDescriptor } from "@prisma/orm-target-postgres/target/codec-descriptor";
5
5
  import { ParameterizedOutputTypesFunction } from "@prisma/orm-framework/contract/types";
6
6
  import { StandardSchemaV1 } from "@standard-schema/spec";
7
- //#region ../../../3-extensions/pgvector/dist/codec-types-C4BGWf7E.d.mts
7
+ //#region ../../../3-extensions/pgvector/dist/codec-types-B-Xh6Cqq.d.mts
8
8
  //#region src/core/codecs.d.ts
9
9
  type VectorConversionCode = 'RUNTIME.ENCODE_FAILED' | 'RUNTIME.DECODE_FAILED';
10
10
  type VectorParams = {
11
- readonly length: number;
11
+ readonly length?: number;
12
12
  };
13
13
  declare class PgVectorCodec extends CodecImpl<typeof VECTOR_CODEC_ID, readonly ['equality'], string, number[]> {
14
- readonly length: number;
15
- constructor(descriptor: AnyCodecDescriptor, length: number);
14
+ readonly length: number | undefined;
15
+ constructor(descriptor: AnyCodecDescriptor, length: number | undefined);
16
16
  assertVector(value: unknown, code: VectorConversionCode): asserts value is number[];
17
17
  toWire(value: number[], _ctx: CodecCallContext): Promise<string>;
18
18
  fromWire(wire: string, _ctx: CodecCallContext): Promise<number[]>;
@@ -51,11 +51,11 @@ type OutputTypeMap<TypeParams> = {
51
51
  } ? Vector<N> : never;
52
52
  };
53
53
  /**
54
- * The output type of a `vector(N)` column, `Vector<N>`: the only declaration of it, which a contract written with `defineContract` and the `contract.d.ts` that `prisma contract emit` writes both apply.
54
+ * The output type of a `vector(N)` column, `Vector<N>`: the only declaration of it, which a contract written with `defineContract` and the `contract.d.ts` that `prisma contract emit` writes both apply. A `vector()` column has no type parameters and reads as the codec's plain `number[]`.
55
55
  */
56
56
  interface ParameterizedOutputTypesForTypeParams extends ParameterizedOutputTypesFunction {
57
57
  readonly outputTypes: OutputTypeMap<this['typeParams']>;
58
58
  }
59
59
  //#endregion
60
60
  export { ParameterizedOutputTypesForTypeParams as n, Vector as r, CodecTypes as t };
61
- //# sourceMappingURL=codec-types-C4BGWf7E-CXMQqk2H.d.mts.map
61
+ //# sourceMappingURL=codec-types-B-Xh6Cqq-fe04pIao.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codec-types-C4BGWf7E-CXMQqk2H.d.mts","names":[],"sources":["../../../../3-extensions/pgvector/dist/codec-types-C4BGWf7E.d.mts"],"mappings":";;;;;;;;KAOK;KACA;WACM;;cAEG,sBAAsB,iBAAiB;WAC1C;EACT,YAAY,YAAY,oBAAoB;EAC5C,aAAa,gBAAgB,MAAM,+BAA+B;EAClE,OAAO,iBAAiB,MAAM,mBAAmB;EACjD,SAAS,cAAc,MAAM,mBAAmB;EAChD,kBAAkB,OAAO;EACzB,gBAAgB,kBAAkB;;cAEtB,2BAA2B,wBAAwB;WACtD;YACC,eAAe,YAAY,iBAAiB;WAC7C,yDAAyD;WACzD;WACA;WACA;WACA,cAAc,iBAAiB;EACxC,QAAQ,QAAQ,gBAAgB,KAAK,yBAAyB;;cAElD;WACH,QAAQ;;KAEd,eAAe,yBAAyB;;;;;;;;;KASxC,OAAO;WACD,iBAAiB;;KAEvB,aAAa;KACb,cAAc;WACR,eAAe;aACb,cAAc;MACrB,OAAO;;;;;UAKH,8CAA8C;WAC7C,aAAa"}
1
+ {"version":3,"file":"codec-types-B-Xh6Cqq-fe04pIao.d.mts","names":[],"sources":["../../../../3-extensions/pgvector/dist/codec-types-B-Xh6Cqq.d.mts"],"mappings":";;;;;;;;KAOK;KACA;WACM;;cAEG,sBAAsB,iBAAiB;WAC1C;EACT,YAAY,YAAY,oBAAoB;EAC5C,aAAa,gBAAgB,MAAM,+BAA+B;EAClE,OAAO,iBAAiB,MAAM,mBAAmB;EACjD,SAAS,cAAc,MAAM,mBAAmB;EAChD,kBAAkB,OAAO;EACzB,gBAAgB,kBAAkB;;cAEtB,2BAA2B,wBAAwB;WACtD;YACC,eAAe,YAAY,iBAAiB;WAC7C,yDAAyD;WACzD;WACA;WACA;WACA,cAAc,iBAAiB;EACxC,QAAQ,QAAQ,gBAAgB,KAAK,yBAAyB;;cAElD;WACH,QAAQ;;KAEd,eAAe,yBAAyB;;;;;;;;;KASxC,OAAO;WACD,iBAAiB;;KAEvB,aAAa;KACb,cAAc;WACR,eAAe;aACb,cAAc;MACrB,OAAO;;;;;UAKH,8CAA8C;WAC7C,aAAa"}
@@ -1,2 +1,2 @@
1
- import { n as ParameterizedOutputTypesForTypeParams, r as Vector, t as CodecTypes } from "./codec-types-C4BGWf7E-CXMQqk2H.mjs";
1
+ import { n as ParameterizedOutputTypesForTypeParams, r as Vector, t as CodecTypes } from "./codec-types-B-Xh6Cqq-fe04pIao.mjs";
2
2
  export type { CodecTypes, ParameterizedOutputTypesForTypeParams, Vector };
@@ -2,6 +2,19 @@ import { t as VECTOR_CODEC_ID } from "./constants-BjLQgqqq-CMdE2ode.mjs";
2
2
  import { ColumnTypeDescriptor } from "@prisma/orm-framework/components/codec";
3
3
  //#region ../../../3-extensions/pgvector/dist/column-types.d.mts
4
4
  //#region src/exports/column-types.d.ts
5
+ /**
6
+ * Factory for creating non-dimensioned vector column descriptors.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * .column('embedding', { type: vector(), nullable: false })
11
+ * // Produces: typeParams: {}
12
+ * ```
13
+ * @returns A column type descriptor without `typeParams.length` set
14
+ */
15
+ declare function vector(): ColumnTypeDescriptor<typeof VECTOR_CODEC_ID> & {
16
+ readonly typeParams: Record<never, never>;
17
+ };
5
18
  /**
6
19
  * Factory for creating dimensioned vector column descriptors.
7
20
  *
@@ -18,6 +31,12 @@ declare function vector<N extends number>(length: N): ColumnTypeDescriptor<typeo
18
31
  readonly length: N;
19
32
  };
20
33
  };
34
+ /** Creates a vector descriptor whose dimension may be absent, leaving variable dimensions when it is. */
35
+ declare function vector(length?: number): ColumnTypeDescriptor<typeof VECTOR_CODEC_ID> & {
36
+ readonly typeParams: Record<never, never> | {
37
+ readonly length: number;
38
+ };
39
+ };
21
40
  //#endregion
22
41
  export { vector };
23
42
  //# sourceMappingURL=column-types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"column-types.d.mts","names":[],"sources":["../../../../3-extensions/pgvector/dist/column-types.d.mts"],"mappings":";;;;;;;;;;;;;;;iBAciB,OAAO,kBAAkB,QAAQ,IAAI,4BAA4B;WACvE;aACE,QAAQ"}
1
+ {"version":3,"file":"column-types.d.mts","names":[],"sources":["../../../../3-extensions/pgvector/dist/column-types.d.mts"],"mappings":";;;;;;;;;;;;;;iBAaiB,UAAU,4BAA4B;WAC5C,YAAY;;;;;;;;;;;;;iBAaN,OAAO,kBAAkB,QAAQ,IAAI,4BAA4B;WACvE;aACE,QAAQ;;;;iBAIJ,OAAO,kBAAkB,4BAA4B;WAC3D,YAAY;aACV"}
@@ -1,17 +1,10 @@
1
1
  import { t as VECTOR_CODEC_ID } from "./constants-D8Ccy-f4-BNIWMdMO.mjs";
2
2
  //#region ../../../3-extensions/pgvector/dist/column-types.mjs
3
- /**
4
- * Factory for creating dimensioned vector column descriptors.
5
- *
6
- * @example
7
- * ```typescript
8
- * .column('embedding', { type: vector(1536), nullable: false })
9
- * // Produces: codecId: 'pg/vector@1', typeParams: { length: 1536 }
10
- * ```
11
- * @param length - The dimension of the vector (e.g., 1536 for OpenAI embeddings)
12
- * @returns A column type descriptor with `typeParams.length` set
13
- */
14
3
  function vector(length) {
4
+ if (length === void 0) return {
5
+ codecId: VECTOR_CODEC_ID,
6
+ typeParams: {}
7
+ };
15
8
  return {
16
9
  codecId: VECTOR_CODEC_ID,
17
10
  typeParams: { length }
@@ -1 +1 @@
1
- {"version":3,"file":"column-types.mjs","names":[],"sources":["../../../../3-extensions/pgvector/dist/column-types.mjs"],"sourcesContent":["import { t as VECTOR_CODEC_ID } from \"./constants-D8Ccy-f4.mjs\";\n//#region src/exports/column-types.ts\n/**\n* Factory for creating dimensioned vector column descriptors.\n*\n* @example\n* ```typescript\n* .column('embedding', { type: vector(1536), nullable: false })\n* // Produces: codecId: 'pg/vector@1', typeParams: { length: 1536 }\n* ```\n* @param length - The dimension of the vector (e.g., 1536 for OpenAI embeddings)\n* @returns A column type descriptor with `typeParams.length` set\n*/\nfunction vector(length) {\n\treturn {\n\t\tcodecId: VECTOR_CODEC_ID,\n\t\ttypeParams: { length }\n\t};\n}\n//#endregion\nexport { vector };\n\n//# sourceMappingURL=column-types.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,SAAS,OAAO,QAAQ;CACvB,OAAO;EACN,SAAS;EACT,YAAY,EAAE,OAAO;CACtB;AACD"}
1
+ {"version":3,"file":"column-types.mjs","names":[],"sources":["../../../../3-extensions/pgvector/dist/column-types.mjs"],"sourcesContent":["import { t as VECTOR_CODEC_ID } from \"./constants-D8Ccy-f4.mjs\";\n//#region src/exports/column-types.ts\nfunction vector(length) {\n\tif (length === void 0) return {\n\t\tcodecId: VECTOR_CODEC_ID,\n\t\ttypeParams: {}\n\t};\n\treturn {\n\t\tcodecId: VECTOR_CODEC_ID,\n\t\ttypeParams: { length }\n\t};\n}\n//#endregion\nexport { vector };\n\n//# sourceMappingURL=column-types.mjs.map"],"mappings":";;AAEA,SAAS,OAAO,QAAQ;CACvB,IAAI,WAAW,KAAK,GAAG,OAAO;EAC7B,SAAS;EACT,YAAY,CAAC;CACd;CACA,OAAO;EACN,SAAS;EACT,YAAY,EAAE,OAAO;CACtB;AACD"}
package/dist/control.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as pgvectorPackMeta, r as pgvectorQueryOperations } from "./descriptor-meta-CVuMPD3K-BuJ5TQ9Y.mjs";
1
+ import { n as pgvectorPackMeta, r as pgvectorQueryOperations } from "./descriptor-meta-BjWk6vBJ-BLEfroRD.mjs";
2
2
  import { contractSpaceFromJson } from "@prisma/orm-toolchain/migration-tools/spaces";
3
3
  //#region ../../../3-extensions/pgvector/dist/control.mjs
4
4
  var migration_default$4 = {
@@ -1 +1 @@
1
- {"version":3,"file":"control.mjs","names":[],"sources":["../../../../3-extensions/pgvector/dist/control.mjs"],"sourcesContent":["import { n as pgvectorQueryOperations, t as pgvectorPackMeta } from \"./descriptor-meta-CVuMPD3K.mjs\";\nimport { contractSpaceFromJson } from \"@internal/migration-tools/spaces\";\n//#region migrations/20260601T0000_install_vector_extension/migration.json\nvar migration_default$4 = {\n\tfrom: null,\n\tto: \"4a96b488a4ce92b434e5f7d6607b6435c0955f0d36b0018077045787764240e6\",\n\tprovidedInvariants: [\"pgvector:install-vector-v1\"],\n\tcreatedAt: \"2026-06-01T00:00:00.000Z\",\n\tmigrationHash: \"ae458aa8c484439df5d79fdfbbe907a3ab7e53b25c79259a95909ab3c61d9a66\"\n};\n//#endregion\n//#region migrations/20260601T0000_install_vector_extension/ops.json\nvar ops_default$4 = [{\n\t\"id\": \"pgvector.install-vector-extension\",\n\t\"label\": \"Enable extension \\\"vector\\\"\",\n\t\"operationClass\": \"additive\",\n\t\"invariantId\": \"pgvector:install-vector-v1\",\n\t\"target\": {\n\t\t\"id\": \"postgres\",\n\t\t\"details\": {\n\t\t\t\"schema\": \"public\",\n\t\t\t\"objectType\": \"dependency\",\n\t\t\t\"name\": \"vector\"\n\t\t}\n\t},\n\t\"precheck\": [{\n\t\t\"description\": \"verify extension \\\"vector\\\" is not already enabled\",\n\t\t\"sql\": \"SELECT NOT EXISTS (SELECT 1 AS \\\"one\\\" FROM \\\"pg_extension\\\" WHERE \\\"extname\\\" = $1) AS \\\"result\\\"\",\n\t\t\"params\": [\"vector\"]\n\t}],\n\t\"execute\": [{\n\t\t\"description\": \"create extension \\\"vector\\\"\",\n\t\t\"sql\": \"CREATE EXTENSION IF NOT EXISTS vector\"\n\t}],\n\t\"postcheck\": [{\n\t\t\"description\": \"confirm extension \\\"vector\\\" is enabled\",\n\t\t\"sql\": \"SELECT EXISTS (SELECT 1 AS \\\"one\\\" FROM \\\"pg_extension\\\" WHERE \\\"extname\\\" = $1) AS \\\"result\\\"\",\n\t\t\"params\": [\"vector\"]\n\t}]\n}];\n//#endregion\n//#region migrations/20261029T1342_create_vector_extension/migration.json\nvar migration_default$3 = {\n\tfrom: null,\n\tto: \"698fc52f21eb891517203ef4b229823d17c49c3f802e2374be292a9b6a560c97\",\n\tprovidedInvariants: [],\n\tcreatedAt: \"2026-10-29T13:42:01.752Z\",\n\tmigrationHash: \"4883503fb5a53751035e28ec8b69e1faf5db5f26bce66ec42ff82be6f9579c77\"\n};\n//#endregion\n//#region migrations/20261029T1342_create_vector_extension/ops.json\nvar ops_default$3 = [{\n\t\"id\": \"schema.public\",\n\t\"label\": \"Create schema \\\"public\\\"\",\n\t\"operationClass\": \"additive\",\n\t\"target\": { \"id\": \"postgres\" },\n\t\"precheck\": [],\n\t\"execute\": [{\n\t\t\"description\": \"Create schema \\\"public\\\"\",\n\t\t\"sql\": \"CREATE SCHEMA IF NOT EXISTS \\\"public\\\"\",\n\t\t\"params\": []\n\t}],\n\t\"postcheck\": []\n}, {\n\t\"id\": \"extension.vector\",\n\t\"label\": \"Create extension \\\"vector\\\"\",\n\t\"operationClass\": \"additive\",\n\t\"target\": {\n\t\t\"id\": \"postgres\",\n\t\t\"details\": {\n\t\t\t\"schema\": \"public\",\n\t\t\t\"objectType\": \"dependency\",\n\t\t\t\"name\": \"vector\"\n\t\t}\n\t},\n\t\"precheck\": [{\n\t\t\"description\": \"verify extension \\\"vector\\\" is not installed\",\n\t\t\"sql\": \"SELECT NOT EXISTS (SELECT 1 AS \\\"one\\\" FROM \\\"pg_extension\\\" WHERE \\\"extname\\\" = $1) AS \\\"result\\\"\",\n\t\t\"params\": [\"vector\"],\n\t\t\"expectation\": {\n\t\t\t\"expects\": \"absent\",\n\t\t\t\"object\": \"extension \\\"vector\\\"\"\n\t\t}\n\t}],\n\t\"execute\": [{\n\t\t\"description\": \"create extension \\\"vector\\\"\",\n\t\t\"sql\": \"CREATE EXTENSION IF NOT EXISTS \\\"vector\\\" WITH SCHEMA \\\"public\\\"\"\n\t}],\n\t\"postcheck\": [{\n\t\t\"description\": \"confirm extension \\\"vector\\\" is installed\",\n\t\t\"sql\": \"SELECT EXISTS (SELECT 1 AS \\\"one\\\" FROM \\\"pg_extension\\\" WHERE \\\"extname\\\" = $1) AS \\\"result\\\"\",\n\t\t\"params\": [\"vector\"],\n\t\t\"expectation\": {\n\t\t\t\"expects\": \"present\",\n\t\t\t\"object\": \"extension \\\"vector\\\"\"\n\t\t}\n\t}]\n}];\n//#endregion\n//#region migrations/20261029T1342_declare_vector_extension/migration.json\nvar migration_default$2 = {\n\tfrom: \"4a96b488a4ce92b434e5f7d6607b6435c0955f0d36b0018077045787764240e6\",\n\tto: \"698fc52f21eb891517203ef4b229823d17c49c3f802e2374be292a9b6a560c97\",\n\tprovidedInvariants: [],\n\tcreatedAt: \"2026-10-29T13:42:09.120Z\",\n\tmigrationHash: \"e14f083b18d4ddd557fa9277f2a4b7d4bdea92d697661dbf10980bcfb57da936\"\n};\n//#endregion\n//#region migrations/20261029T1342_declare_vector_extension/ops.json\nvar ops_default$2 = [{\n\t\"id\": \"extension.vector\",\n\t\"label\": \"Create extension \\\"vector\\\"\",\n\t\"operationClass\": \"additive\",\n\t\"target\": {\n\t\t\"id\": \"postgres\",\n\t\t\"details\": {\n\t\t\t\"schema\": \"public\",\n\t\t\t\"objectType\": \"dependency\",\n\t\t\t\"name\": \"vector\"\n\t\t}\n\t},\n\t\"precheck\": [{\n\t\t\"description\": \"verify extension \\\"vector\\\" is not installed\",\n\t\t\"sql\": \"SELECT NOT EXISTS (SELECT 1 AS \\\"one\\\" FROM \\\"pg_extension\\\" WHERE \\\"extname\\\" = $1) AS \\\"result\\\"\",\n\t\t\"params\": [\"vector\"],\n\t\t\"expectation\": {\n\t\t\t\"expects\": \"absent\",\n\t\t\t\"object\": \"extension \\\"vector\\\"\"\n\t\t}\n\t}],\n\t\"execute\": [{\n\t\t\"description\": \"create extension \\\"vector\\\"\",\n\t\t\"sql\": \"CREATE EXTENSION IF NOT EXISTS \\\"vector\\\" WITH SCHEMA \\\"public\\\"\"\n\t}],\n\t\"postcheck\": [{\n\t\t\"description\": \"confirm extension \\\"vector\\\" is installed\",\n\t\t\"sql\": \"SELECT EXISTS (SELECT 1 AS \\\"one\\\" FROM \\\"pg_extension\\\" WHERE \\\"extname\\\" = $1) AS \\\"result\\\"\",\n\t\t\"params\": [\"vector\"],\n\t\t\"expectation\": {\n\t\t\t\"expects\": \"present\",\n\t\t\t\"object\": \"extension \\\"vector\\\"\"\n\t\t}\n\t}]\n}];\n//#endregion\n//#region migrations/20261106T1035_find_vector_on_search_path/migration.json\nvar migration_default$1 = {\n\tfrom: \"698fc52f21eb891517203ef4b229823d17c49c3f802e2374be292a9b6a560c97\",\n\tto: \"e4ab7d4329212a72d8e440fd7bf95a03e5c861e1d304dce1025b0fcaa1910d15\",\n\tprovidedInvariants: [],\n\tcreatedAt: \"2026-11-06T10:35:49.970Z\",\n\tmigrationHash: \"85a391e645fdad33d0fafd42421a347bb23e54af12485064488f65035f4a7dd3\"\n};\n//#endregion\n//#region migrations/20261106T1035_find_vector_on_search_path/ops.json\nvar ops_default$1 = [];\n//#endregion\n//#region migrations/20261106T1401_install_vector_on_search_path/migration.json\nvar migration_default = {\n\tfrom: null,\n\tto: \"e4ab7d4329212a72d8e440fd7bf95a03e5c861e1d304dce1025b0fcaa1910d15\",\n\tprovidedInvariants: [],\n\tcreatedAt: \"2026-11-06T14:01:36.994Z\",\n\tmigrationHash: \"278158a2ddecc5bca462d53237ab92d6f91febc2d9a249240353f1ed97f452b2\"\n};\n//#endregion\n//#region migrations/20261106T1401_install_vector_on_search_path/ops.json\nvar ops_default = [{\n\t\"id\": \"schema.public\",\n\t\"label\": \"Create schema \\\"public\\\"\",\n\t\"operationClass\": \"additive\",\n\t\"target\": { \"id\": \"postgres\" },\n\t\"precheck\": [],\n\t\"execute\": [{\n\t\t\"description\": \"Create schema \\\"public\\\"\",\n\t\t\"sql\": \"CREATE SCHEMA IF NOT EXISTS \\\"public\\\"\",\n\t\t\"params\": []\n\t}],\n\t\"postcheck\": []\n}, {\n\t\"id\": \"extension.vector\",\n\t\"label\": \"Create extension \\\"vector\\\"\",\n\t\"operationClass\": \"additive\",\n\t\"target\": {\n\t\t\"id\": \"postgres\",\n\t\t\"details\": {\n\t\t\t\"objectType\": \"dependency\",\n\t\t\t\"name\": \"vector\"\n\t\t}\n\t},\n\t\"precheck\": [{\n\t\t\"description\": \"verify extension \\\"vector\\\" is not installed\",\n\t\t\"sql\": \"SELECT NOT EXISTS (SELECT 1 AS \\\"one\\\" FROM \\\"pg_extension\\\" WHERE \\\"extname\\\" = $1) AS \\\"result\\\"\",\n\t\t\"params\": [\"vector\"],\n\t\t\"expectation\": {\n\t\t\t\"expects\": \"absent\",\n\t\t\t\"object\": \"extension \\\"vector\\\"\"\n\t\t}\n\t}],\n\t\"execute\": [{\n\t\t\"description\": \"create extension \\\"vector\\\"\",\n\t\t\"sql\": \"CREATE EXTENSION IF NOT EXISTS \\\"vector\\\"\"\n\t}],\n\t\"postcheck\": [{\n\t\t\"description\": \"confirm extension \\\"vector\\\" is installed\",\n\t\t\"sql\": \"SELECT EXISTS (SELECT 1 AS \\\"one\\\" FROM \\\"pg_extension\\\" WHERE \\\"extname\\\" = $1) AS \\\"result\\\"\",\n\t\t\"params\": [\"vector\"],\n\t\t\"expectation\": {\n\t\t\t\"expects\": \"present\",\n\t\t\t\"object\": \"extension \\\"vector\\\"\"\n\t\t}\n\t}]\n}];\n//#endregion\n//#region migrations/refs/head.json\nvar head_default = {\n\thash: \"e4ab7d4329212a72d8e440fd7bf95a03e5c861e1d304dce1025b0fcaa1910d15\",\n\tinvariants: []\n};\n//#endregion\n//#region src/contract.json\nvar contract_default = {\n\tschemaVersion: \"1\",\n\ttargetFamily: \"sql\",\n\ttarget: \"postgres\",\n\tprofileHash: \"3916f444a8a17ad749191acf9e08dad97d1a327b88c2f1d45d12f240296aa8b2\",\n\troots: {},\n\tdomain: { \"namespaces\": { \"public\": { \"models\": {} } } },\n\tstorage: {\n\t\t\"namespaces\": {\n\t\t\t\"__unbound__\": {\n\t\t\t\t\"entries\": {\n\t\t\t\t\t\"extension\": { \"vector\": {\n\t\t\t\t\t\t\"kind\": \"extension\",\n\t\t\t\t\t\t\"name\": \"vector\"\n\t\t\t\t\t} },\n\t\t\t\t\t\"table\": {}\n\t\t\t\t},\n\t\t\t\t\"id\": \"__unbound__\",\n\t\t\t\t\"kind\": \"postgres-unbound-schema\"\n\t\t\t},\n\t\t\t\"public\": {\n\t\t\t\t\"entries\": { \"table\": {} },\n\t\t\t\t\"id\": \"public\",\n\t\t\t\t\"kind\": \"postgres-schema\"\n\t\t\t}\n\t\t},\n\t\t\"storageHash\": \"e4ab7d4329212a72d8e440fd7bf95a03e5c861e1d304dce1025b0fcaa1910d15\",\n\t\t\"types\": { \"vector\": {\n\t\t\t\"codecId\": \"pg/vector@1\",\n\t\t\t\"dataType\": \"pgvector/vector\",\n\t\t\t\"kind\": \"codec-instance\"\n\t\t} }\n\t},\n\tcapabilities: {\n\t\t\"postgres\": {\n\t\t\t\"distinctOn\": true,\n\t\t\t\"forKeyShare\": true,\n\t\t\t\"forNoKeyUpdate\": true,\n\t\t\t\"jsonAgg\": true,\n\t\t\t\"lateral\": true,\n\t\t\t\"limit\": true,\n\t\t\t\"orderBy\": true,\n\t\t\t\"returning\": true\n\t\t},\n\t\t\"sql\": {\n\t\t\t\"checkConstraint\": true,\n\t\t\t\"defaultInInsert\": true,\n\t\t\t\"enums\": true,\n\t\t\t\"forShare\": true,\n\t\t\t\"forUpdate\": true,\n\t\t\t\"insertOnConflictSkip\": true,\n\t\t\t\"insertOnConflictTarget\": true,\n\t\t\t\"insertOnConflictWithoutTarget\": true,\n\t\t\t\"jsonAgg\": true,\n\t\t\t\"jsonAggWithoutTruncation\": true,\n\t\t\t\"lateral\": true,\n\t\t\t\"lockNowait\": true,\n\t\t\t\"lockOf\": true,\n\t\t\t\"lockSkipLocked\": true,\n\t\t\t\"outerReferencesInDerivedTables\": true,\n\t\t\t\"returning\": true,\n\t\t\t\"scalarList\": true\n\t\t}\n\t},\n\textensions: {},\n\tmeta: {},\n\t_generated: {\n\t\t\"warning\": \"⚠️ GENERATED FILE - DO NOT EDIT\",\n\t\t\"message\": \"This file is automatically generated by \\\"prisma contract emit\\\".\",\n\t\t\"regenerate\": \"To regenerate, run: prisma contract emit\"\n\t}\n};\n//#endregion\n//#region src/core/contract-space-constants.ts\n/**\n* Static names and identifiers used across pgvector'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 `'pgvector'` is what the framework writes to\n* `migrations/` in the user's repo and what the marker table's\n* `space` column carries for pgvector-owned rows.\n*\n* The `pgvector:*` invariantId namespace is locked here — once\n* published, an invariantId is immutable so downstream consumers can\n* reference it by literal string match.\n*/\nconst PGVECTOR_SPACE_ID = \"pgvector\";\nconst PGVECTOR_BASELINE_MIGRATION_NAME = \"20260601T0000_install_vector_extension\";\nconst PGVECTOR_UPGRADE_MIGRATION_NAME = \"20261029T1342_declare_vector_extension\";\nconst PGVECTOR_INSTALL_MIGRATION_NAME = \"20261029T1342_create_vector_extension\";\nconst PGVECTOR_SEARCH_PATH_MIGRATION_NAME = \"20261106T1035_find_vector_on_search_path\";\nconst PGVECTOR_SEARCH_PATH_INSTALL_MIGRATION_NAME = \"20261106T1401_install_vector_on_search_path\";\n//#endregion\n//#region src/exports/control.ts\nconst PGVECTOR_CODEC_ID = \"pg/vector@1\";\nfunction buildVectorIdentityValue(typeParams) {\n\tconst length = typeParams?.[\"length\"];\n\tif (typeof length !== \"number\" || !Number.isInteger(length) || length <= 0) return null;\n\treturn `'${`[${new Array(length).fill(\"0\").join(\",\")}]`}'::vector`;\n}\nconst vectorControlPlaneHooks = { resolveIdentityValue: ({ typeParams }) => buildVectorIdentityValue(typeParams) };\nconst pgvectorContractSpace = contractSpaceFromJson({\n\tcontractJson: contract_default,\n\tmigrations: [\n\t\t{\n\t\t\tdirName: PGVECTOR_BASELINE_MIGRATION_NAME,\n\t\t\tmetadata: migration_default$4,\n\t\t\tops: ops_default$4\n\t\t},\n\t\t{\n\t\t\tdirName: PGVECTOR_UPGRADE_MIGRATION_NAME,\n\t\t\tmetadata: migration_default$2,\n\t\t\tops: ops_default$2\n\t\t},\n\t\t{\n\t\t\tdirName: PGVECTOR_INSTALL_MIGRATION_NAME,\n\t\t\tmetadata: migration_default$3,\n\t\t\tops: ops_default$3\n\t\t},\n\t\t{\n\t\t\tdirName: PGVECTOR_SEARCH_PATH_MIGRATION_NAME,\n\t\t\tmetadata: migration_default$1,\n\t\t\tops: ops_default$1\n\t\t},\n\t\t{\n\t\t\tdirName: PGVECTOR_SEARCH_PATH_INSTALL_MIGRATION_NAME,\n\t\t\tmetadata: migration_default,\n\t\t\tops: ops_default\n\t\t}\n\t],\n\theadRef: head_default\n});\nconst pgvectorExtensionDescriptor = {\n\t...pgvectorPackMeta,\n\tid: PGVECTOR_SPACE_ID,\n\tcontractSpace: pgvectorContractSpace,\n\ttypes: {\n\t\t...pgvectorPackMeta.types,\n\t\tcodecTypes: {\n\t\t\t...pgvectorPackMeta.types.codecTypes,\n\t\t\tcontrolPlaneHooks: { [PGVECTOR_CODEC_ID]: vectorControlPlaneHooks }\n\t\t}\n\t},\n\tqueryOperations: () => pgvectorQueryOperations(),\n\tcreate: () => ({\n\t\tfamilyId: \"sql\",\n\t\ttargetId: \"postgres\"\n\t})\n};\n//#endregion\nexport { pgvectorExtensionDescriptor as default, pgvectorExtensionDescriptor };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;AAGA,IAAI,sBAAsB;CACzB,MAAM;CACN,IAAI;CACJ,oBAAoB,CAAC,4BAA4B;CACjD,WAAW;CACX,eAAe;AAChB;AAGA,IAAI,gBAAgB,CAAC;CACpB,MAAM;CACN,SAAS;CACT,kBAAkB;CAClB,eAAe;CACf,UAAU;EACT,MAAM;EACN,WAAW;GACV,UAAU;GACV,cAAc;GACd,QAAQ;EACT;CACD;CACA,YAAY,CAAC;EACZ,eAAe;EACf,OAAO;EACP,UAAU,CAAC,QAAQ;CACpB,CAAC;CACD,WAAW,CAAC;EACX,eAAe;EACf,OAAO;CACR,CAAC;CACD,aAAa,CAAC;EACb,eAAe;EACf,OAAO;EACP,UAAU,CAAC,QAAQ;CACpB,CAAC;AACF,CAAC;AAGD,IAAI,sBAAsB;CACzB,MAAM;CACN,IAAI;CACJ,oBAAoB,CAAC;CACrB,WAAW;CACX,eAAe;AAChB;AAGA,IAAI,gBAAgB,CAAC;CACpB,MAAM;CACN,SAAS;CACT,kBAAkB;CAClB,UAAU,EAAE,MAAM,WAAW;CAC7B,YAAY,CAAC;CACb,WAAW,CAAC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;CACA,uBAAuB,wBAAwB;CAC/C,eAAe;EACd,UAAU;EACV,UAAU;CACX;AACD"}
1
+ {"version":3,"file":"control.mjs","names":[],"sources":["../../../../3-extensions/pgvector/dist/control.mjs"],"sourcesContent":["import { n as pgvectorQueryOperations, t as pgvectorPackMeta } from \"./descriptor-meta-BjWk6vBJ.mjs\";\nimport { contractSpaceFromJson } from \"@internal/migration-tools/spaces\";\n//#region migrations/20260601T0000_install_vector_extension/migration.json\nvar migration_default$4 = {\n\tfrom: null,\n\tto: \"4a96b488a4ce92b434e5f7d6607b6435c0955f0d36b0018077045787764240e6\",\n\tprovidedInvariants: [\"pgvector:install-vector-v1\"],\n\tcreatedAt: \"2026-06-01T00:00:00.000Z\",\n\tmigrationHash: \"ae458aa8c484439df5d79fdfbbe907a3ab7e53b25c79259a95909ab3c61d9a66\"\n};\n//#endregion\n//#region migrations/20260601T0000_install_vector_extension/ops.json\nvar ops_default$4 = [{\n\t\"id\": \"pgvector.install-vector-extension\",\n\t\"label\": \"Enable extension \\\"vector\\\"\",\n\t\"operationClass\": \"additive\",\n\t\"invariantId\": \"pgvector:install-vector-v1\",\n\t\"target\": {\n\t\t\"id\": \"postgres\",\n\t\t\"details\": {\n\t\t\t\"schema\": \"public\",\n\t\t\t\"objectType\": \"dependency\",\n\t\t\t\"name\": \"vector\"\n\t\t}\n\t},\n\t\"precheck\": [{\n\t\t\"description\": \"verify extension \\\"vector\\\" is not already enabled\",\n\t\t\"sql\": \"SELECT NOT EXISTS (SELECT 1 AS \\\"one\\\" FROM \\\"pg_extension\\\" WHERE \\\"extname\\\" = $1) AS \\\"result\\\"\",\n\t\t\"params\": [\"vector\"]\n\t}],\n\t\"execute\": [{\n\t\t\"description\": \"create extension \\\"vector\\\"\",\n\t\t\"sql\": \"CREATE EXTENSION IF NOT EXISTS vector\"\n\t}],\n\t\"postcheck\": [{\n\t\t\"description\": \"confirm extension \\\"vector\\\" is enabled\",\n\t\t\"sql\": \"SELECT EXISTS (SELECT 1 AS \\\"one\\\" FROM \\\"pg_extension\\\" WHERE \\\"extname\\\" = $1) AS \\\"result\\\"\",\n\t\t\"params\": [\"vector\"]\n\t}]\n}];\n//#endregion\n//#region migrations/20261029T1342_create_vector_extension/migration.json\nvar migration_default$3 = {\n\tfrom: null,\n\tto: \"698fc52f21eb891517203ef4b229823d17c49c3f802e2374be292a9b6a560c97\",\n\tprovidedInvariants: [],\n\tcreatedAt: \"2026-10-29T13:42:01.752Z\",\n\tmigrationHash: \"4883503fb5a53751035e28ec8b69e1faf5db5f26bce66ec42ff82be6f9579c77\"\n};\n//#endregion\n//#region migrations/20261029T1342_create_vector_extension/ops.json\nvar ops_default$3 = [{\n\t\"id\": \"schema.public\",\n\t\"label\": \"Create schema \\\"public\\\"\",\n\t\"operationClass\": \"additive\",\n\t\"target\": { \"id\": \"postgres\" },\n\t\"precheck\": [],\n\t\"execute\": [{\n\t\t\"description\": \"Create schema \\\"public\\\"\",\n\t\t\"sql\": \"CREATE SCHEMA IF NOT EXISTS \\\"public\\\"\",\n\t\t\"params\": []\n\t}],\n\t\"postcheck\": []\n}, {\n\t\"id\": \"extension.vector\",\n\t\"label\": \"Create extension \\\"vector\\\"\",\n\t\"operationClass\": \"additive\",\n\t\"target\": {\n\t\t\"id\": \"postgres\",\n\t\t\"details\": {\n\t\t\t\"schema\": \"public\",\n\t\t\t\"objectType\": \"dependency\",\n\t\t\t\"name\": \"vector\"\n\t\t}\n\t},\n\t\"precheck\": [{\n\t\t\"description\": \"verify extension \\\"vector\\\" is not installed\",\n\t\t\"sql\": \"SELECT NOT EXISTS (SELECT 1 AS \\\"one\\\" FROM \\\"pg_extension\\\" WHERE \\\"extname\\\" = $1) AS \\\"result\\\"\",\n\t\t\"params\": [\"vector\"],\n\t\t\"expectation\": {\n\t\t\t\"expects\": \"absent\",\n\t\t\t\"object\": \"extension \\\"vector\\\"\"\n\t\t}\n\t}],\n\t\"execute\": [{\n\t\t\"description\": \"create extension \\\"vector\\\"\",\n\t\t\"sql\": \"CREATE EXTENSION IF NOT EXISTS \\\"vector\\\" WITH SCHEMA \\\"public\\\"\"\n\t}],\n\t\"postcheck\": [{\n\t\t\"description\": \"confirm extension \\\"vector\\\" is installed\",\n\t\t\"sql\": \"SELECT EXISTS (SELECT 1 AS \\\"one\\\" FROM \\\"pg_extension\\\" WHERE \\\"extname\\\" = $1) AS \\\"result\\\"\",\n\t\t\"params\": [\"vector\"],\n\t\t\"expectation\": {\n\t\t\t\"expects\": \"present\",\n\t\t\t\"object\": \"extension \\\"vector\\\"\"\n\t\t}\n\t}]\n}];\n//#endregion\n//#region migrations/20261029T1342_declare_vector_extension/migration.json\nvar migration_default$2 = {\n\tfrom: \"4a96b488a4ce92b434e5f7d6607b6435c0955f0d36b0018077045787764240e6\",\n\tto: \"698fc52f21eb891517203ef4b229823d17c49c3f802e2374be292a9b6a560c97\",\n\tprovidedInvariants: [],\n\tcreatedAt: \"2026-10-29T13:42:09.120Z\",\n\tmigrationHash: \"e14f083b18d4ddd557fa9277f2a4b7d4bdea92d697661dbf10980bcfb57da936\"\n};\n//#endregion\n//#region migrations/20261029T1342_declare_vector_extension/ops.json\nvar ops_default$2 = [{\n\t\"id\": \"extension.vector\",\n\t\"label\": \"Create extension \\\"vector\\\"\",\n\t\"operationClass\": \"additive\",\n\t\"target\": {\n\t\t\"id\": \"postgres\",\n\t\t\"details\": {\n\t\t\t\"schema\": \"public\",\n\t\t\t\"objectType\": \"dependency\",\n\t\t\t\"name\": \"vector\"\n\t\t}\n\t},\n\t\"precheck\": [{\n\t\t\"description\": \"verify extension \\\"vector\\\" is not installed\",\n\t\t\"sql\": \"SELECT NOT EXISTS (SELECT 1 AS \\\"one\\\" FROM \\\"pg_extension\\\" WHERE \\\"extname\\\" = $1) AS \\\"result\\\"\",\n\t\t\"params\": [\"vector\"],\n\t\t\"expectation\": {\n\t\t\t\"expects\": \"absent\",\n\t\t\t\"object\": \"extension \\\"vector\\\"\"\n\t\t}\n\t}],\n\t\"execute\": [{\n\t\t\"description\": \"create extension \\\"vector\\\"\",\n\t\t\"sql\": \"CREATE EXTENSION IF NOT EXISTS \\\"vector\\\" WITH SCHEMA \\\"public\\\"\"\n\t}],\n\t\"postcheck\": [{\n\t\t\"description\": \"confirm extension \\\"vector\\\" is installed\",\n\t\t\"sql\": \"SELECT EXISTS (SELECT 1 AS \\\"one\\\" FROM \\\"pg_extension\\\" WHERE \\\"extname\\\" = $1) AS \\\"result\\\"\",\n\t\t\"params\": [\"vector\"],\n\t\t\"expectation\": {\n\t\t\t\"expects\": \"present\",\n\t\t\t\"object\": \"extension \\\"vector\\\"\"\n\t\t}\n\t}]\n}];\n//#endregion\n//#region migrations/20261106T1035_find_vector_on_search_path/migration.json\nvar migration_default$1 = {\n\tfrom: \"698fc52f21eb891517203ef4b229823d17c49c3f802e2374be292a9b6a560c97\",\n\tto: \"e4ab7d4329212a72d8e440fd7bf95a03e5c861e1d304dce1025b0fcaa1910d15\",\n\tprovidedInvariants: [],\n\tcreatedAt: \"2026-11-06T10:35:49.970Z\",\n\tmigrationHash: \"85a391e645fdad33d0fafd42421a347bb23e54af12485064488f65035f4a7dd3\"\n};\n//#endregion\n//#region migrations/20261106T1035_find_vector_on_search_path/ops.json\nvar ops_default$1 = [];\n//#endregion\n//#region migrations/20261106T1401_install_vector_on_search_path/migration.json\nvar migration_default = {\n\tfrom: null,\n\tto: \"e4ab7d4329212a72d8e440fd7bf95a03e5c861e1d304dce1025b0fcaa1910d15\",\n\tprovidedInvariants: [],\n\tcreatedAt: \"2026-11-06T14:01:36.994Z\",\n\tmigrationHash: \"278158a2ddecc5bca462d53237ab92d6f91febc2d9a249240353f1ed97f452b2\"\n};\n//#endregion\n//#region migrations/20261106T1401_install_vector_on_search_path/ops.json\nvar ops_default = [{\n\t\"id\": \"schema.public\",\n\t\"label\": \"Create schema \\\"public\\\"\",\n\t\"operationClass\": \"additive\",\n\t\"target\": { \"id\": \"postgres\" },\n\t\"precheck\": [],\n\t\"execute\": [{\n\t\t\"description\": \"Create schema \\\"public\\\"\",\n\t\t\"sql\": \"CREATE SCHEMA IF NOT EXISTS \\\"public\\\"\",\n\t\t\"params\": []\n\t}],\n\t\"postcheck\": []\n}, {\n\t\"id\": \"extension.vector\",\n\t\"label\": \"Create extension \\\"vector\\\"\",\n\t\"operationClass\": \"additive\",\n\t\"target\": {\n\t\t\"id\": \"postgres\",\n\t\t\"details\": {\n\t\t\t\"objectType\": \"dependency\",\n\t\t\t\"name\": \"vector\"\n\t\t}\n\t},\n\t\"precheck\": [{\n\t\t\"description\": \"verify extension \\\"vector\\\" is not installed\",\n\t\t\"sql\": \"SELECT NOT EXISTS (SELECT 1 AS \\\"one\\\" FROM \\\"pg_extension\\\" WHERE \\\"extname\\\" = $1) AS \\\"result\\\"\",\n\t\t\"params\": [\"vector\"],\n\t\t\"expectation\": {\n\t\t\t\"expects\": \"absent\",\n\t\t\t\"object\": \"extension \\\"vector\\\"\"\n\t\t}\n\t}],\n\t\"execute\": [{\n\t\t\"description\": \"create extension \\\"vector\\\"\",\n\t\t\"sql\": \"CREATE EXTENSION IF NOT EXISTS \\\"vector\\\"\"\n\t}],\n\t\"postcheck\": [{\n\t\t\"description\": \"confirm extension \\\"vector\\\" is installed\",\n\t\t\"sql\": \"SELECT EXISTS (SELECT 1 AS \\\"one\\\" FROM \\\"pg_extension\\\" WHERE \\\"extname\\\" = $1) AS \\\"result\\\"\",\n\t\t\"params\": [\"vector\"],\n\t\t\"expectation\": {\n\t\t\t\"expects\": \"present\",\n\t\t\t\"object\": \"extension \\\"vector\\\"\"\n\t\t}\n\t}]\n}];\n//#endregion\n//#region migrations/refs/head.json\nvar head_default = {\n\thash: \"e4ab7d4329212a72d8e440fd7bf95a03e5c861e1d304dce1025b0fcaa1910d15\",\n\tinvariants: []\n};\n//#endregion\n//#region src/contract.json\nvar contract_default = {\n\tschemaVersion: \"1\",\n\ttargetFamily: \"sql\",\n\ttarget: \"postgres\",\n\tprofileHash: \"3916f444a8a17ad749191acf9e08dad97d1a327b88c2f1d45d12f240296aa8b2\",\n\troots: {},\n\tdomain: { \"namespaces\": { \"public\": { \"models\": {} } } },\n\tstorage: {\n\t\t\"namespaces\": {\n\t\t\t\"__unbound__\": {\n\t\t\t\t\"entries\": {\n\t\t\t\t\t\"extension\": { \"vector\": {\n\t\t\t\t\t\t\"kind\": \"extension\",\n\t\t\t\t\t\t\"name\": \"vector\"\n\t\t\t\t\t} },\n\t\t\t\t\t\"table\": {}\n\t\t\t\t},\n\t\t\t\t\"id\": \"__unbound__\",\n\t\t\t\t\"kind\": \"postgres-unbound-schema\"\n\t\t\t},\n\t\t\t\"public\": {\n\t\t\t\t\"entries\": { \"table\": {} },\n\t\t\t\t\"id\": \"public\",\n\t\t\t\t\"kind\": \"postgres-schema\"\n\t\t\t}\n\t\t},\n\t\t\"storageHash\": \"e4ab7d4329212a72d8e440fd7bf95a03e5c861e1d304dce1025b0fcaa1910d15\",\n\t\t\"types\": { \"vector\": {\n\t\t\t\"codecId\": \"pg/vector@1\",\n\t\t\t\"dataType\": \"pgvector/vector\",\n\t\t\t\"kind\": \"codec-instance\"\n\t\t} }\n\t},\n\tcapabilities: {\n\t\t\"postgres\": {\n\t\t\t\"distinctOn\": true,\n\t\t\t\"forKeyShare\": true,\n\t\t\t\"forNoKeyUpdate\": true,\n\t\t\t\"jsonAgg\": true,\n\t\t\t\"lateral\": true,\n\t\t\t\"limit\": true,\n\t\t\t\"orderBy\": true,\n\t\t\t\"returning\": true\n\t\t},\n\t\t\"sql\": {\n\t\t\t\"checkConstraint\": true,\n\t\t\t\"defaultInInsert\": true,\n\t\t\t\"enums\": true,\n\t\t\t\"forShare\": true,\n\t\t\t\"forUpdate\": true,\n\t\t\t\"insertOnConflictSkip\": true,\n\t\t\t\"insertOnConflictTarget\": true,\n\t\t\t\"insertOnConflictWithoutTarget\": true,\n\t\t\t\"jsonAgg\": true,\n\t\t\t\"jsonAggWithoutTruncation\": true,\n\t\t\t\"lateral\": true,\n\t\t\t\"lockNowait\": true,\n\t\t\t\"lockOf\": true,\n\t\t\t\"lockSkipLocked\": true,\n\t\t\t\"outerReferencesInDerivedTables\": true,\n\t\t\t\"returning\": true,\n\t\t\t\"scalarList\": true\n\t\t}\n\t},\n\textensions: {},\n\tmeta: {},\n\t_generated: {\n\t\t\"warning\": \"⚠️ GENERATED FILE - DO NOT EDIT\",\n\t\t\"message\": \"This file is automatically generated by \\\"prisma contract emit\\\".\",\n\t\t\"regenerate\": \"To regenerate, run: prisma contract emit\"\n\t}\n};\n//#endregion\n//#region src/core/contract-space-constants.ts\n/**\n* Static names and identifiers used across pgvector'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 `'pgvector'` is what the framework writes to\n* `migrations/` in the user's repo and what the marker table's\n* `space` column carries for pgvector-owned rows.\n*\n* The `pgvector:*` invariantId namespace is locked here — once\n* published, an invariantId is immutable so downstream consumers can\n* reference it by literal string match.\n*/\nconst PGVECTOR_SPACE_ID = \"pgvector\";\nconst PGVECTOR_BASELINE_MIGRATION_NAME = \"20260601T0000_install_vector_extension\";\nconst PGVECTOR_UPGRADE_MIGRATION_NAME = \"20261029T1342_declare_vector_extension\";\nconst PGVECTOR_INSTALL_MIGRATION_NAME = \"20261029T1342_create_vector_extension\";\nconst PGVECTOR_SEARCH_PATH_MIGRATION_NAME = \"20261106T1035_find_vector_on_search_path\";\nconst PGVECTOR_SEARCH_PATH_INSTALL_MIGRATION_NAME = \"20261106T1401_install_vector_on_search_path\";\n//#endregion\n//#region src/exports/control.ts\nconst PGVECTOR_CODEC_ID = \"pg/vector@1\";\nfunction buildVectorIdentityValue(typeParams) {\n\tconst length = typeParams?.[\"length\"];\n\tif (typeof length !== \"number\" || !Number.isInteger(length) || length <= 0) return null;\n\treturn `'${`[${new Array(length).fill(\"0\").join(\",\")}]`}'::vector`;\n}\nconst vectorControlPlaneHooks = { resolveIdentityValue: ({ typeParams }) => buildVectorIdentityValue(typeParams) };\nconst pgvectorContractSpace = contractSpaceFromJson({\n\tcontractJson: contract_default,\n\tmigrations: [\n\t\t{\n\t\t\tdirName: PGVECTOR_BASELINE_MIGRATION_NAME,\n\t\t\tmetadata: migration_default$4,\n\t\t\tops: ops_default$4\n\t\t},\n\t\t{\n\t\t\tdirName: PGVECTOR_UPGRADE_MIGRATION_NAME,\n\t\t\tmetadata: migration_default$2,\n\t\t\tops: ops_default$2\n\t\t},\n\t\t{\n\t\t\tdirName: PGVECTOR_INSTALL_MIGRATION_NAME,\n\t\t\tmetadata: migration_default$3,\n\t\t\tops: ops_default$3\n\t\t},\n\t\t{\n\t\t\tdirName: PGVECTOR_SEARCH_PATH_MIGRATION_NAME,\n\t\t\tmetadata: migration_default$1,\n\t\t\tops: ops_default$1\n\t\t},\n\t\t{\n\t\t\tdirName: PGVECTOR_SEARCH_PATH_INSTALL_MIGRATION_NAME,\n\t\t\tmetadata: migration_default,\n\t\t\tops: ops_default\n\t\t}\n\t],\n\theadRef: head_default\n});\nconst pgvectorExtensionDescriptor = {\n\t...pgvectorPackMeta,\n\tid: PGVECTOR_SPACE_ID,\n\tcontractSpace: pgvectorContractSpace,\n\ttypes: {\n\t\t...pgvectorPackMeta.types,\n\t\tcodecTypes: {\n\t\t\t...pgvectorPackMeta.types.codecTypes,\n\t\t\tcontrolPlaneHooks: { [PGVECTOR_CODEC_ID]: vectorControlPlaneHooks }\n\t\t}\n\t},\n\tqueryOperations: () => pgvectorQueryOperations(),\n\tcreate: () => ({\n\t\tfamilyId: \"sql\",\n\t\ttargetId: \"postgres\"\n\t})\n};\n//#endregion\nexport { pgvectorExtensionDescriptor as default, pgvectorExtensionDescriptor };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;AAGA,IAAI,sBAAsB;CACzB,MAAM;CACN,IAAI;CACJ,oBAAoB,CAAC,4BAA4B;CACjD,WAAW;CACX,eAAe;AAChB;AAGA,IAAI,gBAAgB,CAAC;CACpB,MAAM;CACN,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AAG;AACzD;AACA,MAAM,0BAA0B,EAAE,uBAAuB,EAAE,iBAAiB,yBAAyB,UAAU,EAAE;AACjH,MAAM,wBAAwB,sBAAsB;CACnD,cAAc;CACd,YAAY;EACX;GACC,SAAS;GACT,UAAU;GACV,KAAK;EACN;EACA;GACC,SAAS;GACT,UAAU;GACV,KAAK;EACN;EACA;GACC,SAAS;GACT,UAAU;GACV,KAAK;EACN;EACA;GACC,SAAS;GACT,UAAU;GACV,KAAK;EACN;EACA;GACC,SAAS;GACT,UAAU;GACV,KAAK;EACN;CACD;CACA,SAAS;AACV,CAAC;AACD,MAAM,8BAA8B;CACnC,GAAG;CACH,IAAI;CACJ,eAAe;CACf,OAAO;EACN,GAAG,iBAAiB;EACpB,YAAY;GACX,GAAG,iBAAiB,MAAM;GAC1B,mBAAmB,GAAG,oBAAoB,wBAAwB;EACnE;CACD;CACA,uBAAuB,wBAAwB;CAC/C,eAAe;EACd,UAAU;EACV,UAAU;CACX;AACD"}
@@ -9,14 +9,16 @@ import { type } from "arktype";
9
9
  import { buildCodecDescriptorRegistry } from "@prisma/orm-family-sql/relational-core/codec-descriptor-registry";
10
10
  import { CastExpr } from "@prisma/orm-family-sql/relational-core/ast";
11
11
  import { PostgresCodecDescriptor, definePostgresCodecs } from "@prisma/orm-target-postgres/target/codec-descriptor";
12
- //#region ../../../3-extensions/pgvector/dist/descriptor-meta-CVuMPD3K.mjs
12
+ import { ifDefined } from "@prisma/orm-framework/utils/defined";
13
+ //#region ../../../3-extensions/pgvector/dist/descriptor-meta-BjWk6vBJ.mjs
13
14
  const pgvectorAuthoringTypes = { pgvector: { Vector: {
14
15
  kind: "typeConstructor",
15
16
  inferred: true,
16
17
  args: [{
17
18
  kind: "value",
18
19
  dataType: "pg/int4",
19
- name: "length"
20
+ name: "length",
21
+ optional: true
20
22
  }],
21
23
  output: {
22
24
  codecId: "pg/vector@1",
@@ -37,15 +39,16 @@ function elementNumber(element) {
37
39
  fix: "Use a finite number for every element."
38
40
  });
39
41
  }
40
- const pgvectorVectorParams = type({ length: `number.integer >= 1 & number.integer <= ${VECTOR_MAX_DIM}` });
41
- /** A `vector(n)` value is an array of exactly `n` finite numbers, each one a `real` holds exactly. */
42
+ const pgvectorVectorParams = type({ "length?": `number.integer >= 1 & number.integer <= ${VECTOR_MAX_DIM}` });
43
+ /** A `vector(n)` value is an array of exactly `n` finite numbers, and a `vector` value one of 1 to 16,000, each one a `real` holds exactly. */
42
44
  function isFiniteNumber(element) {
43
45
  return typeof element === "number" && Number.isFinite(element);
44
46
  }
45
47
  const readVector = (json, params) => {
46
48
  const length = typeof params["length"] === "number" ? params["length"] : void 0;
47
- const expected = length === void 0 ? "an array of finite numbers" : `an array of ${counted(length, "finite number")}`;
48
- if (!Array.isArray(json) || length !== void 0 && json.length !== length) return refuseJsonValue("pgvector/vector", expected, json);
49
+ const expected = length === void 0 ? `an array of 1 to ${VECTOR_MAX_DIM} finite numbers` : `an array of ${counted(length, "finite number")}`;
50
+ const acceptsLength = (received) => length === void 0 ? received >= 1 && received <= 16e3 : received === length;
51
+ if (!Array.isArray(json) || !acceptsLength(json.length)) return refuseJsonValue("pgvector/vector", expected, json);
49
52
  if (!json.every(isFiniteNumber)) return refuseJsonValue("pgvector/vector", expected, json);
50
53
  for (const [index, element] of json.entries()) {
51
54
  const refuse = (why) => refuseJsonValue("pgvector/vector", `an array of numbers real holds exactly; element ${index + 1}, ${element}, ${why}`, json);
@@ -70,6 +73,10 @@ const pgvectorVector = sqlDataType("pgvector/vector", {
70
73
  params: pgvectorVectorParams,
71
74
  read: readVector,
72
75
  texts: [{
76
+ text: "vector",
77
+ written: true,
78
+ catalog: true
79
+ }, {
73
80
  text: "vector({length})",
74
81
  written: true,
75
82
  catalog: true
@@ -85,6 +92,7 @@ const pgvectorVector = sqlDataType("pgvector/vector", {
85
92
  }
86
93
  });
87
94
  const pgvectorDataTypes = [pgvectorVector];
95
+ const moduleBase = "@prisma/orm-extension-pgvector";
88
96
  function pgVectorError(code, message, options) {
89
97
  return structuredError(code, message, options);
90
98
  }
@@ -94,10 +102,10 @@ function pgVectorError(code, message, options) {
94
102
  * Mirrors the patterns in `postgres/codecs-class.ts` and `sqlite/codecs-class.ts` for the single `pg/vector@1` codec. Three artifacts:
95
103
  *
96
104
  * 1. `PgVectorCodec` extends {@link CodecImpl} with the wire and value conversions inline. Conversions are simple enough (PostgreSQL `[1,2,3]` text format) that no shared helper module is warranted; the class body is the source of truth.
97
- * 2. `PgVectorDescriptor` extends {@link PostgresCodecDescriptor} with the codec id, traits, the `pgvector/vector` data type and its params schema, and explicit target behavior. The column's type, `Vector<${length}>`, comes from the pack's type function in `types/codec-types.ts`. The data type declares the type's name and the bounds of `length`.
98
- * 3. `pgVectorColumn(length)` per-codec column helper invoking `descriptor.factory({ length })` directly.
105
+ * 2. `PgVectorDescriptor` extends {@link PostgresCodecDescriptor} with the codec id, traits, the `pgvector/vector` data type and its params schema, and explicit target behavior. The type of a `vector(N)` column, `Vector<${length}>`, comes from the pack's type function in `types/codec-types.ts`; a `vector()` column reads as `number[]`. The data type declares the type's name and the bounds of `length`.
106
+ * 3. `pgVectorColumn(length?)` per-codec column helper invoking `descriptor.factory({ length })`, or `descriptor.factory({})` without a length.
99
107
  *
100
- * `length` threads into the runtime codec via the constructor so the wire methods enforce the declared dimension, and `pgvector/vector` checks it for every stored value. Without this, `vector(3)` and `vector(1536)` would produce codecs with identical behaviour and a dimension-mismatched value would round-trip undetected.
108
+ * When given, `length` threads into the runtime codec via the constructor so the wire methods enforce the declared dimension, and `pgvector/vector` checks it for every stored value. Without this, `vector(3)` and `vector(1536)` would produce codecs with identical behaviour and a dimension-mismatched value would round-trip undetected.
101
109
  */
102
110
  function parseVector(value) {
103
111
  if (!value.startsWith("[") || !value.endsWith("]")) throw pgVectorError("RUNTIME.DECODE_FAILED", `Invalid vector format: expected "[...]", got "${value}"`, {
@@ -123,7 +131,7 @@ function parseVector(value) {
123
131
  var PgVectorCodec = class extends CodecImpl {
124
132
  length;
125
133
  constructor(descriptor, length) {
126
- super(descriptor, pgvectorVector, { length });
134
+ super(descriptor, pgvectorVector, ifDefined("length", length));
127
135
  this.length = length;
128
136
  }
129
137
  assertVector(value, code) {
@@ -136,7 +144,12 @@ var PgVectorCodec = class extends CodecImpl {
136
144
  if (typeof element !== "number") throw pgVectorError(code, "Vector value must contain only numbers", { meta });
137
145
  if (!Number.isFinite(element)) throw pgVectorError(code, "Vector value must contain only finite numbers", { meta });
138
146
  }
139
- if (value.length !== this.length) throw pgVectorError(code, `Vector length mismatch: expected ${this.length}, got ${value.length}`, {
147
+ if (this.length === void 0) {
148
+ if (value.length < 1 || value.length > 16e3) throw pgVectorError(code, `Vector length must be between 1 and ${VECTOR_MAX_DIM}, got ${value.length}`, { meta: {
149
+ ...meta,
150
+ receivedLength: value.length
151
+ } });
152
+ } else if (value.length !== this.length) throw pgVectorError(code, `Vector length mismatch: expected ${this.length}, got ${value.length}`, {
140
153
  why: `This column is declared as vector(${this.length}); every value must have exactly that many dimensions.`,
141
154
  meta: {
142
155
  ...meta,
@@ -245,23 +258,23 @@ const pgvectorPackMeta = {
245
258
  codecTypes: {
246
259
  codecDescriptors: Array.from(pgvectorCodecRegistry.values()),
247
260
  import: {
248
- package: "@internal/extension-pgvector/codec-types",
261
+ package: `${moduleBase}/codec-types`,
249
262
  named: "CodecTypes",
250
263
  alias: "PgVectorTypes"
251
264
  },
252
265
  parameterizedOutputTypes: {
253
- package: "@internal/extension-pgvector/codec-types",
266
+ package: `${moduleBase}/codec-types`,
254
267
  named: "ParameterizedOutputTypesForTypeParams",
255
268
  alias: "PgVectorParameterizedOutputTypes"
256
269
  }
257
270
  },
258
271
  operationTypes: { import: {
259
- package: "@internal/extension-pgvector/operation-types",
272
+ package: `${moduleBase}/operation-types`,
260
273
  named: "OperationTypes",
261
274
  alias: "PgVectorOperationTypes"
262
275
  } },
263
276
  queryOperationTypes: { import: {
264
- package: "@internal/extension-pgvector/operation-types",
277
+ package: `${moduleBase}/operation-types`,
265
278
  named: "QueryOperationTypes",
266
279
  alias: "PgVectorQueryOperationTypes"
267
280
  } }
@@ -270,4 +283,4 @@ const pgvectorPackMeta = {
270
283
  //#endregion
271
284
  export { pgvectorPackMeta as n, pgvectorQueryOperations as r, pgvectorCodecRegistry as t };
272
285
 
273
- //# sourceMappingURL=descriptor-meta-CVuMPD3K-BuJ5TQ9Y.mjs.map
286
+ //# sourceMappingURL=descriptor-meta-BjWk6vBJ-BLEfroRD.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptor-meta-BjWk6vBJ-BLEfroRD.mjs","names":[],"sources":["../../../../3-extensions/pgvector/dist/descriptor-meta-BjWk6vBJ.mjs"],"sourcesContent":["import { n as VECTOR_MAX_DIM, t as VECTOR_CODEC_ID } from \"./constants-D8Ccy-f4.mjs\";\nimport { buildOperation, codecOf, toExpr } from \"@internal/sql-relational-core/expression\";\nimport { CodecImpl, isNonFiniteText, refuseJsonValue } from \"@internal/framework-components/codec\";\nimport { sqlDataType } from \"@internal/sql-contract/data-type\";\nimport { pgInt2, pgInt4, pgInt8, pgNumeric } from \"@internal/target-postgres/data-types\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { counted } from \"@internal/utils/text\";\nimport { type } from \"arktype\";\nimport { buildCodecDescriptorRegistry } from \"@internal/sql-relational-core/codec-descriptor-registry\";\nimport { CastExpr } from \"@internal/sql-relational-core/ast\";\nimport { PostgresCodecDescriptor, definePostgresCodecs } from \"@internal/target-postgres/codec-descriptor\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/core/authoring.ts\nconst pgvectorAuthoringTypes = { pgvector: { Vector: {\n\tkind: \"typeConstructor\",\n\tinferred: true,\n\targs: [{\n\t\tkind: \"value\",\n\t\tdataType: \"pg/int4\",\n\t\tname: \"length\",\n\t\toptional: true\n\t}],\n\toutput: {\n\t\tcodecId: \"pg/vector@1\",\n\t\ttypeParams: { length: {\n\t\t\tkind: \"arg\",\n\t\t\tindex: 0\n\t\t} }\n\t}\n} } };\n//#endregion\n//#region src/core/data-types.ts\nfunction elementNumber(element) {\n\tif (typeof element === \"number\") return element;\n\tif (typeof element === \"string\" && !isNonFiniteText(element)) {\n\t\tconst converted = Number(element);\n\t\tif (Number.isFinite(converted)) return converted;\n\t}\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `A vector holds finite numbers, and ${JSON.stringify(element)} is not one.`, {\n\t\twhy: \"A vector element is a finite number; NaN and the two infinities have no place in one.\",\n\t\tfix: \"Use a finite number for every element.\"\n\t});\n}\nconst pgvectorVectorParams = type({ \"length?\": `number.integer >= 1 & number.integer <= ${VECTOR_MAX_DIM}` });\n/** A `vector(n)` value is an array of exactly `n` finite numbers, and a `vector` value one of 1 to 16,000, each one a `real` holds exactly. */\nfunction isFiniteNumber(element) {\n\treturn typeof element === \"number\" && Number.isFinite(element);\n}\nconst readVector = (json, params) => {\n\tconst length = typeof params[\"length\"] === \"number\" ? params[\"length\"] : void 0;\n\tconst expected = length === void 0 ? `an array of 1 to ${VECTOR_MAX_DIM} finite numbers` : `an array of ${counted(length, \"finite number\")}`;\n\tconst acceptsLength = (received) => length === void 0 ? received >= 1 && received <= 16e3 : received === length;\n\tif (!Array.isArray(json) || !acceptsLength(json.length)) return refuseJsonValue(\"pgvector/vector\", expected, json);\n\tif (!json.every(isFiniteNumber)) return refuseJsonValue(\"pgvector/vector\", expected, json);\n\tfor (const [index, element] of json.entries()) {\n\t\tconst refuse = (why) => refuseJsonValue(\"pgvector/vector\", `an array of numbers real holds exactly; element ${index + 1}, ${element}, ${why}`, json);\n\t\tif (!Number.isFinite(Math.fround(element))) return refuse(\"is outside the range real holds, which PostgreSQL refuses\");\n\t\tconst stored = realText(element);\n\t\tif (Number(stored) !== element) return refuse(`would be stored as ${stored}`);\n\t}\n\treturn json;\n};\n/**\n* The text PostgreSQL prints for `value` stored as a `real`, which is what a row reads back: the shortest decimal that reads back as the same single-precision number.\n*/\nfunction realText(value) {\n\tconst single = Math.fround(value);\n\tfor (let digits = 1; digits <= 9; digits++) {\n\t\tconst text = String(Number(single.toPrecision(digits)));\n\t\tif (Math.fround(Number(text)) === single) return text;\n\t}\n\treturn String(single);\n}\nconst pgvectorVector = sqlDataType(\"pgvector/vector\", {\n\tparams: pgvectorVectorParams,\n\tread: readVector,\n\ttexts: [{\n\t\ttext: \"vector\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}, {\n\t\ttext: \"vector({length})\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}],\n\tlistCast: {\n\t\tof: [\n\t\t\tpgInt2.id,\n\t\t\tpgInt4.id,\n\t\t\tpgInt8.id,\n\t\t\tpgNumeric.id\n\t\t],\n\t\tcast: (elements) => elements.map(elementNumber)\n\t}\n});\nconst pgvectorDataTypes = [pgvectorVector];\n//#endregion\n//#region src/core/module-base.ts\nconst moduleBase = typeof __PRISMA_PUBLISHED_MODULE_BASE__EXTENSION_PGVECTOR === \"string\" ? __PRISMA_PUBLISHED_MODULE_BASE__EXTENSION_PGVECTOR : \"@internal/extension-pgvector\";\n//#endregion\n//#region src/core/errors.ts\nfunction pgVectorError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/core/codecs.ts\n/**\n* pgvector extension codec.\n*\n* Mirrors the patterns in `postgres/codecs-class.ts` and `sqlite/codecs-class.ts` for the single `pg/vector@1` codec. Three artifacts:\n*\n* 1. `PgVectorCodec` extends {@link CodecImpl} with the wire and value conversions inline. Conversions are simple enough (PostgreSQL `[1,2,3]` text format) that no shared helper module is warranted; the class body is the source of truth.\n* 2. `PgVectorDescriptor` extends {@link PostgresCodecDescriptor} with the codec id, traits, the `pgvector/vector` data type and its params schema, and explicit target behavior. The type of a `vector(N)` column, `Vector<${length}>`, comes from the pack's type function in `types/codec-types.ts`; a `vector()` column reads as `number[]`. The data type declares the type's name and the bounds of `length`.\n* 3. `pgVectorColumn(length?)` per-codec column helper invoking `descriptor.factory({ length })`, or `descriptor.factory({})` without a length.\n*\n* When given, `length` threads into the runtime codec via the constructor so the wire methods enforce the declared dimension, and `pgvector/vector` checks it for every stored value. Without this, `vector(3)` and `vector(1536)` would produce codecs with identical behaviour and a dimension-mismatched value would round-trip undetected.\n*/\nfunction parseVector(value) {\n\tif (!value.startsWith(\"[\") || !value.endsWith(\"]\")) throw pgVectorError(\"RUNTIME.DECODE_FAILED\", `Invalid vector format: expected \"[...]\", got \"${value}\"`, {\n\t\twhy: \"The database returned a vector value that is not in the PostgreSQL \\\"[x,y,z]\\\" text format.\",\n\t\tmeta: {\n\t\t\tcodecId: VECTOR_CODEC_ID,\n\t\t\twirePreview: value\n\t\t}\n\t});\n\tconst content = value.slice(1, -1).trim();\n\treturn content === \"\" ? [] : content.split(\",\").map((entry) => {\n\t\tconst number = Number.parseFloat(entry.trim());\n\t\tif (Number.isNaN(number)) throw pgVectorError(\"RUNTIME.DECODE_FAILED\", `Invalid vector value: \"${entry}\" is not a number`, {\n\t\t\twhy: \"A vector entry returned by the database could not be parsed as a number.\",\n\t\t\tmeta: {\n\t\t\t\tcodecId: VECTOR_CODEC_ID,\n\t\t\t\twirePreview: value\n\t\t\t}\n\t\t});\n\t\treturn number;\n\t});\n}\nvar PgVectorCodec = class extends CodecImpl {\n\tlength;\n\tconstructor(descriptor, length) {\n\t\tsuper(descriptor, pgvectorVector, ifDefined(\"length\", length));\n\t\tthis.length = length;\n\t}\n\tassertVector(value, code) {\n\t\tconst meta = {\n\t\t\tcodecId: VECTOR_CODEC_ID,\n\t\t\texpectedLength: this.length\n\t\t};\n\t\tif (!Array.isArray(value)) throw pgVectorError(code, \"Vector value must be an array of numbers\", { meta });\n\t\tfor (const element of value) {\n\t\t\tif (typeof element !== \"number\") throw pgVectorError(code, \"Vector value must contain only numbers\", { meta });\n\t\t\tif (!Number.isFinite(element)) throw pgVectorError(code, \"Vector value must contain only finite numbers\", { meta });\n\t\t}\n\t\tif (this.length === void 0) {\n\t\t\tif (value.length < 1 || value.length > 16e3) throw pgVectorError(code, `Vector length must be between 1 and ${VECTOR_MAX_DIM}, got ${value.length}`, { meta: {\n\t\t\t\t...meta,\n\t\t\t\treceivedLength: value.length\n\t\t\t} });\n\t\t} else if (value.length !== this.length) throw pgVectorError(code, `Vector length mismatch: expected ${this.length}, got ${value.length}`, {\n\t\t\twhy: `This column is declared as vector(${this.length}); every value must have exactly that many dimensions.`,\n\t\t\tmeta: {\n\t\t\t\t...meta,\n\t\t\t\treceivedLength: value.length\n\t\t\t}\n\t\t});\n\t}\n\tasync toWire(value, _ctx) {\n\t\tthis.assertVector(value, \"RUNTIME.ENCODE_FAILED\");\n\t\treturn `[${value.join(\",\")}]`;\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\tif (typeof wire !== \"string\") throw pgVectorError(\"RUNTIME.DECODE_FAILED\", \"Vector wire value must be a string\", { meta: { codecId: VECTOR_CODEC_ID } });\n\t\tconst value = parseVector(wire);\n\t\tthis.assertVector(value, \"RUNTIME.DECODE_FAILED\");\n\t\treturn value;\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn [...value.value];\n\t}\n\ttoDataTypeValue(input) {\n\t\tthis.assertVector(input, \"RUNTIME.ENCODE_FAILED\");\n\t\treturn this.dataTypeValueOf([...input]);\n\t}\n};\n/**\n* Projects a `vector` as the text PostgreSQL prints for it, the value the runtime driver returns for\n* an ordinary row, so `fromWire` reads an included vector as it reads a row. A JSON array of the\n* elements would not do: an element is a `real`, and the text holds the shortest decimal that\n* reads back as that `real`, so the row reads `0.1` where the element widened to a double is\n* `0.10000000149011612`.\n*/\nconst vectorTextJsonProjection = (expression) => CastExpr.as(expression, \"text\");\nvar PgVectorDescriptor = class extends PostgresCodecDescriptor {\n\tjsonType = \"array\";\n\tjsonProjection(expression) {\n\t\treturn vectorTextJsonProjection(expression);\n\t}\n\tdataType = pgvectorVector.id;\n\tcodecId = VECTOR_CODEC_ID;\n\ttraits = [\"equality\"];\n\tenumRefusal = \"The contract stores a vector member as an array of numbers, which no CHECK can list. No enum can use a vector codec; use a text enum instead.\";\n\tparamsSchema = pgvectorVectorParams;\n\tfactory(params) {\n\t\treturn () => new PgVectorCodec(this, params.length);\n\t}\n};\nconst codecDescriptorMap = { vector: new PgVectorDescriptor() };\n//#endregion\n//#region src/core/registry.ts\n/**\n* Registry of every codec descriptor shipped by `@internal/extension-pgvector`.\n*\n* Public consumer surface for the pgvector codec set. Currently a single entry (`pg/vector@1`); the registry shape stays consistent with the other codec-shipping packages so consumers don't need to special-case extensions. See ADR 208.\n*/\nconst pgvectorCodecRegistry = buildCodecDescriptorRegistry(definePostgresCodecs(Object.values(codecDescriptorMap)));\n//#endregion\n//#region src/core/descriptor-meta.ts\nconst pgvectorTypeId = \"pg/vector@1\";\nfunction pgvectorQueryOperations() {\n\treturn {\n\t\tcosineDistance: {\n\t\t\tself: { codecId: pgvectorTypeId },\n\t\t\timpl: (self, other) => {\n\t\t\t\tconst selfCodec = codecOf(self);\n\t\t\t\treturn buildOperation({\n\t\t\t\t\tmethod: \"cosineDistance\",\n\t\t\t\t\targs: [toExpr(self, selfCodec), toExpr(other, selfCodec)],\n\t\t\t\t\treturns: {\n\t\t\t\t\t\tcodecId: \"pg/float8@1\",\n\t\t\t\t\t\tnullable: false\n\t\t\t\t\t},\n\t\t\t\t\tlowering: {\n\t\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\t\ttemplate: \"{{self}} <=> {{arg0}}\"\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tcosineSimilarity: {\n\t\t\tself: { codecId: pgvectorTypeId },\n\t\t\timpl: (self, other) => {\n\t\t\t\tconst selfCodec = codecOf(self);\n\t\t\t\treturn buildOperation({\n\t\t\t\t\tmethod: \"cosineSimilarity\",\n\t\t\t\t\targs: [toExpr(self, selfCodec), toExpr(other, selfCodec)],\n\t\t\t\t\treturns: {\n\t\t\t\t\t\tcodecId: \"pg/float8@1\",\n\t\t\t\t\t\tnullable: false\n\t\t\t\t\t},\n\t\t\t\t\tlowering: {\n\t\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\t\ttemplate: \"1 - ({{self}} <=> {{arg0}})\"\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n}\nconst pgvectorPackMeta = {\n\tkind: \"extension\",\n\tid: \"pgvector\",\n\tfamilyId: \"sql\",\n\ttargetId: \"postgres\",\n\tversion: \"0.0.1\",\n\tcapabilities: { postgres: { \"pgvector.cosine\": true } },\n\tauthoring: { type: pgvectorAuthoringTypes },\n\tdataTypes: pgvectorDataTypes,\n\ttypes: {\n\t\tcodecTypes: {\n\t\t\tcodecDescriptors: Array.from(pgvectorCodecRegistry.values()),\n\t\t\timport: {\n\t\t\t\tpackage: `${moduleBase}/codec-types`,\n\t\t\t\tnamed: \"CodecTypes\",\n\t\t\t\talias: \"PgVectorTypes\"\n\t\t\t},\n\t\t\tparameterizedOutputTypes: {\n\t\t\t\tpackage: `${moduleBase}/codec-types`,\n\t\t\t\tnamed: \"ParameterizedOutputTypesForTypeParams\",\n\t\t\t\talias: \"PgVectorParameterizedOutputTypes\"\n\t\t\t}\n\t\t},\n\t\toperationTypes: { import: {\n\t\t\tpackage: `${moduleBase}/operation-types`,\n\t\t\tnamed: \"OperationTypes\",\n\t\t\talias: \"PgVectorOperationTypes\"\n\t\t} },\n\t\tqueryOperationTypes: { import: {\n\t\t\tpackage: `${moduleBase}/operation-types`,\n\t\t\tnamed: \"QueryOperationTypes\",\n\t\t\talias: \"PgVectorQueryOperationTypes\"\n\t\t} }\n\t}\n};\n//#endregion\nexport { pgvectorQueryOperations as n, pgvectorCodecRegistry as r, pgvectorPackMeta as t };\n\n//# sourceMappingURL=descriptor-meta-BjWk6vBJ.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,yBAAyB,EAAE,UAAU,EAAE,QAAQ;CACpD,MAAM;CACN,UAAU;CACV,MAAM,CAAC;EACN,MAAM;EACN,UAAU;EACV,MAAM;EACN,UAAU;CACX,CAAC;CACD,QAAQ;EACP,SAAS;EACT,YA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CAAC;KACxD,SAAS;MACR,SAAS;MACT,UAAU;KACX;KACA,UAAU;MACT,cAAc;MACd,UAAU;KACX;IACD,CAAC;GACF;EACD;CACD;AACD;AACA,MAAM,mBAAmB;CACxB,MAAM;CACN,IAAI;CACJ,UAAU;CACV,UAAU;CACV,SAAS;CACT,cAAc,EAAE,UAAU,EAAE,mBAAmB,KAAK,EAAE;CACtD,WAAW,EAAE,MAAM,uBAAuB;CAC1C,WAAW;CACX,OAAO;EACN,YAAY;GACX,kBAAkB,MAAM,KAAK,sBAAsB,OAAO,CAAC;GAC3D,QAAQ;IACP,SAAS,GAAG,WAAW;IACvB,OAAO;IACP,OAAO;GACR;GACA,0BAA0B;IACzB,SAAS,GAAG,WAAW;IACvB,OAAO;IACP,OAAO;GACR;EACD;EACA,gBAAgB,EAAE,QAAQ;GACzB,SAAS,GAAG,WAAW;GACvB,OAAO;GACP,OAAO;EACR,EAAE;EACF,qBAAqB,EAAE,QAAQ;GAC9B,SAAS,GAAG,WAAW;GACvB,OAAO;GACP,OAAO;EACR,EAAE;CACH;AACD"}
package/dist/pack.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as ParameterizedOutputTypesForTypeParams, r as Vector, t as CodecTypes } from "./codec-types-C4BGWf7E-CXMQqk2H.mjs";
1
+ import { n as ParameterizedOutputTypesForTypeParams, r as Vector, t as CodecTypes } from "./codec-types-B-Xh6Cqq-fe04pIao.mjs";
2
2
  import { n as QueryOperationTypesForCodecs } from "./operation-types-SKTIzyy9-DXQ_bE1A.mjs";
3
3
  //#region ../../../3-extensions/pgvector/dist/pack.d.mts
4
4
  //#region src/core/descriptor-meta.d.ts
@@ -23,6 +23,7 @@ declare const pgvectorPackMetaBase: {
23
23
  readonly kind: "value";
24
24
  readonly dataType: "pg/int4";
25
25
  readonly name: "length";
26
+ readonly optional: true;
26
27
  }];
27
28
  readonly output: {
28
29
  readonly codecId: "pg/vector@1";
@@ -42,26 +43,26 @@ declare const pgvectorPackMetaBase: {
42
43
  readonly codecTypes: {
43
44
  readonly codecDescriptors: import("@prisma/orm-framework/components/codec").CodecDescriptor<unknown>[];
44
45
  readonly import: {
45
- readonly package: "@internal/extension-pgvector/codec-types";
46
+ readonly package: `${string}/codec-types`;
46
47
  readonly named: "CodecTypes";
47
48
  readonly alias: "PgVectorTypes";
48
49
  };
49
50
  readonly parameterizedOutputTypes: {
50
- readonly package: "@internal/extension-pgvector/codec-types";
51
+ readonly package: `${string}/codec-types`;
51
52
  readonly named: "ParameterizedOutputTypesForTypeParams";
52
53
  readonly alias: "PgVectorParameterizedOutputTypes";
53
54
  };
54
55
  };
55
56
  readonly operationTypes: {
56
57
  readonly import: {
57
- readonly package: "@internal/extension-pgvector/operation-types";
58
+ readonly package: `${string}/operation-types`;
58
59
  readonly named: "OperationTypes";
59
60
  readonly alias: "PgVectorOperationTypes";
60
61
  };
61
62
  };
62
63
  readonly queryOperationTypes: {
63
64
  readonly import: {
64
- readonly package: "@internal/extension-pgvector/operation-types";
65
+ readonly package: `${string}/operation-types`;
65
66
  readonly named: "QueryOperationTypes";
66
67
  readonly alias: "PgVectorQueryOperationTypes";
67
68
  };
@@ -1 +1 @@
1
- {"version":3,"file":"pack.d.mts","names":[],"sources":["../../../../3-extensions/pgvector/dist/pack.d.mts"],"mappings":";;;;cAGc;WACH;WACA;WACA;WACA;WACA;WACA;aACE;eACE;;;WAGJ;aACE;eACE;iBACE;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;;;;WAQd,mEAAmE;WACnE;aACE;eACE,iEAAiE;eACjE;iBACE;iBACA;iBACA;;eAEF;iBACE;iBACA;iBACA;;;aAGJ;eACE;iBACE;iBACA;iBACA;;;aAGJ;eACE;iBACE;iBACA;iBACA;;;;;cAKH,yBAAyB;WAC5B,eAAe;WACf,wBAAwB;WACxB,6BAA6B"}
1
+ {"version":3,"file":"pack.d.mts","names":[],"sources":["../../../../3-extensions/pgvector/dist/pack.d.mts"],"mappings":";;;;cAGc;WACH;WACA;WACA;WACA;WACA;WACA;aACE;eACE;;;WAGJ;aACE;eACE;iBACE;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;;;;WAQd,mEAAmE;WACnE;aACE;eACE,iEAAiE;eACjE;iBACE;iBACA;iBACA;;eAEF;iBACE;iBACA;iBACA;;;aAGJ;eACE;iBACE;iBACA;iBACA;;;aAGJ;eACE;iBACE;iBACA;iBACA;;;;;cAKH,yBAAyB;WAC5B,eAAe;WACf,wBAAwB;WACxB,6BAA6B"}
package/dist/pack.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { n as pgvectorPackMeta } from "./descriptor-meta-CVuMPD3K-BuJ5TQ9Y.mjs";
1
+ import { n as pgvectorPackMeta } from "./descriptor-meta-BjWk6vBJ-BLEfroRD.mjs";
2
2
  export { pgvectorPackMeta as default };
@@ -1,5 +1,5 @@
1
1
  import { t as VECTOR_CODEC_ID } from "./constants-BjLQgqqq-CMdE2ode.mjs";
2
- import { r as Vector } from "./codec-types-C4BGWf7E-CXMQqk2H.mjs";
2
+ import { r as Vector } from "./codec-types-B-Xh6Cqq-fe04pIao.mjs";
3
3
  import { SqlRuntimeExtensionDescriptor } from "@prisma/orm-family-sql/runtime";
4
4
  import { CodecDescriptorRegistry } from "@prisma/orm-family-sql/relational-core/query-lane-context";
5
5
  import { CollectionMethodContributionType, CollectionMethodModelType } from "@prisma/orm-family-sql/relational-core/collection-methods";
package/dist/runtime.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as pgvectorPackMeta, r as pgvectorQueryOperations, t as pgvectorCodecRegistry } from "./descriptor-meta-CVuMPD3K-BuJ5TQ9Y.mjs";
1
+ import { n as pgvectorPackMeta, r as pgvectorQueryOperations, t as pgvectorCodecRegistry } from "./descriptor-meta-BjWk6vBJ-BLEfroRD.mjs";
2
2
  import { blindCast } from "@prisma/orm-framework/utils/casts";
3
3
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
4
4
  //#region ../../../3-extensions/pgvector/dist/runtime.mjs
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.mjs","names":[],"sources":["../../../../3-extensions/pgvector/dist/runtime.mjs"],"sourcesContent":["import { n as pgvectorQueryOperations, r as pgvectorCodecRegistry, t as pgvectorPackMeta } from \"./descriptor-meta-CVuMPD3K.mjs\";\nimport \"./constants-D8Ccy-f4.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/core/nearest-collection-method.ts\nfunction distanceTo(model, field, vector) {\n\tconst accessor = blindCast(model)[field];\n\tif (accessor === void 0) throw new InternalError(`The model accessor has no vector field \"${field}\".`);\n\treturn accessor.cosineDistance(vector);\n}\nfunction nearestMethod(field) {\n\treturn (collection, ...args) => {\n\t\tconst [vector, maxDistance] = blindCast(args);\n\t\tlet shared;\n\t\tconst distance = (model) => {\n\t\t\tshared ??= distanceTo(model, field, vector);\n\t\t\treturn shared;\n\t\t};\n\t\tconst ordered = collection.orderBy((model) => distance(model).asc());\n\t\treturn maxDistance === void 0 ? ordered : ordered.where((model) => distance(model).lt(maxDistance));\n\t};\n}\n/** The run-time half of `PgvectorNearestMethods`. */\nconst pgvectorNearestMethods = {\n\tid: \"pgvector/nearest\",\n\tmethodsFor: (model) => Object.fromEntries(Object.entries(model.fields).flatMap(([name, field]) => !field.many && field.type.kind === \"scalar\" && field.type.codecId === \"pg/vector@1\" ? [[`${name}_nearest`, nearestMethod(name)]] : []))\n};\n//#endregion\n//#region src/exports/runtime.ts\nconst pgvectorRuntimeDescriptor = {\n\tkind: \"extension\",\n\tid: pgvectorPackMeta.id,\n\tversion: pgvectorPackMeta.version,\n\tdataTypes: pgvectorPackMeta.dataTypes,\n\tfamilyId: \"sql\",\n\ttargetId: \"postgres\",\n\ttypes: { codecTypes: { codecDescriptors: Array.from(pgvectorCodecRegistry.values()) } },\n\tcodecs: () => Array.from(pgvectorCodecRegistry.values()),\n\tqueryOperations: () => pgvectorQueryOperations(),\n\tcollectionMethods: () => [pgvectorNearestMethods],\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"postgres\"\n\t\t};\n\t}\n};\n//#endregion\nexport { pgvectorRuntimeDescriptor as default, pgvectorCodecRegistry };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;AAKA,SAAS,WAAW,OAAO,OAAO,QAAQ;CACzC,MAAM,WAAW,UAAU,KAAK,CAAC,CAAC;CAClC,IAAI,aAAa,KAAK,GAAG,MAAM,IAAI,cAAc,2CAA2C,MAAM,GAAG;CACrG,OAAO,SAAS,eAAe,MAAM;AACtC;AACA,SAAS,cAAc,OAAO;CAC7B,QAAQ,YAAY,GAAG,SAAS;EAC/B,MAAM,CAAC,QAAQ,eAAe,UAAU,IAAI;EAC5C,IAAI;EACJ,MAAM,YAAY,UAAU;GAC3B,WAAW,WAAW,OAAO,OAAO,MAAM;GAC1C,OAAO;EACR;EACA,MAAM,UAAU,WAAW,SAAS,UAAU,SAAS,KAAK,CAAC,CAAC,IAAI,CAAC;EACnE,OAAO,gBAAgB,KAAK,IAAI,UAAU,QAAQ,OAAO,UAAU,SAAS,KAAK,CAAC,CAAC,GAAG,WAAW,CAAC;CACnG;AACD;;AAEA,MAAM,yBAAyB;CAC9B,IAAI;CACJ,aAAa,UAAU,OAAO,YAAY,OAAO,QAAQ,MAAM,MAAM,CAAC,CAAC,SAAS,CAAC,MAAM,WAAW,CAAC,MAAM,QAAQ,MAAM,KAAK,SAAS,YAAY,MAAM,KAAK,YAAY,gBAAgB,CAAC,CAAC,GAAG,KAAK,WAAW,cAAc,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACzO;AAGA,MAAM,4BAA4B;CACjC,MAAM;CACN,IAAI,iBAAiB;CACrB,SAAS,iBAAiB;CAC1B,WAAW,iBAAiB;CAC5B,UAAU;CACV,UAAU;CACV,OAAO,EAAE,YAAY,EAAE,kBAAkB,MAAM,KAAK,sBAAsB,OAAO,CAAC,EAAE,EAAE;CACtF,cAAc,MAAM,KAAK,sBAAsB,OAAO,CAAC;CACvD,uBAAuB,wBAAwB;CAC/C,yBAAyB,CAAC,sBAAsB;CAChD,SAAS;EACR,OAAO;GACN,UAAU;GACV,UAAU;EACX;CACD;AACD"}
1
+ {"version":3,"file":"runtime.mjs","names":[],"sources":["../../../../3-extensions/pgvector/dist/runtime.mjs"],"sourcesContent":["import { n as pgvectorQueryOperations, r as pgvectorCodecRegistry, t as pgvectorPackMeta } from \"./descriptor-meta-BjWk6vBJ.mjs\";\nimport \"./constants-D8Ccy-f4.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/core/nearest-collection-method.ts\nfunction distanceTo(model, field, vector) {\n\tconst accessor = blindCast(model)[field];\n\tif (accessor === void 0) throw new InternalError(`The model accessor has no vector field \"${field}\".`);\n\treturn accessor.cosineDistance(vector);\n}\nfunction nearestMethod(field) {\n\treturn (collection, ...args) => {\n\t\tconst [vector, maxDistance] = blindCast(args);\n\t\tlet shared;\n\t\tconst distance = (model) => {\n\t\t\tshared ??= distanceTo(model, field, vector);\n\t\t\treturn shared;\n\t\t};\n\t\tconst ordered = collection.orderBy((model) => distance(model).asc());\n\t\treturn maxDistance === void 0 ? ordered : ordered.where((model) => distance(model).lt(maxDistance));\n\t};\n}\n/** The run-time half of `PgvectorNearestMethods`. */\nconst pgvectorNearestMethods = {\n\tid: \"pgvector/nearest\",\n\tmethodsFor: (model) => Object.fromEntries(Object.entries(model.fields).flatMap(([name, field]) => !field.many && field.type.kind === \"scalar\" && field.type.codecId === \"pg/vector@1\" ? [[`${name}_nearest`, nearestMethod(name)]] : []))\n};\n//#endregion\n//#region src/exports/runtime.ts\nconst pgvectorRuntimeDescriptor = {\n\tkind: \"extension\",\n\tid: pgvectorPackMeta.id,\n\tversion: pgvectorPackMeta.version,\n\tdataTypes: pgvectorPackMeta.dataTypes,\n\tfamilyId: \"sql\",\n\ttargetId: \"postgres\",\n\ttypes: { codecTypes: { codecDescriptors: Array.from(pgvectorCodecRegistry.values()) } },\n\tcodecs: () => Array.from(pgvectorCodecRegistry.values()),\n\tqueryOperations: () => pgvectorQueryOperations(),\n\tcollectionMethods: () => [pgvectorNearestMethods],\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"postgres\"\n\t\t};\n\t}\n};\n//#endregion\nexport { pgvectorRuntimeDescriptor as default, pgvectorCodecRegistry };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;AAKA,SAAS,WAAW,OAAO,OAAO,QAAQ;CACzC,MAAM,WAAW,UAAU,KAAK,CAAC,CAAC;CAClC,IAAI,aAAa,KAAK,GAAG,MAAM,IAAI,cAAc,2CAA2C,MAAM,GAAG;CACrG,OAAO,SAAS,eAAe,MAAM;AACtC;AACA,SAAS,cAAc,OAAO;CAC7B,QAAQ,YAAY,GAAG,SAAS;EAC/B,MAAM,CAAC,QAAQ,eAAe,UAAU,IAAI;EAC5C,IAAI;EACJ,MAAM,YAAY,UAAU;GAC3B,WAAW,WAAW,OAAO,OAAO,MAAM;GAC1C,OAAO;EACR;EACA,MAAM,UAAU,WAAW,SAAS,UAAU,SAAS,KAAK,CAAC,CAAC,IAAI,CAAC;EACnE,OAAO,gBAAgB,KAAK,IAAI,UAAU,QAAQ,OAAO,UAAU,SAAS,KAAK,CAAC,CAAC,GAAG,WAAW,CAAC;CACnG;AACD;;AAEA,MAAM,yBAAyB;CAC9B,IAAI;CACJ,aAAa,UAAU,OAAO,YAAY,OAAO,QAAQ,MAAM,MAAM,CAAC,CAAC,SAAS,CAAC,MAAM,WAAW,CAAC,MAAM,QAAQ,MAAM,KAAK,SAAS,YAAY,MAAM,KAAK,YAAY,gBAAgB,CAAC,CAAC,GAAG,KAAK,WAAW,cAAc,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACzO;AAGA,MAAM,4BAA4B;CACjC,MAAM;CACN,IAAI,iBAAiB;CACrB,SAAS,iBAAiB;CAC1B,WAAW,iBAAiB;CAC5B,UAAU;CACV,UAAU;CACV,OAAO,EAAE,YAAY,EAAE,kBAAkB,MAAM,KAAK,sBAAsB,OAAO,CAAC,EAAE,EAAE;CACtF,cAAc,MAAM,KAAK,sBAAsB,OAAO,CAAC;CACvD,uBAAuB,wBAAwB;CAC/C,yBAAyB,CAAC,sBAAsB;CAChD,SAAS;EACR,OAAO;GACN,UAAU;GACV,UAAU;EACX;CACD;AACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/orm-extension-pgvector",
3
- "version": "8.0.0-rc.24-dev.28",
3
+ "version": "8.0.0-rc.24-dev.30",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -12,22 +12,22 @@
12
12
  "dist"
13
13
  ],
14
14
  "dependencies": {
15
- "@prisma/orm-family-sql": "8.0.0-rc.24-dev.28",
16
- "@prisma/orm-framework": "8.0.0-rc.24-dev.28",
17
- "@prisma/orm-toolchain": "8.0.0-rc.24-dev.28",
15
+ "@prisma/orm-family-sql": "8.0.0-rc.24-dev.30",
16
+ "@prisma/orm-framework": "8.0.0-rc.24-dev.30",
17
+ "@prisma/orm-toolchain": "8.0.0-rc.24-dev.30",
18
18
  "@standard-schema/spec": "^1.1.0",
19
- "arktype": "^2.2.2"
19
+ "arktype": "^2.2.9"
20
20
  },
21
21
  "devDependencies": {
22
- "@internal/extension-pgvector": "8.0.0-rc.24-dev.28",
23
- "@repo/tsconfig": "8.0.0-rc.24-dev.28",
24
- "@repo/tsdown": "8.0.0-rc.24-dev.28",
25
- "@prisma/orm-target-postgres": "8.0.0-rc.24-dev.28",
22
+ "@internal/extension-pgvector": "8.0.0-rc.24-dev.30",
23
+ "@repo/tsconfig": "8.0.0-rc.24-dev.30",
24
+ "@repo/tsdown": "8.0.0-rc.24-dev.30",
25
+ "@prisma/orm-target-postgres": "8.0.0-rc.24-dev.30",
26
26
  "tsdown": "0.22.14",
27
27
  "typescript": "5.9.3"
28
28
  },
29
29
  "peerDependencies": {
30
- "@prisma/orm-target-postgres": "8.0.0-rc.24-dev.28",
30
+ "@prisma/orm-target-postgres": "8.0.0-rc.24-dev.30",
31
31
  "typescript": ">=5.9"
32
32
  },
33
33
  "peerDependenciesMeta": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"descriptor-meta-CVuMPD3K-BuJ5TQ9Y.mjs","names":[],"sources":["../../../../3-extensions/pgvector/dist/descriptor-meta-CVuMPD3K.mjs"],"sourcesContent":["import { n as VECTOR_MAX_DIM, t as VECTOR_CODEC_ID } from \"./constants-D8Ccy-f4.mjs\";\nimport { buildOperation, codecOf, toExpr } from \"@internal/sql-relational-core/expression\";\nimport { CodecImpl, isNonFiniteText, refuseJsonValue } from \"@internal/framework-components/codec\";\nimport { sqlDataType } from \"@internal/sql-contract/data-type\";\nimport { pgInt2, pgInt4, pgInt8, pgNumeric } from \"@internal/target-postgres/data-types\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { counted } from \"@internal/utils/text\";\nimport { type } from \"arktype\";\nimport { buildCodecDescriptorRegistry } from \"@internal/sql-relational-core/codec-descriptor-registry\";\nimport { CastExpr } from \"@internal/sql-relational-core/ast\";\nimport { PostgresCodecDescriptor, definePostgresCodecs } from \"@internal/target-postgres/codec-descriptor\";\n//#region src/core/authoring.ts\nconst pgvectorAuthoringTypes = { pgvector: { Vector: {\n\tkind: \"typeConstructor\",\n\tinferred: true,\n\targs: [{\n\t\tkind: \"value\",\n\t\tdataType: \"pg/int4\",\n\t\tname: \"length\"\n\t}],\n\toutput: {\n\t\tcodecId: \"pg/vector@1\",\n\t\ttypeParams: { length: {\n\t\t\tkind: \"arg\",\n\t\t\tindex: 0\n\t\t} }\n\t}\n} } };\n//#endregion\n//#region src/core/data-types.ts\nfunction elementNumber(element) {\n\tif (typeof element === \"number\") return element;\n\tif (typeof element === \"string\" && !isNonFiniteText(element)) {\n\t\tconst converted = Number(element);\n\t\tif (Number.isFinite(converted)) return converted;\n\t}\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `A vector holds finite numbers, and ${JSON.stringify(element)} is not one.`, {\n\t\twhy: \"A vector element is a finite number; NaN and the two infinities have no place in one.\",\n\t\tfix: \"Use a finite number for every element.\"\n\t});\n}\nconst pgvectorVectorParams = type({ length: `number.integer >= 1 & number.integer <= ${VECTOR_MAX_DIM}` });\n/** A `vector(n)` value is an array of exactly `n` finite numbers, each one a `real` holds exactly. */\nfunction isFiniteNumber(element) {\n\treturn typeof element === \"number\" && Number.isFinite(element);\n}\nconst readVector = (json, params) => {\n\tconst length = typeof params[\"length\"] === \"number\" ? params[\"length\"] : void 0;\n\tconst expected = length === void 0 ? \"an array of finite numbers\" : `an array of ${counted(length, \"finite number\")}`;\n\tif (!Array.isArray(json) || length !== void 0 && json.length !== length) return refuseJsonValue(\"pgvector/vector\", expected, json);\n\tif (!json.every(isFiniteNumber)) return refuseJsonValue(\"pgvector/vector\", expected, json);\n\tfor (const [index, element] of json.entries()) {\n\t\tconst refuse = (why) => refuseJsonValue(\"pgvector/vector\", `an array of numbers real holds exactly; element ${index + 1}, ${element}, ${why}`, json);\n\t\tif (!Number.isFinite(Math.fround(element))) return refuse(\"is outside the range real holds, which PostgreSQL refuses\");\n\t\tconst stored = realText(element);\n\t\tif (Number(stored) !== element) return refuse(`would be stored as ${stored}`);\n\t}\n\treturn json;\n};\n/**\n* The text PostgreSQL prints for `value` stored as a `real`, which is what a row reads back: the shortest decimal that reads back as the same single-precision number.\n*/\nfunction realText(value) {\n\tconst single = Math.fround(value);\n\tfor (let digits = 1; digits <= 9; digits++) {\n\t\tconst text = String(Number(single.toPrecision(digits)));\n\t\tif (Math.fround(Number(text)) === single) return text;\n\t}\n\treturn String(single);\n}\nconst pgvectorVector = sqlDataType(\"pgvector/vector\", {\n\tparams: pgvectorVectorParams,\n\tread: readVector,\n\ttexts: [{\n\t\ttext: \"vector({length})\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}],\n\tlistCast: {\n\t\tof: [\n\t\t\tpgInt2.id,\n\t\t\tpgInt4.id,\n\t\t\tpgInt8.id,\n\t\t\tpgNumeric.id\n\t\t],\n\t\tcast: (elements) => elements.map(elementNumber)\n\t}\n});\nconst pgvectorDataTypes = [pgvectorVector];\n//#endregion\n//#region src/core/errors.ts\nfunction pgVectorError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/core/codecs.ts\n/**\n* pgvector extension codec.\n*\n* Mirrors the patterns in `postgres/codecs-class.ts` and `sqlite/codecs-class.ts` for the single `pg/vector@1` codec. Three artifacts:\n*\n* 1. `PgVectorCodec` extends {@link CodecImpl} with the wire and value conversions inline. Conversions are simple enough (PostgreSQL `[1,2,3]` text format) that no shared helper module is warranted; the class body is the source of truth.\n* 2. `PgVectorDescriptor` extends {@link PostgresCodecDescriptor} with the codec id, traits, the `pgvector/vector` data type and its params schema, and explicit target behavior. The column's type, `Vector<${length}>`, comes from the pack's type function in `types/codec-types.ts`. The data type declares the type's name and the bounds of `length`.\n* 3. `pgVectorColumn(length)` per-codec column helper invoking `descriptor.factory({ length })` directly.\n*\n* `length` threads into the runtime codec via the constructor so the wire methods enforce the declared dimension, and `pgvector/vector` checks it for every stored value. Without this, `vector(3)` and `vector(1536)` would produce codecs with identical behaviour and a dimension-mismatched value would round-trip undetected.\n*/\nfunction parseVector(value) {\n\tif (!value.startsWith(\"[\") || !value.endsWith(\"]\")) throw pgVectorError(\"RUNTIME.DECODE_FAILED\", `Invalid vector format: expected \"[...]\", got \"${value}\"`, {\n\t\twhy: \"The database returned a vector value that is not in the PostgreSQL \\\"[x,y,z]\\\" text format.\",\n\t\tmeta: {\n\t\t\tcodecId: VECTOR_CODEC_ID,\n\t\t\twirePreview: value\n\t\t}\n\t});\n\tconst content = value.slice(1, -1).trim();\n\treturn content === \"\" ? [] : content.split(\",\").map((entry) => {\n\t\tconst number = Number.parseFloat(entry.trim());\n\t\tif (Number.isNaN(number)) throw pgVectorError(\"RUNTIME.DECODE_FAILED\", `Invalid vector value: \"${entry}\" is not a number`, {\n\t\t\twhy: \"A vector entry returned by the database could not be parsed as a number.\",\n\t\t\tmeta: {\n\t\t\t\tcodecId: VECTOR_CODEC_ID,\n\t\t\t\twirePreview: value\n\t\t\t}\n\t\t});\n\t\treturn number;\n\t});\n}\nvar PgVectorCodec = class extends CodecImpl {\n\tlength;\n\tconstructor(descriptor, length) {\n\t\tsuper(descriptor, pgvectorVector, { length });\n\t\tthis.length = length;\n\t}\n\tassertVector(value, code) {\n\t\tconst meta = {\n\t\t\tcodecId: VECTOR_CODEC_ID,\n\t\t\texpectedLength: this.length\n\t\t};\n\t\tif (!Array.isArray(value)) throw pgVectorError(code, \"Vector value must be an array of numbers\", { meta });\n\t\tfor (const element of value) {\n\t\t\tif (typeof element !== \"number\") throw pgVectorError(code, \"Vector value must contain only numbers\", { meta });\n\t\t\tif (!Number.isFinite(element)) throw pgVectorError(code, \"Vector value must contain only finite numbers\", { meta });\n\t\t}\n\t\tif (value.length !== this.length) throw pgVectorError(code, `Vector length mismatch: expected ${this.length}, got ${value.length}`, {\n\t\t\twhy: `This column is declared as vector(${this.length}); every value must have exactly that many dimensions.`,\n\t\t\tmeta: {\n\t\t\t\t...meta,\n\t\t\t\treceivedLength: value.length\n\t\t\t}\n\t\t});\n\t}\n\tasync toWire(value, _ctx) {\n\t\tthis.assertVector(value, \"RUNTIME.ENCODE_FAILED\");\n\t\treturn `[${value.join(\",\")}]`;\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\tif (typeof wire !== \"string\") throw pgVectorError(\"RUNTIME.DECODE_FAILED\", \"Vector wire value must be a string\", { meta: { codecId: VECTOR_CODEC_ID } });\n\t\tconst value = parseVector(wire);\n\t\tthis.assertVector(value, \"RUNTIME.DECODE_FAILED\");\n\t\treturn value;\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn [...value.value];\n\t}\n\ttoDataTypeValue(input) {\n\t\tthis.assertVector(input, \"RUNTIME.ENCODE_FAILED\");\n\t\treturn this.dataTypeValueOf([...input]);\n\t}\n};\n/**\n* Projects a `vector` as the text PostgreSQL prints for it, the value the runtime driver returns for\n* an ordinary row, so `fromWire` reads an included vector as it reads a row. A JSON array of the\n* elements would not do: an element is a `real`, and the text holds the shortest decimal that\n* reads back as that `real`, so the row reads `0.1` where the element widened to a double is\n* `0.10000000149011612`.\n*/\nconst vectorTextJsonProjection = (expression) => CastExpr.as(expression, \"text\");\nvar PgVectorDescriptor = class extends PostgresCodecDescriptor {\n\tjsonType = \"array\";\n\tjsonProjection(expression) {\n\t\treturn vectorTextJsonProjection(expression);\n\t}\n\tdataType = pgvectorVector.id;\n\tcodecId = VECTOR_CODEC_ID;\n\ttraits = [\"equality\"];\n\tenumRefusal = \"The contract stores a vector member as an array of numbers, which no CHECK can list. No enum can use a vector codec; use a text enum instead.\";\n\tparamsSchema = pgvectorVectorParams;\n\tfactory(params) {\n\t\treturn () => new PgVectorCodec(this, params.length);\n\t}\n};\nconst codecDescriptorMap = { vector: new PgVectorDescriptor() };\n//#endregion\n//#region src/core/registry.ts\n/**\n* Registry of every codec descriptor shipped by `@internal/extension-pgvector`.\n*\n* Public consumer surface for the pgvector codec set. Currently a single entry (`pg/vector@1`); the registry shape stays consistent with the other codec-shipping packages so consumers don't need to special-case extensions. See ADR 208.\n*/\nconst pgvectorCodecRegistry = buildCodecDescriptorRegistry(definePostgresCodecs(Object.values(codecDescriptorMap)));\n//#endregion\n//#region src/core/descriptor-meta.ts\nconst pgvectorTypeId = \"pg/vector@1\";\nfunction pgvectorQueryOperations() {\n\treturn {\n\t\tcosineDistance: {\n\t\t\tself: { codecId: pgvectorTypeId },\n\t\t\timpl: (self, other) => {\n\t\t\t\tconst selfCodec = codecOf(self);\n\t\t\t\treturn buildOperation({\n\t\t\t\t\tmethod: \"cosineDistance\",\n\t\t\t\t\targs: [toExpr(self, selfCodec), toExpr(other, selfCodec)],\n\t\t\t\t\treturns: {\n\t\t\t\t\t\tcodecId: \"pg/float8@1\",\n\t\t\t\t\t\tnullable: false\n\t\t\t\t\t},\n\t\t\t\t\tlowering: {\n\t\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\t\ttemplate: \"{{self}} <=> {{arg0}}\"\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tcosineSimilarity: {\n\t\t\tself: { codecId: pgvectorTypeId },\n\t\t\timpl: (self, other) => {\n\t\t\t\tconst selfCodec = codecOf(self);\n\t\t\t\treturn buildOperation({\n\t\t\t\t\tmethod: \"cosineSimilarity\",\n\t\t\t\t\targs: [toExpr(self, selfCodec), toExpr(other, selfCodec)],\n\t\t\t\t\treturns: {\n\t\t\t\t\t\tcodecId: \"pg/float8@1\",\n\t\t\t\t\t\tnullable: false\n\t\t\t\t\t},\n\t\t\t\t\tlowering: {\n\t\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\t\ttemplate: \"1 - ({{self}} <=> {{arg0}})\"\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n}\nconst pgvectorPackMeta = {\n\tkind: \"extension\",\n\tid: \"pgvector\",\n\tfamilyId: \"sql\",\n\ttargetId: \"postgres\",\n\tversion: \"0.0.1\",\n\tcapabilities: { postgres: { \"pgvector.cosine\": true } },\n\tauthoring: { type: pgvectorAuthoringTypes },\n\tdataTypes: pgvectorDataTypes,\n\ttypes: {\n\t\tcodecTypes: {\n\t\t\tcodecDescriptors: Array.from(pgvectorCodecRegistry.values()),\n\t\t\timport: {\n\t\t\t\tpackage: \"@internal/extension-pgvector/codec-types\",\n\t\t\t\tnamed: \"CodecTypes\",\n\t\t\t\talias: \"PgVectorTypes\"\n\t\t\t},\n\t\t\tparameterizedOutputTypes: {\n\t\t\t\tpackage: \"@internal/extension-pgvector/codec-types\",\n\t\t\t\tnamed: \"ParameterizedOutputTypesForTypeParams\",\n\t\t\t\talias: \"PgVectorParameterizedOutputTypes\"\n\t\t\t}\n\t\t},\n\t\toperationTypes: { import: {\n\t\t\tpackage: \"@internal/extension-pgvector/operation-types\",\n\t\t\tnamed: \"OperationTypes\",\n\t\t\talias: \"PgVectorOperationTypes\"\n\t\t} },\n\t\tqueryOperationTypes: { import: {\n\t\t\tpackage: \"@internal/extension-pgvector/operation-types\",\n\t\t\tnamed: \"QueryOperationTypes\",\n\t\t\talias: \"PgVectorQueryOperationTypes\"\n\t\t} }\n\t}\n};\n//#endregion\nexport { pgvectorQueryOperations as n, pgvectorCodecRegistry as r, pgvectorPackMeta as t };\n\n//# sourceMappingURL=descriptor-meta-CVuMPD3K.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,MAAM,yBAAyB,EAAE,UAAU,EAAE,QAAQ;CACpD,MAAM;CACN,UAAU;CACV,MAAM,CAAC;EACN,MAAM;EACN,UAAU;EACV,MAAM;CACP,CAAC;CACD,QAAQ;EACP,SAAS;EACT,YAAY,EAAE,QAAQ;GACrB,MAAM;GACN,OAAO;EACR,EAAE;CACH;AACD,EAAE,EAAE;AAGJ,SAAS,cAAc,SAAS;CAC/B,IAAI,OAAO,YAAY,UAAU,OAAO;CACxC,IAAI,OAAO,YAAY,YAAY,CAAC,gBAAgB,OAAO,GAAG;EAC7D,MAAM,YAAY,OAAO,OAAO;EAChC,IAAI,OAAO,SAAS,SAAS,GAAG,OAAO;CACxC;CACA,MAAM,gBAAgB,yBAAyB,sCAAsC,KAAK,UAAU,OAAO,EAAE,eAAe;EAC3H,KAAK;EACL,KAAK;CACN,CAAC;AACF;AACA,MAAM,uBAAuB,KAAK,EAAE,QAAQ,2CAA2C,iBAAiB,CAAC;;AAEzG,SAAS,eAAe,SAAS;CAChC,OAAO,OAAO,YAAY,YAAY,OAAO,SAAS,OAAO;AAC9D;AACA,MAAM,cAAc,MAAM,WAAW;CACpC,MAAM,SAAS,OAAO,OAAO,cAAc,WAAW,OAAO,YAAY,KAAK;CAC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