@prisma-next/sql-operations 0.5.0-dev.82 → 0.5.0-dev.84

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
@@ -16,7 +16,8 @@ This package provides SQL-specific operation types that extend the generic `Oper
16
16
 
17
17
  - **SQL Operation Types**: SQL-specific operation entry and descriptor types
18
18
  - `SqlOperationEntry`: Extends `OperationEntry` with a `lowering` field (`SqlLoweringSpec`)
19
- - `SqlOperationDescriptor`: Extends `OperationDescriptor<SqlOperationEntry>` (entry plus `method` name)
19
+ - `SqlOperationDescriptor`: Alias for `SqlOperationEntry` used at registration sites
20
+ - `SqlOperationDescriptors`: `Readonly<Record<string, SqlOperationDescriptor>>` — the keyed-record shape adapter/extension `queryOperations()` factories return
20
21
  - `SqlLoweringSpec`: SQL-specific lowering specification (`targetFamily`, `strategy`, `template`)
21
22
  - `SqlOperationRegistry`: Typed registry alias (`OperationRegistry<SqlOperationEntry>`)
22
23
 
@@ -72,17 +73,11 @@ import {
72
73
  const registry = createSqlOperationRegistry();
73
74
 
74
75
  const descriptor: SqlOperationDescriptor = {
75
- method: 'cosineDistance',
76
- args: [{ codecId: 'pg/vector@1', nullable: false }],
77
- returns: { codecId: 'pg/float8@1', nullable: false },
78
- lowering: {
79
- targetFamily: 'sql',
80
- strategy: 'infix',
81
- template: '{{self}} <=> {{arg0}}',
82
- },
76
+ self: { codecId: 'pg/vector@1' },
77
+ impl: () => ({ returnType: { codecId: 'pg/float8@1', nullable: false } }),
83
78
  };
84
79
 
85
- registry.register(descriptor);
80
+ registry.register('cosineDistance', descriptor);
86
81
 
87
82
  const entries = registry.entries(); // Record<string, SqlOperationEntry>
88
83
  ```
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { OperationDescriptor, OperationRegistry } from "@prisma-next/operations";
1
+ import { OperationDescriptor, OperationDescriptors, OperationRegistry } from "@prisma-next/operations";
2
2
  import { QueryOperationTypeEntry } from "@prisma-next/sql-contract/types";
3
3
 
4
4
  //#region src/index.d.ts
