@prisma-next/extension-pgvector 0.3.0-dev.115 → 0.3.0-dev.122
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 +16 -2
- package/dist/control.mjs +2 -2
- package/dist/control.mjs.map +1 -1
- package/dist/{descriptor-meta-DKfA8aF2.mjs → descriptor-meta-IXkObAr0.mjs} +45 -9
- package/dist/descriptor-meta-IXkObAr0.mjs.map +1 -0
- package/dist/operation-types.d.mts +27 -0
- package/dist/operation-types.d.mts.map +1 -1
- package/dist/pack.mjs +1 -1
- package/dist/runtime.mjs +2 -2
- package/dist/runtime.mjs.map +1 -1
- package/package.json +16 -16
- package/src/core/descriptor-meta.ts +32 -6
- package/src/exports/control.ts +2 -2
- package/src/exports/runtime.ts +2 -2
- package/src/types/operation-types.ts +23 -0
- package/dist/descriptor-meta-DKfA8aF2.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -154,6 +154,7 @@ The extension provides an `OperationTypes` export for vector operations:
|
|
|
154
154
|
import type { OperationTypes } from '@prisma-next/extension-pgvector/operation-types';
|
|
155
155
|
|
|
156
156
|
// OperationTypes['pg/vector@1']['cosineDistance'] = (rhs: number[] | vector) => number
|
|
157
|
+
// OperationTypes['pg/vector@1']['cosineSimilarity'] = (rhs: number[] | vector) => number
|
|
157
158
|
```
|
|
158
159
|
|
|
159
160
|
## Operations
|
|
@@ -164,18 +165,31 @@ Computes the cosine distance between two vectors.
|
|
|
164
165
|
|
|
165
166
|
**Signature**: `cosineDistance(rhs: number[] | vector): number`
|
|
166
167
|
|
|
167
|
-
**SQL**: Uses the pgvector `<=>` operator: `
|
|
168
|
+
**SQL**: Uses the pgvector `<=>` operator: `vector1 <=> vector2`
|
|
168
169
|
|
|
169
170
|
**Example**:
|
|
170
171
|
```typescript
|
|
171
172
|
const distance = tables.post.columns.embedding.cosineDistance(param('queryVector'));
|
|
172
173
|
```
|
|
173
174
|
|
|
175
|
+
### cosineSimilarity
|
|
176
|
+
|
|
177
|
+
Computes the cosine similarity between two vectors (1 minus cosine distance).
|
|
178
|
+
|
|
179
|
+
**Signature**: `cosineSimilarity(rhs: number[] | vector): number`
|
|
180
|
+
|
|
181
|
+
**SQL**: Uses the pgvector `<=>` operator: `1 - (vector1 <=> vector2)`
|
|
182
|
+
|
|
183
|
+
**Example**:
|
|
184
|
+
```typescript
|
|
185
|
+
const similarity = tables.post.columns.embedding.cosineSimilarity(param('queryVector'));
|
|
186
|
+
```
|
|
187
|
+
|
|
174
188
|
## Capabilities
|
|
175
189
|
|
|
176
190
|
The extension declares the following capabilities:
|
|
177
191
|
|
|
178
|
-
- `pgvector/cosine`: Indicates support for cosine distance operations
|
|
192
|
+
- `pgvector/cosine`: Indicates support for cosine distance and similarity operations
|
|
179
193
|
|
|
180
194
|
## References
|
|
181
195
|
|
package/dist/control.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as pgvectorPackMeta, t as
|
|
1
|
+
import { n as pgvectorPackMeta, t as pgvectorOperationSignatures } from "./descriptor-meta-IXkObAr0.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/exports/control.ts
|
|
4
4
|
const PGVECTOR_CODEC_ID = "pg/vector@1";
|
|
@@ -47,7 +47,7 @@ const pgvectorExtensionDescriptor = {
|
|
|
47
47
|
controlPlaneHooks: { [PGVECTOR_CODEC_ID]: vectorControlPlaneHooks }
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
|
-
operationSignatures: () =>
|
|
50
|
+
operationSignatures: () => pgvectorOperationSignatures,
|
|
51
51
|
databaseDependencies: pgvectorDatabaseDependencies,
|
|
52
52
|
create: () => ({
|
|
53
53
|
familyId: "sql",
|
package/dist/control.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.mjs","names":["vectorControlPlaneHooks: CodecControlHooks","pgvectorDatabaseDependencies: ComponentDatabaseDependencies<unknown>","pgvectorExtensionDescriptor: SqlControlExtensionDescriptor<'postgres'>"],"sources":["../src/exports/control.ts"],"sourcesContent":["import type {\n CodecControlHooks,\n ComponentDatabaseDependencies,\n SqlControlExtensionDescriptor,\n} from '@prisma-next/family-sql/control';\nimport {
|
|
1
|
+
{"version":3,"file":"control.mjs","names":["vectorControlPlaneHooks: CodecControlHooks","pgvectorDatabaseDependencies: ComponentDatabaseDependencies<unknown>","pgvectorExtensionDescriptor: SqlControlExtensionDescriptor<'postgres'>"],"sources":["../src/exports/control.ts"],"sourcesContent":["import type {\n CodecControlHooks,\n ComponentDatabaseDependencies,\n SqlControlExtensionDescriptor,\n} from '@prisma-next/family-sql/control';\nimport { pgvectorOperationSignatures, pgvectorPackMeta } from '../core/descriptor-meta';\n\nconst PGVECTOR_CODEC_ID = 'pg/vector@1' as const;\n\nfunction buildVectorIdentityValue(typeParams: Record<string, unknown> | undefined): string | null {\n const length = typeParams?.['length'];\n if (typeof length !== 'number' || !Number.isInteger(length) || length <= 0) {\n return null;\n }\n\n const zeroVector = `[${new Array(length).fill('0').join(',')}]`;\n return `'${zeroVector}'::vector`;\n}\n\nconst vectorControlPlaneHooks: CodecControlHooks = {\n expandNativeType: ({ nativeType, typeParams }) => {\n const length = typeParams?.['length'];\n if (typeof length === 'number' && Number.isInteger(length) && length > 0) {\n return `${nativeType}(${length})`;\n }\n return nativeType;\n },\n resolveIdentityValue: ({ typeParams }) => buildVectorIdentityValue(typeParams),\n};\n\nconst pgvectorDatabaseDependencies: ComponentDatabaseDependencies<unknown> = {\n init: [\n {\n id: 'postgres.extension.vector',\n label: 'Enable vector extension',\n install: [\n {\n id: 'extension.vector',\n label: 'Enable extension \"vector\"',\n summary: 'Ensures the vector extension is available for pgvector operations',\n operationClass: 'additive',\n target: { id: 'postgres' },\n precheck: [\n {\n description: 'verify extension \"vector\" is not already enabled',\n sql: \"SELECT NOT EXISTS (SELECT 1 FROM pg_extension WHERE extname = 'vector')\",\n },\n ],\n execute: [\n {\n description: 'create extension \"vector\"',\n sql: 'CREATE EXTENSION IF NOT EXISTS vector',\n },\n ],\n postcheck: [\n {\n description: 'confirm extension \"vector\" is enabled',\n sql: \"SELECT EXISTS (SELECT 1 FROM pg_extension WHERE extname = 'vector')\",\n },\n ],\n },\n ],\n },\n ],\n};\n\nconst pgvectorExtensionDescriptor: SqlControlExtensionDescriptor<'postgres'> = {\n ...pgvectorPackMeta,\n types: {\n ...pgvectorPackMeta.types,\n codecTypes: {\n ...pgvectorPackMeta.types.codecTypes,\n controlPlaneHooks: {\n [PGVECTOR_CODEC_ID]: vectorControlPlaneHooks,\n },\n },\n },\n operationSignatures: () => pgvectorOperationSignatures,\n databaseDependencies: pgvectorDatabaseDependencies,\n create: () => ({\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n }),\n};\n\nexport { pgvectorExtensionDescriptor };\nexport default pgvectorExtensionDescriptor;\n"],"mappings":";;;AAOA,MAAM,oBAAoB;AAE1B,SAAS,yBAAyB,YAAgE;CAChG,MAAM,SAAS,aAAa;AAC5B,KAAI,OAAO,WAAW,YAAY,CAAC,OAAO,UAAU,OAAO,IAAI,UAAU,EACvE,QAAO;AAIT,QAAO,IADY,IAAI,IAAI,MAAM,OAAO,CAAC,KAAK,IAAI,CAAC,KAAK,IAAI,CAAC,GACvC;;AAGxB,MAAMA,0BAA6C;CACjD,mBAAmB,EAAE,YAAY,iBAAiB;EAChD,MAAM,SAAS,aAAa;AAC5B,MAAI,OAAO,WAAW,YAAY,OAAO,UAAU,OAAO,IAAI,SAAS,EACrE,QAAO,GAAG,WAAW,GAAG,OAAO;AAEjC,SAAO;;CAET,uBAAuB,EAAE,iBAAiB,yBAAyB,WAAW;CAC/E;AAED,MAAMC,+BAAuE,EAC3E,MAAM,CACJ;CACE,IAAI;CACJ,OAAO;CACP,SAAS,CACP;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,gBAAgB;EAChB,QAAQ,EAAE,IAAI,YAAY;EAC1B,UAAU,CACR;GACE,aAAa;GACb,KAAK;GACN,CACF;EACD,SAAS,CACP;GACE,aAAa;GACb,KAAK;GACN,CACF;EACD,WAAW,CACT;GACE,aAAa;GACb,KAAK;GACN,CACF;EACF,CACF;CACF,CACF,EACF;AAED,MAAMC,8BAAyE;CAC7E,GAAG;CACH,OAAO;EACL,GAAG,iBAAiB;EACpB,YAAY;GACV,GAAG,iBAAiB,MAAM;GAC1B,mBAAmB,GAChB,oBAAoB,yBACtB;GACF;EACF;CACD,2BAA2B;CAC3B,sBAAsB;CACtB,eAAe;EACb,UAAU;EACV,UAAU;EACX;CACF;AAGD,sBAAe"}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
//#region src/core/descriptor-meta.ts
|
|
2
2
|
const pgvectorTypeId = "pg/vector@1";
|
|
3
|
+
const cosineDistanceLowering = {
|
|
4
|
+
targetFamily: "sql",
|
|
5
|
+
strategy: "function",
|
|
6
|
+
template: "{{self}} <=> {{arg0}}"
|
|
7
|
+
};
|
|
8
|
+
const cosineSimilarityLowering = {
|
|
9
|
+
targetFamily: "sql",
|
|
10
|
+
strategy: "function",
|
|
11
|
+
template: "1 - ({{self}} <=> {{arg0}})"
|
|
12
|
+
};
|
|
3
13
|
const cosineDistanceOperation = Object.freeze({
|
|
4
14
|
method: "cosineDistance",
|
|
5
15
|
args: [{ kind: "param" }],
|
|
@@ -7,16 +17,24 @@ const cosineDistanceOperation = Object.freeze({
|
|
|
7
17
|
kind: "builtin",
|
|
8
18
|
type: "number"
|
|
9
19
|
},
|
|
10
|
-
lowering:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
20
|
+
lowering: cosineDistanceLowering
|
|
21
|
+
});
|
|
22
|
+
const cosineSimilarityOperation = Object.freeze({
|
|
23
|
+
method: "cosineSimilarity",
|
|
24
|
+
args: [{ kind: "param" }],
|
|
25
|
+
returns: {
|
|
26
|
+
kind: "builtin",
|
|
27
|
+
type: "number"
|
|
28
|
+
},
|
|
29
|
+
lowering: cosineSimilarityLowering
|
|
15
30
|
});
|
|
16
|
-
const
|
|
31
|
+
const pgvectorOperationSignatures = [{
|
|
17
32
|
forTypeId: pgvectorTypeId,
|
|
18
33
|
...cosineDistanceOperation
|
|
19
|
-
}
|
|
34
|
+
}, {
|
|
35
|
+
forTypeId: pgvectorTypeId,
|
|
36
|
+
...cosineSimilarityOperation
|
|
37
|
+
}];
|
|
20
38
|
const pgvectorQueryOperations = [{
|
|
21
39
|
method: "cosineDistance",
|
|
22
40
|
args: [{
|
|
@@ -30,6 +48,24 @@ const pgvectorQueryOperations = [{
|
|
|
30
48
|
codecId: "pg/float8@1",
|
|
31
49
|
nullable: false
|
|
32
50
|
},
|
|
51
|
+
lowering: {
|
|
52
|
+
targetFamily: "sql",
|
|
53
|
+
strategy: "function",
|
|
54
|
+
template: "{{self}} <=> {{arg0}}"
|
|
55
|
+
}
|
|
56
|
+
}, {
|
|
57
|
+
method: "cosineSimilarity",
|
|
58
|
+
args: [{
|
|
59
|
+
codecId: pgvectorTypeId,
|
|
60
|
+
nullable: false
|
|
61
|
+
}, {
|
|
62
|
+
codecId: pgvectorTypeId,
|
|
63
|
+
nullable: false
|
|
64
|
+
}],
|
|
65
|
+
returns: {
|
|
66
|
+
codecId: "pg/float8@1",
|
|
67
|
+
nullable: false
|
|
68
|
+
},
|
|
33
69
|
lowering: {
|
|
34
70
|
targetFamily: "sql",
|
|
35
71
|
strategy: "function",
|
|
@@ -77,5 +113,5 @@ const pgvectorPackMeta = {
|
|
|
77
113
|
};
|
|
78
114
|
|
|
79
115
|
//#endregion
|
|
80
|
-
export { pgvectorPackMeta as n, pgvectorQueryOperations as r,
|
|
81
|
-
//# sourceMappingURL=descriptor-meta-
|
|
116
|
+
export { pgvectorPackMeta as n, pgvectorQueryOperations as r, pgvectorOperationSignatures as t };
|
|
117
|
+
//# sourceMappingURL=descriptor-meta-IXkObAr0.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptor-meta-IXkObAr0.mjs","names":["pgvectorOperationSignatures: readonly SqlOperationSignature[]","pgvectorQueryOperations: readonly QueryOperationDescriptor[]"],"sources":["../src/core/descriptor-meta.ts"],"sourcesContent":["import type { SqlOperationSignature } from '@prisma-next/sql-operations';\nimport type { QueryOperationDescriptor } from '@prisma-next/sql-relational-core/query-operations';\n\nconst pgvectorTypeId = 'pg/vector@1' as const;\n\nconst cosineDistanceLowering = {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} <=> {{arg0}}',\n} as const;\n\nconst cosineSimilarityLowering = {\n targetFamily: 'sql',\n strategy: 'function',\n template: '1 - ({{self}} <=> {{arg0}})',\n} as const;\n\nconst cosineDistanceOperation = Object.freeze({\n method: 'cosineDistance',\n args: [{ kind: 'param' }],\n returns: { kind: 'builtin', type: 'number' },\n lowering: cosineDistanceLowering,\n} as const);\n\nconst cosineSimilarityOperation = Object.freeze({\n method: 'cosineSimilarity',\n args: [{ kind: 'param' }],\n returns: { kind: 'builtin', type: 'number' },\n lowering: cosineSimilarityLowering,\n} as const);\n\nexport const pgvectorOperationSignatures: readonly SqlOperationSignature[] = [\n { forTypeId: pgvectorTypeId, ...cosineDistanceOperation },\n { forTypeId: pgvectorTypeId, ...cosineSimilarityOperation },\n];\n\nexport const pgvectorQueryOperations: readonly QueryOperationDescriptor[] = [\n {\n method: 'cosineDistance',\n args: [\n { codecId: pgvectorTypeId, nullable: false },\n { codecId: pgvectorTypeId, nullable: false },\n ],\n returns: { codecId: 'pg/float8@1', nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} <=> {{arg0}}',\n },\n },\n {\n method: 'cosineSimilarity',\n args: [\n { codecId: pgvectorTypeId, nullable: false },\n { codecId: pgvectorTypeId, nullable: false },\n ],\n returns: { codecId: 'pg/float8@1', nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '1 - ({{self}} <=> {{arg0}})',\n },\n },\n];\n\nexport const pgvectorPackMeta = {\n kind: 'extension',\n id: 'pgvector',\n familyId: 'sql',\n targetId: 'postgres',\n version: '0.0.1',\n capabilities: {\n postgres: {\n 'pgvector/cosine': true,\n },\n },\n types: {\n codecTypes: {\n import: {\n package: '@prisma-next/extension-pgvector/codec-types',\n named: 'CodecTypes',\n alias: 'PgVectorTypes',\n },\n typeImports: [\n {\n package: '@prisma-next/extension-pgvector/codec-types',\n named: 'Vector',\n alias: 'Vector',\n },\n ],\n parameterized: {\n [pgvectorTypeId]: 'Vector<{{length}}>',\n },\n },\n operationTypes: {\n import: {\n package: '@prisma-next/extension-pgvector/operation-types',\n named: 'OperationTypes',\n alias: 'PgVectorOperationTypes',\n },\n },\n queryOperationTypes: {\n import: {\n package: '@prisma-next/extension-pgvector/operation-types',\n named: 'QueryOperationTypes',\n alias: 'PgVectorQueryOperationTypes',\n },\n },\n storage: [\n { typeId: pgvectorTypeId, familyId: 'sql', targetId: 'postgres', nativeType: 'vector' },\n ],\n },\n} as const;\n"],"mappings":";AAGA,MAAM,iBAAiB;AAEvB,MAAM,yBAAyB;CAC7B,cAAc;CACd,UAAU;CACV,UAAU;CACX;AAED,MAAM,2BAA2B;CAC/B,cAAc;CACd,UAAU;CACV,UAAU;CACX;AAED,MAAM,0BAA0B,OAAO,OAAO;CAC5C,QAAQ;CACR,MAAM,CAAC,EAAE,MAAM,SAAS,CAAC;CACzB,SAAS;EAAE,MAAM;EAAW,MAAM;EAAU;CAC5C,UAAU;CACX,CAAU;AAEX,MAAM,4BAA4B,OAAO,OAAO;CAC9C,QAAQ;CACR,MAAM,CAAC,EAAE,MAAM,SAAS,CAAC;CACzB,SAAS;EAAE,MAAM;EAAW,MAAM;EAAU;CAC5C,UAAU;CACX,CAAU;AAEX,MAAaA,8BAAgE,CAC3E;CAAE,WAAW;CAAgB,GAAG;CAAyB,EACzD;CAAE,WAAW;CAAgB,GAAG;CAA2B,CAC5D;AAED,MAAaC,0BAA+D,CAC1E;CACE,QAAQ;CACR,MAAM,CACJ;EAAE,SAAS;EAAgB,UAAU;EAAO,EAC5C;EAAE,SAAS;EAAgB,UAAU;EAAO,CAC7C;CACD,SAAS;EAAE,SAAS;EAAe,UAAU;EAAO;CACpD,UAAU;EACR,cAAc;EACd,UAAU;EACV,UAAU;EACX;CACF,EACD;CACE,QAAQ;CACR,MAAM,CACJ;EAAE,SAAS;EAAgB,UAAU;EAAO,EAC5C;EAAE,SAAS;EAAgB,UAAU;EAAO,CAC7C;CACD,SAAS;EAAE,SAAS;EAAe,UAAU;EAAO;CACpD,UAAU;EACR,cAAc;EACd,UAAU;EACV,UAAU;EACX;CACF,CACF;AAED,MAAa,mBAAmB;CAC9B,MAAM;CACN,IAAI;CACJ,UAAU;CACV,UAAU;CACV,SAAS;CACT,cAAc,EACZ,UAAU,EACR,mBAAmB,MACpB,EACF;CACD,OAAO;EACL,YAAY;GACV,QAAQ;IACN,SAAS;IACT,OAAO;IACP,OAAO;IACR;GACD,aAAa,CACX;IACE,SAAS;IACT,OAAO;IACP,OAAO;IACR,CACF;GACD,eAAe,GACZ,iBAAiB,sBACnB;GACF;EACD,gBAAgB,EACd,QAAQ;GACN,SAAS;GACT,OAAO;GACP,OAAO;GACR,EACF;EACD,qBAAqB,EACnB,QAAQ;GACN,SAAS;GACT,OAAO;GACP,OAAO;GACR,EACF;EACD,SAAS,CACP;GAAE,QAAQ;GAAgB,UAAU;GAAO,UAAU;GAAY,YAAY;GAAU,CACxF;EACF;CACF"}
|
|
@@ -28,6 +28,20 @@ type OperationTypes = {
|
|
|
28
28
|
readonly template: string;
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
|
+
readonly cosineSimilarity: {
|
|
32
|
+
readonly args: readonly [{
|
|
33
|
+
readonly kind: 'param';
|
|
34
|
+
}];
|
|
35
|
+
readonly returns: {
|
|
36
|
+
readonly kind: 'builtin';
|
|
37
|
+
readonly type: 'number';
|
|
38
|
+
};
|
|
39
|
+
readonly lowering: {
|
|
40
|
+
readonly targetFamily: 'sql';
|
|
41
|
+
readonly strategy: 'function';
|
|
42
|
+
readonly template: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
31
45
|
};
|
|
32
46
|
};
|
|
33
47
|
/** Flat operation signatures for the query builder. */
|
|
@@ -45,6 +59,19 @@ type QueryOperationTypes = SqlQueryOperationTypes<{
|
|
|
45
59
|
readonly nullable: false;
|
|
46
60
|
};
|
|
47
61
|
};
|
|
62
|
+
readonly cosineSimilarity: {
|
|
63
|
+
readonly args: readonly [{
|
|
64
|
+
readonly codecId: 'pg/vector@1';
|
|
65
|
+
readonly nullable: boolean;
|
|
66
|
+
}, {
|
|
67
|
+
readonly codecId: 'pg/vector@1';
|
|
68
|
+
readonly nullable: boolean;
|
|
69
|
+
}];
|
|
70
|
+
readonly returns: {
|
|
71
|
+
readonly codecId: 'pg/float8@1';
|
|
72
|
+
readonly nullable: false;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
48
75
|
}>;
|
|
49
76
|
//#endregion
|
|
50
77
|
export { type OperationTypes, type QueryOperationTypes };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-types.d.mts","names":[],"sources":["../src/types/operation-types.ts"],"sourcesContent":[],"mappings":";;;;;;AAaA;
|
|
1
|
+
{"version":3,"file":"operation-types.d.mts","names":[],"sources":["../src/types/operation-types.ts"],"sourcesContent":[],"mappings":";;;;;;AAaA;AAsCA;;;;;;;KAtCY,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAsCA,mBAAA,GAAsB"}
|
package/dist/pack.mjs
CHANGED
package/dist/runtime.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as pgvectorPackMeta, r as pgvectorQueryOperations, t as
|
|
1
|
+
import { n as pgvectorPackMeta, r as pgvectorQueryOperations, t as pgvectorOperationSignatures } from "./descriptor-meta-IXkObAr0.mjs";
|
|
2
2
|
import { n as VECTOR_MAX_DIM, t as VECTOR_CODEC_ID } from "./constants-BmZpaev5.mjs";
|
|
3
3
|
import { codec, createCodecRegistry, defineCodecs } from "@prisma-next/sql-relational-core/ast";
|
|
4
4
|
import { type } from "arktype";
|
|
@@ -59,7 +59,7 @@ const pgvectorRuntimeDescriptor = {
|
|
|
59
59
|
familyId: "sql",
|
|
60
60
|
targetId: "postgres",
|
|
61
61
|
codecs: createPgvectorCodecRegistry,
|
|
62
|
-
operationSignatures: () =>
|
|
62
|
+
operationSignatures: () => pgvectorOperationSignatures,
|
|
63
63
|
queryOperations: () => pgvectorQueryOperations,
|
|
64
64
|
parameterizedCodecs: () => parameterizedCodecDescriptors,
|
|
65
65
|
create() {
|
package/dist/runtime.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.mjs","names":["arktype","pgvectorRuntimeDescriptor: SqlRuntimeExtensionDescriptor<'postgres'>"],"sources":["../src/core/codecs.ts","../src/exports/runtime.ts"],"sourcesContent":["/**\n * Vector codec implementation for pgvector extension.\n *\n * Provides encoding/decoding for the `vector` PostgreSQL type.\n * Wire format is a string like `[1,2,3]` (PostgreSQL vector text format).\n */\n\nimport { codec, defineCodecs } from '@prisma-next/sql-relational-core/ast';\n\nconst pgVectorCodec = codec({\n typeId: 'pg/vector@1',\n targetTypes: ['vector'],\n traits: ['equality'],\n encode: (value: number[]): string => {\n // Validate that value is an array of numbers\n if (!Array.isArray(value)) {\n throw new Error('Vector value must be an array of numbers');\n }\n if (!value.every((v) => typeof v === 'number')) {\n throw new Error('Vector value must contain only numbers');\n }\n // Format as PostgreSQL vector text format: [1,2,3]\n // PostgreSQL's pg library requires the vector format string\n return `[${value.join(',')}]`;\n },\n decode: (wire: string): number[] => {\n // Handle string format from PostgreSQL: [1,2,3]\n if (typeof wire !== 'string') {\n throw new Error('Vector wire value must be a string');\n }\n // Parse PostgreSQL vector format: [1,2,3]\n if (!wire.startsWith('[') || !wire.endsWith(']')) {\n throw new Error(`Invalid vector format: expected \"[...]\", got \"${wire}\"`);\n }\n const content = wire.slice(1, -1).trim();\n if (content === '') {\n return [];\n }\n const values = content.split(',').map((v) => {\n const num = Number.parseFloat(v.trim());\n if (Number.isNaN(num)) {\n throw new Error(`Invalid vector value: \"${v}\" is not a number`);\n }\n return num;\n });\n return values;\n },\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'vector',\n },\n },\n },\n },\n});\n\n// Build codec definitions using the builder DSL\nconst codecs = defineCodecs().add('vector', pgVectorCodec);\n\n// Export derived structures directly from codecs builder\nexport const codecDefinitions = codecs.codecDefinitions;\nexport const dataTypes = codecs.dataTypes;\n\n// Export types derived from codecs builder\nexport type CodecTypes = typeof codecs.CodecTypes;\n","import { createCodecRegistry } from '@prisma-next/sql-relational-core/ast';\nimport type {\n RuntimeParameterizedCodecDescriptor,\n SqlRuntimeExtensionDescriptor,\n} from '@prisma-next/sql-runtime';\nimport { type as arktype } from 'arktype';\nimport { codecDefinitions } from '../core/codecs';\nimport { VECTOR_CODEC_ID, VECTOR_MAX_DIM } from '../core/constants';\nimport {\n
|
|
1
|
+
{"version":3,"file":"runtime.mjs","names":["arktype","pgvectorRuntimeDescriptor: SqlRuntimeExtensionDescriptor<'postgres'>"],"sources":["../src/core/codecs.ts","../src/exports/runtime.ts"],"sourcesContent":["/**\n * Vector codec implementation for pgvector extension.\n *\n * Provides encoding/decoding for the `vector` PostgreSQL type.\n * Wire format is a string like `[1,2,3]` (PostgreSQL vector text format).\n */\n\nimport { codec, defineCodecs } from '@prisma-next/sql-relational-core/ast';\n\nconst pgVectorCodec = codec({\n typeId: 'pg/vector@1',\n targetTypes: ['vector'],\n traits: ['equality'],\n encode: (value: number[]): string => {\n // Validate that value is an array of numbers\n if (!Array.isArray(value)) {\n throw new Error('Vector value must be an array of numbers');\n }\n if (!value.every((v) => typeof v === 'number')) {\n throw new Error('Vector value must contain only numbers');\n }\n // Format as PostgreSQL vector text format: [1,2,3]\n // PostgreSQL's pg library requires the vector format string\n return `[${value.join(',')}]`;\n },\n decode: (wire: string): number[] => {\n // Handle string format from PostgreSQL: [1,2,3]\n if (typeof wire !== 'string') {\n throw new Error('Vector wire value must be a string');\n }\n // Parse PostgreSQL vector format: [1,2,3]\n if (!wire.startsWith('[') || !wire.endsWith(']')) {\n throw new Error(`Invalid vector format: expected \"[...]\", got \"${wire}\"`);\n }\n const content = wire.slice(1, -1).trim();\n if (content === '') {\n return [];\n }\n const values = content.split(',').map((v) => {\n const num = Number.parseFloat(v.trim());\n if (Number.isNaN(num)) {\n throw new Error(`Invalid vector value: \"${v}\" is not a number`);\n }\n return num;\n });\n return values;\n },\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'vector',\n },\n },\n },\n },\n});\n\n// Build codec definitions using the builder DSL\nconst codecs = defineCodecs().add('vector', pgVectorCodec);\n\n// Export derived structures directly from codecs builder\nexport const codecDefinitions = codecs.codecDefinitions;\nexport const dataTypes = codecs.dataTypes;\n\n// Export types derived from codecs builder\nexport type CodecTypes = typeof codecs.CodecTypes;\n","import { createCodecRegistry } from '@prisma-next/sql-relational-core/ast';\nimport type {\n RuntimeParameterizedCodecDescriptor,\n SqlRuntimeExtensionDescriptor,\n} from '@prisma-next/sql-runtime';\nimport { type as arktype } from 'arktype';\nimport { codecDefinitions } from '../core/codecs';\nimport { VECTOR_CODEC_ID, VECTOR_MAX_DIM } from '../core/constants';\nimport {\n pgvectorOperationSignatures,\n pgvectorPackMeta,\n pgvectorQueryOperations,\n} from '../core/descriptor-meta';\n\nconst vectorParamsSchema = arktype({\n length: 'number',\n}).narrow((params, ctx) => {\n const { length } = params;\n if (!Number.isInteger(length)) {\n return ctx.mustBe('an integer');\n }\n if (length < 1 || length > VECTOR_MAX_DIM) {\n return ctx.mustBe(`in the range [1, ${VECTOR_MAX_DIM}]`);\n }\n return true;\n});\n\nconst parameterizedCodecDescriptors = [\n {\n codecId: VECTOR_CODEC_ID,\n paramsSchema: vectorParamsSchema,\n },\n] as const satisfies ReadonlyArray<\n RuntimeParameterizedCodecDescriptor<{ readonly length: number }>\n>;\n\nfunction createPgvectorCodecRegistry() {\n const registry = createCodecRegistry();\n for (const def of Object.values(codecDefinitions)) {\n registry.register(def.codec);\n }\n return registry;\n}\n\nconst pgvectorRuntimeDescriptor: SqlRuntimeExtensionDescriptor<'postgres'> = {\n kind: 'extension' as const,\n id: pgvectorPackMeta.id,\n version: pgvectorPackMeta.version,\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n codecs: createPgvectorCodecRegistry,\n operationSignatures: () => pgvectorOperationSignatures,\n queryOperations: () => pgvectorQueryOperations,\n parameterizedCodecs: () => parameterizedCodecDescriptors,\n create() {\n return {\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n };\n },\n};\n\nexport default pgvectorRuntimeDescriptor;\n"],"mappings":";;;;;;;;;;;;AASA,MAAM,gBAAgB,MAAM;CAC1B,QAAQ;CACR,aAAa,CAAC,SAAS;CACvB,QAAQ,CAAC,WAAW;CACpB,SAAS,UAA4B;AAEnC,MAAI,CAAC,MAAM,QAAQ,MAAM,CACvB,OAAM,IAAI,MAAM,2CAA2C;AAE7D,MAAI,CAAC,MAAM,OAAO,MAAM,OAAO,MAAM,SAAS,CAC5C,OAAM,IAAI,MAAM,yCAAyC;AAI3D,SAAO,IAAI,MAAM,KAAK,IAAI,CAAC;;CAE7B,SAAS,SAA2B;AAElC,MAAI,OAAO,SAAS,SAClB,OAAM,IAAI,MAAM,qCAAqC;AAGvD,MAAI,CAAC,KAAK,WAAW,IAAI,IAAI,CAAC,KAAK,SAAS,IAAI,CAC9C,OAAM,IAAI,MAAM,iDAAiD,KAAK,GAAG;EAE3E,MAAM,UAAU,KAAK,MAAM,GAAG,GAAG,CAAC,MAAM;AACxC,MAAI,YAAY,GACd,QAAO,EAAE;AASX,SAPe,QAAQ,MAAM,IAAI,CAAC,KAAK,MAAM;GAC3C,MAAM,MAAM,OAAO,WAAW,EAAE,MAAM,CAAC;AACvC,OAAI,OAAO,MAAM,IAAI,CACnB,OAAM,IAAI,MAAM,0BAA0B,EAAE,mBAAmB;AAEjE,UAAO;IACP;;CAGJ,MAAM,EACJ,IAAI,EACF,KAAK,EACH,UAAU,EACR,YAAY,UACb,EACF,EACF,EACF;CACF,CAAC;AAGF,MAAM,SAAS,cAAc,CAAC,IAAI,UAAU,cAAc;AAG1D,MAAa,mBAAmB,OAAO;AACvC,MAAa,YAAY,OAAO;;;;ACpChC,MAAM,gCAAgC,CACpC;CACE,SAAS;CACT,cAhBuBA,KAAQ,EACjC,QAAQ,UACT,CAAC,CAAC,QAAQ,QAAQ,QAAQ;EACzB,MAAM,EAAE,WAAW;AACnB,MAAI,CAAC,OAAO,UAAU,OAAO,CAC3B,QAAO,IAAI,OAAO,aAAa;AAEjC,MAAI,SAAS,KAAK,SAAS,eACzB,QAAO,IAAI,OAAO,oBAAoB,eAAe,GAAG;AAE1D,SAAO;GACP;CAMC,CACF;AAID,SAAS,8BAA8B;CACrC,MAAM,WAAW,qBAAqB;AACtC,MAAK,MAAM,OAAO,OAAO,OAAO,iBAAiB,CAC/C,UAAS,SAAS,IAAI,MAAM;AAE9B,QAAO;;AAGT,MAAMC,4BAAuE;CAC3E,MAAM;CACN,IAAI,iBAAiB;CACrB,SAAS,iBAAiB;CAC1B,UAAU;CACV,UAAU;CACV,QAAQ;CACR,2BAA2B;CAC3B,uBAAuB;CACvB,2BAA2B;CAC3B,SAAS;AACP,SAAO;GACL,UAAU;GACV,UAAU;GACX;;CAEJ;AAED,sBAAe"}
|
package/package.json
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/extension-pgvector",
|
|
3
|
-
"version": "0.3.0-dev.
|
|
3
|
+
"version": "0.3.0-dev.122",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"arktype": "^2.0.0",
|
|
8
|
-
"@prisma-next/cli": "0.3.0-dev.
|
|
9
|
-
"@prisma-next/contract
|
|
10
|
-
"@prisma-next/
|
|
11
|
-
"@prisma-next/
|
|
12
|
-
"@prisma-next/family-sql": "0.3.0-dev.
|
|
13
|
-
"@prisma-next/sql-operations": "0.3.0-dev.
|
|
14
|
-
"@prisma-next/sql-relational-core": "0.3.0-dev.
|
|
15
|
-
"@prisma-next/sql-runtime": "0.3.0-dev.
|
|
16
|
-
"@prisma-next/sql-schema-ir": "0.3.0-dev.
|
|
8
|
+
"@prisma-next/cli": "0.3.0-dev.122",
|
|
9
|
+
"@prisma-next/contract": "0.3.0-dev.122",
|
|
10
|
+
"@prisma-next/contract-authoring": "0.3.0-dev.122",
|
|
11
|
+
"@prisma-next/core-control-plane": "0.3.0-dev.122",
|
|
12
|
+
"@prisma-next/family-sql": "0.3.0-dev.122",
|
|
13
|
+
"@prisma-next/sql-operations": "0.3.0-dev.122",
|
|
14
|
+
"@prisma-next/sql-relational-core": "0.3.0-dev.122",
|
|
15
|
+
"@prisma-next/sql-runtime": "0.3.0-dev.122",
|
|
16
|
+
"@prisma-next/sql-schema-ir": "0.3.0-dev.122"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"tsdown": "0.18.4",
|
|
20
20
|
"typescript": "5.9.3",
|
|
21
21
|
"vitest": "4.0.17",
|
|
22
|
-
"@prisma-next/adapter-postgres": "0.3.0-dev.
|
|
23
|
-
"@prisma-next/operations": "0.3.0-dev.
|
|
24
|
-
"@prisma-next/sql-contract": "0.3.0-dev.
|
|
25
|
-
"@prisma-next/sql-contract
|
|
22
|
+
"@prisma-next/adapter-postgres": "0.3.0-dev.122",
|
|
23
|
+
"@prisma-next/operations": "0.3.0-dev.122",
|
|
24
|
+
"@prisma-next/sql-contract-ts": "0.3.0-dev.122",
|
|
25
|
+
"@prisma-next/sql-contract": "0.3.0-dev.122",
|
|
26
26
|
"@prisma-next/test-utils": "0.0.1",
|
|
27
|
-
"@prisma-next/
|
|
27
|
+
"@prisma-next/tsdown": "0.0.0",
|
|
28
28
|
"@prisma-next/tsconfig": "0.0.0",
|
|
29
|
-
"@prisma-next/
|
|
29
|
+
"@prisma-next/sql-lane": "0.3.0-dev.122"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|
|
@@ -3,7 +3,13 @@ import type { QueryOperationDescriptor } from '@prisma-next/sql-relational-core/
|
|
|
3
3
|
|
|
4
4
|
const pgvectorTypeId = 'pg/vector@1' as const;
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const cosineDistanceLowering = {
|
|
7
|
+
targetFamily: 'sql',
|
|
8
|
+
strategy: 'function',
|
|
9
|
+
template: '{{self}} <=> {{arg0}}',
|
|
10
|
+
} as const;
|
|
11
|
+
|
|
12
|
+
const cosineSimilarityLowering = {
|
|
7
13
|
targetFamily: 'sql',
|
|
8
14
|
strategy: 'function',
|
|
9
15
|
template: '1 - ({{self}} <=> {{arg0}})',
|
|
@@ -13,13 +19,20 @@ const cosineDistanceOperation = Object.freeze({
|
|
|
13
19
|
method: 'cosineDistance',
|
|
14
20
|
args: [{ kind: 'param' }],
|
|
15
21
|
returns: { kind: 'builtin', type: 'number' },
|
|
16
|
-
lowering:
|
|
22
|
+
lowering: cosineDistanceLowering,
|
|
23
|
+
} as const);
|
|
24
|
+
|
|
25
|
+
const cosineSimilarityOperation = Object.freeze({
|
|
26
|
+
method: 'cosineSimilarity',
|
|
27
|
+
args: [{ kind: 'param' }],
|
|
28
|
+
returns: { kind: 'builtin', type: 'number' },
|
|
29
|
+
lowering: cosineSimilarityLowering,
|
|
17
30
|
} as const);
|
|
18
31
|
|
|
19
|
-
export const
|
|
20
|
-
forTypeId: pgvectorTypeId,
|
|
21
|
-
...
|
|
22
|
-
|
|
32
|
+
export const pgvectorOperationSignatures: readonly SqlOperationSignature[] = [
|
|
33
|
+
{ forTypeId: pgvectorTypeId, ...cosineDistanceOperation },
|
|
34
|
+
{ forTypeId: pgvectorTypeId, ...cosineSimilarityOperation },
|
|
35
|
+
];
|
|
23
36
|
|
|
24
37
|
export const pgvectorQueryOperations: readonly QueryOperationDescriptor[] = [
|
|
25
38
|
{
|
|
@@ -29,6 +42,19 @@ export const pgvectorQueryOperations: readonly QueryOperationDescriptor[] = [
|
|
|
29
42
|
{ codecId: pgvectorTypeId, nullable: false },
|
|
30
43
|
],
|
|
31
44
|
returns: { codecId: 'pg/float8@1', nullable: false },
|
|
45
|
+
lowering: {
|
|
46
|
+
targetFamily: 'sql',
|
|
47
|
+
strategy: 'function',
|
|
48
|
+
template: '{{self}} <=> {{arg0}}',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
method: 'cosineSimilarity',
|
|
53
|
+
args: [
|
|
54
|
+
{ codecId: pgvectorTypeId, nullable: false },
|
|
55
|
+
{ codecId: pgvectorTypeId, nullable: false },
|
|
56
|
+
],
|
|
57
|
+
returns: { codecId: 'pg/float8@1', nullable: false },
|
|
32
58
|
lowering: {
|
|
33
59
|
targetFamily: 'sql',
|
|
34
60
|
strategy: 'function',
|
package/src/exports/control.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type {
|
|
|
3
3
|
ComponentDatabaseDependencies,
|
|
4
4
|
SqlControlExtensionDescriptor,
|
|
5
5
|
} from '@prisma-next/family-sql/control';
|
|
6
|
-
import {
|
|
6
|
+
import { pgvectorOperationSignatures, pgvectorPackMeta } from '../core/descriptor-meta';
|
|
7
7
|
|
|
8
8
|
const PGVECTOR_CODEC_ID = 'pg/vector@1' as const;
|
|
9
9
|
|
|
@@ -75,7 +75,7 @@ const pgvectorExtensionDescriptor: SqlControlExtensionDescriptor<'postgres'> = {
|
|
|
75
75
|
},
|
|
76
76
|
},
|
|
77
77
|
},
|
|
78
|
-
operationSignatures: () =>
|
|
78
|
+
operationSignatures: () => pgvectorOperationSignatures,
|
|
79
79
|
databaseDependencies: pgvectorDatabaseDependencies,
|
|
80
80
|
create: () => ({
|
|
81
81
|
familyId: 'sql' as const,
|
package/src/exports/runtime.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { type as arktype } from 'arktype';
|
|
|
7
7
|
import { codecDefinitions } from '../core/codecs';
|
|
8
8
|
import { VECTOR_CODEC_ID, VECTOR_MAX_DIM } from '../core/constants';
|
|
9
9
|
import {
|
|
10
|
-
|
|
10
|
+
pgvectorOperationSignatures,
|
|
11
11
|
pgvectorPackMeta,
|
|
12
12
|
pgvectorQueryOperations,
|
|
13
13
|
} from '../core/descriptor-meta';
|
|
@@ -49,7 +49,7 @@ const pgvectorRuntimeDescriptor: SqlRuntimeExtensionDescriptor<'postgres'> = {
|
|
|
49
49
|
familyId: 'sql' as const,
|
|
50
50
|
targetId: 'postgres' as const,
|
|
51
51
|
codecs: createPgvectorCodecRegistry,
|
|
52
|
-
operationSignatures: () =>
|
|
52
|
+
operationSignatures: () => pgvectorOperationSignatures,
|
|
53
53
|
queryOperations: () => pgvectorQueryOperations,
|
|
54
54
|
parameterizedCodecs: () => parameterizedCodecDescriptors,
|
|
55
55
|
create() {
|
|
@@ -29,6 +29,22 @@ export type OperationTypes = {
|
|
|
29
29
|
readonly template: string;
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
|
+
readonly cosineSimilarity: {
|
|
33
|
+
readonly args: readonly [
|
|
34
|
+
{
|
|
35
|
+
readonly kind: 'param';
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
readonly returns: {
|
|
39
|
+
readonly kind: 'builtin';
|
|
40
|
+
readonly type: 'number';
|
|
41
|
+
};
|
|
42
|
+
readonly lowering: {
|
|
43
|
+
readonly targetFamily: 'sql';
|
|
44
|
+
readonly strategy: 'function';
|
|
45
|
+
readonly template: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
32
48
|
};
|
|
33
49
|
};
|
|
34
50
|
|
|
@@ -41,4 +57,11 @@ export type QueryOperationTypes = SqlQueryOperationTypes<{
|
|
|
41
57
|
];
|
|
42
58
|
readonly returns: { readonly codecId: 'pg/float8@1'; readonly nullable: false };
|
|
43
59
|
};
|
|
60
|
+
readonly cosineSimilarity: {
|
|
61
|
+
readonly args: readonly [
|
|
62
|
+
{ readonly codecId: 'pg/vector@1'; readonly nullable: boolean },
|
|
63
|
+
{ readonly codecId: 'pg/vector@1'; readonly nullable: boolean },
|
|
64
|
+
];
|
|
65
|
+
readonly returns: { readonly codecId: 'pg/float8@1'; readonly nullable: false };
|
|
66
|
+
};
|
|
44
67
|
}>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor-meta-DKfA8aF2.mjs","names":["pgvectorOperationSignature: SqlOperationSignature","pgvectorQueryOperations: readonly QueryOperationDescriptor[]"],"sources":["../src/core/descriptor-meta.ts"],"sourcesContent":["import type { SqlOperationSignature } from '@prisma-next/sql-operations';\nimport type { QueryOperationDescriptor } from '@prisma-next/sql-relational-core/query-operations';\n\nconst pgvectorTypeId = 'pg/vector@1' as const;\n\nconst cosineLowering = {\n targetFamily: 'sql',\n strategy: 'function',\n template: '1 - ({{self}} <=> {{arg0}})',\n} as const;\n\nconst cosineDistanceOperation = Object.freeze({\n method: 'cosineDistance',\n args: [{ kind: 'param' }],\n returns: { kind: 'builtin', type: 'number' },\n lowering: cosineLowering,\n} as const);\n\nexport const pgvectorOperationSignature: SqlOperationSignature = {\n forTypeId: pgvectorTypeId,\n ...cosineDistanceOperation,\n};\n\nexport const pgvectorQueryOperations: readonly QueryOperationDescriptor[] = [\n {\n method: 'cosineDistance',\n args: [\n { codecId: pgvectorTypeId, nullable: false },\n { codecId: pgvectorTypeId, nullable: false },\n ],\n returns: { codecId: 'pg/float8@1', nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '1 - ({{self}} <=> {{arg0}})',\n },\n },\n];\n\nexport const pgvectorPackMeta = {\n kind: 'extension',\n id: 'pgvector',\n familyId: 'sql',\n targetId: 'postgres',\n version: '0.0.1',\n capabilities: {\n postgres: {\n 'pgvector/cosine': true,\n },\n },\n types: {\n codecTypes: {\n import: {\n package: '@prisma-next/extension-pgvector/codec-types',\n named: 'CodecTypes',\n alias: 'PgVectorTypes',\n },\n typeImports: [\n {\n package: '@prisma-next/extension-pgvector/codec-types',\n named: 'Vector',\n alias: 'Vector',\n },\n ],\n parameterized: {\n [pgvectorTypeId]: 'Vector<{{length}}>',\n },\n },\n operationTypes: {\n import: {\n package: '@prisma-next/extension-pgvector/operation-types',\n named: 'OperationTypes',\n alias: 'PgVectorOperationTypes',\n },\n },\n queryOperationTypes: {\n import: {\n package: '@prisma-next/extension-pgvector/operation-types',\n named: 'QueryOperationTypes',\n alias: 'PgVectorQueryOperationTypes',\n },\n },\n storage: [\n { typeId: pgvectorTypeId, familyId: 'sql', targetId: 'postgres', nativeType: 'vector' },\n ],\n },\n} as const;\n"],"mappings":";AAGA,MAAM,iBAAiB;AAQvB,MAAM,0BAA0B,OAAO,OAAO;CAC5C,QAAQ;CACR,MAAM,CAAC,EAAE,MAAM,SAAS,CAAC;CACzB,SAAS;EAAE,MAAM;EAAW,MAAM;EAAU;CAC5C,UAVqB;EACrB,cAAc;EACd,UAAU;EACV,UAAU;EACX;CAOA,CAAU;AAEX,MAAaA,6BAAoD;CAC/D,WAAW;CACX,GAAG;CACJ;AAED,MAAaC,0BAA+D,CAC1E;CACE,QAAQ;CACR,MAAM,CACJ;EAAE,SAAS;EAAgB,UAAU;EAAO,EAC5C;EAAE,SAAS;EAAgB,UAAU;EAAO,CAC7C;CACD,SAAS;EAAE,SAAS;EAAe,UAAU;EAAO;CACpD,UAAU;EACR,cAAc;EACd,UAAU;EACV,UAAU;EACX;CACF,CACF;AAED,MAAa,mBAAmB;CAC9B,MAAM;CACN,IAAI;CACJ,UAAU;CACV,UAAU;CACV,SAAS;CACT,cAAc,EACZ,UAAU,EACR,mBAAmB,MACpB,EACF;CACD,OAAO;EACL,YAAY;GACV,QAAQ;IACN,SAAS;IACT,OAAO;IACP,OAAO;IACR;GACD,aAAa,CACX;IACE,SAAS;IACT,OAAO;IACP,OAAO;IACR,CACF;GACD,eAAe,GACZ,iBAAiB,sBACnB;GACF;EACD,gBAAgB,EACd,QAAQ;GACN,SAAS;GACT,OAAO;GACP,OAAO;GACR,EACF;EACD,qBAAqB,EACnB,QAAQ;GACN,SAAS;GACT,OAAO;GACP,OAAO;GACR,EACF;EACD,SAAS,CACP;GAAE,QAAQ;GAAgB,UAAU;GAAO,UAAU;GAAY,YAAY;GAAU,CACxF;EACF;CACF"}
|