@@ -16,8 +16,9 @@ interface SqlLoweringSpec {
16
16
  */
17
17
  type SqlOperationEntry = QueryOperationTypeEntry;
18
18
  type SqlOperationDescriptor = OperationDescriptor<SqlOperationEntry>;
19
+ type SqlOperationDescriptors = OperationDescriptors<SqlOperationEntry>;
19
20
  type SqlOperationRegistry = OperationRegistry<SqlOperationEntry>;
20
21
  declare function createSqlOperationRegistry(): SqlOperationRegistry;
21
22
  //#endregion
22
- export { SqlLoweringSpec, SqlOperationDescriptor, SqlOperationEntry, SqlOperationRegistry, createSqlOperationRegistry };
23
+ export { SqlLoweringSpec, SqlOperationDescriptor, SqlOperationDescriptors, SqlOperationEntry, SqlOperationRegistry, createSqlOperationRegistry };
23
24
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;UAIiB,eAAA;EAAA,SACN,YAAA;EAAA,SACA,QAAA;EAAA,SACA,QAAA;AAAA;;;;;;;AAUX;KAAY,iBAAA,GAAoB,uBAAA;AAAA,KAEpB,sBAAA,GAAyB,mBAAA,CAAoB,iBAAA;AAAA,KAE7C,oBAAA,GAAuB,iBAAA,CAAkB,iBAAA;AAAA,iBAErC,0BAAA,CAAA,GAA8B,oBAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;UAQiB,eAAA;EAAA,SACN,YAAA;EAAA,SACA,QAAA;EAAA,SACA,QAAA;AAAA;;;;;;;AAUX;KAAY,iBAAA,GAAoB,uBAAA;AAAA,KAEpB,sBAAA,GAAyB,mBAAA,CAAoB,iBAAA;AAAA,KAE7C,uBAAA,GAA0B,oBAAA,CAAqB,iBAAA;AAAA,KAE/C,oBAAA,GAAuB,iBAAA,CAAkB,iBAAA;AAAA,iBAErC,0BAAA,CAAA,GAA8B,oBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { OperationDescriptor, OperationRegistry } from '@prisma-next/operations';\nimport { createOperationRegistry } from '@prisma-next/operations';\nimport type { QueryOperationTypeEntry } from '@prisma-next/sql-contract/types';\n\nexport interface SqlLoweringSpec {\n readonly targetFamily: 'sql';\n readonly strategy: 'infix' | 'function';\n readonly template: string;\n}\n\n/**\n * Runtime shape of a SQL operation entry — tightened beyond the framework's\n * target-agnostic `OperationEntry` so `impl` returns a codec-exact\n * `QueryOperationReturn` instead of `unknown`. Consumers (ORM column helper,\n * sql-builder `fns` dispatch) can read `result.returnType.codecId` without a\n * cast.\n */\nexport type SqlOperationEntry = QueryOperationTypeEntry;\n\nexport type SqlOperationDescriptor = OperationDescriptor<SqlOperationEntry>;\n\nexport type SqlOperationRegistry = OperationRegistry<SqlOperationEntry>;\n\nexport function createSqlOperationRegistry(): SqlOperationRegistry {\n return createOperationRegistry<SqlOperationEntry>();\n}\n"],"mappings":";;AAuBA,SAAgB,6BAAmD;CACjE,OAAO,yBAA4C"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type {\n OperationDescriptor,\n OperationDescriptors,\n OperationRegistry,\n} from '@prisma-next/operations';\nimport { createOperationRegistry } from '@prisma-next/operations';\nimport type { QueryOperationTypeEntry } from '@prisma-next/sql-contract/types';\n\nexport interface SqlLoweringSpec {\n readonly targetFamily: 'sql';\n readonly strategy: 'infix' | 'function';\n readonly template: string;\n}\n\n/**\n * Runtime shape of a SQL operation entry — tightened beyond the framework's\n * target-agnostic `OperationEntry` so `impl` returns a codec-exact\n * `QueryOperationReturn` instead of `unknown`. Consumers (ORM column helper,\n * sql-builder `fns` dispatch) can read `result.returnType.codecId` without a\n * cast.\n */\nexport type SqlOperationEntry = QueryOperationTypeEntry;\n\nexport type SqlOperationDescriptor = OperationDescriptor<SqlOperationEntry>;\n\nexport type SqlOperationDescriptors = OperationDescriptors<SqlOperationEntry>;\n\nexport type SqlOperationRegistry = OperationRegistry<SqlOperationEntry>;\n\nexport function createSqlOperationRegistry(): SqlOperationRegistry {\n return createOperationRegistry<SqlOperationEntry>();\n}\n"],"mappings":";;AA6BA,SAAgB,6BAAmD;CACjE,OAAO,yBAA4C"}
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "@prisma-next/sql-operations",
3
- "version": "0.5.0-dev.82",
3
+ "version": "0.5.0-dev.84",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "description": "SQL-specific operations for Prisma Next",
8
8
  "dependencies": {
9
9
  "arktype": "^2.1.29",
10
- "@prisma-next/operations": "0.5.0-dev.82",
11
- "@prisma-next/sql-contract": "0.5.0-dev.82"
10
+ "@prisma-next/operations": "0.5.0-dev.84",
11
+ "@prisma-next/sql-contract": "0.5.0-dev.84"
12
12
  },
13
13
  "devDependencies": {
14
14
  "tsdown": "0.22.0",
15
15
  "typescript": "5.9.3",
16
16
  "vitest": "4.1.5",
17
- "@prisma-next/emitter": "0.5.0-dev.82",
18
- "@prisma-next/test-utils": "0.0.1",
17
+ "@prisma-next/emitter": "0.5.0-dev.84",
18
+ "@prisma-next/tsconfig": "0.0.0",
19
19
  "@prisma-next/tsdown": "0.0.0",
20
- "@prisma-next/tsconfig": "0.0.0"
20
+ "@prisma-next/test-utils": "0.0.1"
21
21
  },
22
22
  "files": [
23
23
  "dist",
package/src/index.ts CHANGED
@@ -1,4 +1,8 @@
1
- import type { OperationDescriptor, OperationRegistry } from '@prisma-next/operations';
1
+ import type {
2
+ OperationDescriptor,
3
+ OperationDescriptors,
4
+ OperationRegistry,
5
+ } from '@prisma-next/operations';
2
6
  import { createOperationRegistry } from '@prisma-next/operations';
3
7
  import type { QueryOperationTypeEntry } from '@prisma-next/sql-contract/types';
4
8
 
@@ -19,6 +23,8 @@ export type SqlOperationEntry = QueryOperationTypeEntry;
19
23
 
20
24
  export type SqlOperationDescriptor = OperationDescriptor<SqlOperationEntry>;
21
25
 
26
+ export type SqlOperationDescriptors = OperationDescriptors<SqlOperationEntry>;
27
+
22
28
  export type SqlOperationRegistry = OperationRegistry<SqlOperationEntry>;
23
29
 
24
30
  export function createSqlOperationRegistry(): SqlOperationRegistry {