@prisma-next/sql-contract-psl 0.3.0-dev.147 → 0.3.0-dev.163
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 +5 -5
- package/dist/index.d.mts +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{interpreter-qjtea3zY.mjs → interpreter-iFCRN9nb.mjs} +712 -195
- package/dist/interpreter-iFCRN9nb.mjs.map +1 -0
- package/dist/provider.mjs +1 -1
- package/package.json +11 -11
- package/src/interpreter.ts +259 -149
- package/src/psl-authoring-arguments.ts +454 -0
- package/src/psl-column-resolution.ts +233 -37
- package/src/psl-field-resolution.ts +162 -139
- package/src/psl-relation-resolution.ts +13 -4
- package/dist/interpreter-qjtea3zY.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -15,14 +15,14 @@ This keeps core/CLI source-agnostic while giving PSL-first SQL users a one-line
|
|
|
15
15
|
|
|
16
16
|
- Interpret `ParsePslDocumentResult` into SQL `Contract`
|
|
17
17
|
- Interpret generic PSL attributes into SQL contract semantics (`@id`, `@unique`, `@default`, `@relation`, `@map`, `@@map`)
|
|
18
|
+
- Lower shared constructor expressions in both `types {}` blocks and inline field positions (for example `ShortName = sql.String(length: 35)` and `embedding pgvector.Vector(length: 1536)?`)
|
|
18
19
|
- Lower supported default functions through composed registry inputs
|
|
19
20
|
- Support selected Postgres native-type attributes on named types for brownfield round-trips (`@db.Char`, `@db.VarChar`, `@db.Numeric`, `@db.Uuid`, `@db.SmallInt`, `@db.Real`, `@db.Timestamp`, `@db.Timestamptz`, `@db.Date`, `@db.Time`, `@db.Timetz`, `@db.Json`)
|
|
20
|
-
- Support pgvector parity mapping from PSL attributes to existing TS-representable descriptor shape (`codecId`, `nativeType`, `typeParams`)
|
|
21
21
|
- Map PSL relation action tokens to SQL contract referential actions and emit diagnostics for unsupported values
|
|
22
22
|
- Emit deterministic relation metadata in `models.<Model>.relations`
|
|
23
|
-
- Enforce extension composition for
|
|
23
|
+
- Enforce extension composition for namespaced constructor expressions and emit strict diagnostics for unsupported namespaced attributes
|
|
24
24
|
- Validate generator applicability by declared `codecId` support on composed generator descriptors
|
|
25
|
-
- Consume target-bound scalar descriptors and mutation-default registries assembled by composition layers
|
|
25
|
+
- Consume target-bound scalar descriptors, shared authoring contributions, and mutation-default registries assembled by composition layers
|
|
26
26
|
- Compose provider flow for SQL PSL-first config (`read -> parse -> interpret`) without local registry assembly
|
|
27
27
|
- Preserve parser diagnostics and add interpreter diagnostics with stable codes
|
|
28
28
|
- Return `notOk` with structured diagnostics for unsupported constructs
|
|
@@ -66,9 +66,9 @@ Supported `@default(...)` surface in v1 when composed contributors provide handl
|
|
|
66
66
|
## Public API
|
|
67
67
|
|
|
68
68
|
- `@prisma-next/sql-contract-psl`
|
|
69
|
-
- `interpretPslDocumentToSqlContract({ document, target, scalarTypeDescriptors, controlMutationDefaults?, composedExtensionPacks? })`
|
|
69
|
+
- `interpretPslDocumentToSqlContract({ document, target, scalarTypeDescriptors, authoringContributions?, controlMutationDefaults?, composedExtensionPacks? })`
|
|
70
70
|
- `@prisma-next/sql-contract-psl/provider`
|
|
71
|
-
- `prismaContract(schemaPath, { output?, target, scalarTypeDescriptors, controlMutationDefaults?, composedExtensionPacks? })`
|
|
71
|
+
- `prismaContract(schemaPath, { output?, target, scalarTypeDescriptors, authoringContributions?, controlMutationDefaults?, composedExtensionPacks? })`
|
|
72
72
|
- Provider input is fully preassembled by composition layers (for example `@prisma-next/family-sql/control` helpers).
|
|
73
73
|
|
|
74
74
|
## Dependencies
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as DefaultFunctionRegistryEntry, i as DefaultFunctionRegistry, n as DefaultFunctionLoweringContext, o as MutationDefaultGeneratorDescriptor, r as DefaultFunctionLoweringHandler, t as ControlMutationDefaults } from "./default-function-registry-DUMRIhJH.mjs";
|
|
2
2
|
import { AuthoringContributions } from "@prisma-next/framework-components/authoring";
|
|
3
3
|
import { Result } from "@prisma-next/utils/result";
|
|
4
|
-
import { ParsePslDocumentResult } from "@prisma-next/psl-parser";
|
|
4
|
+
import { ParsePslDocumentResult, PslSpan } from "@prisma-next/psl-parser";
|
|
5
5
|
import { ContractSourceDiagnostic, ContractSourceDiagnostics } from "@prisma-next/config/config-types";
|
|
6
6
|
import { ColumnDefault, Contract, ExecutionMutationDefaultValue } from "@prisma-next/contract/types";
|
|
7
7
|
import { ExtensionPackRef, TargetPackRef } from "@prisma-next/framework-components/components";
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/psl-column-resolution.ts","../src/interpreter.ts"],"sourcesContent":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/psl-column-resolution.ts","../src/interpreter.ts"],"sourcesContent":[],"mappings":";;;;;;;;;KAmCY,gBAAA;;;;EAAA,SAAA,UAAgB,CAAA,EAIJ,MAJI,CAAA,MAIJ,EAAA,OAAM,CAAA;;;;UCsCb,sCAAA;ED1CL,SAAA,QAAA,EC2CS,sBDvCS;mBCwCX;kCACe,oBAAoB;;EAHrC,SAAA,yBAAA,CAAA,EAAA,SAK+B,gBALO,CAAA,KAAA,EAAA,UAAA,CAAA,EAAA;EAClC,SAAA,uBAAA,CAAA,EAKgB,uBALhB;EACF,SAAA,sBAAA,CAAA,EAKiB,sBALjB;;AACe,iBAu/BlB,iCAAA,CAv/BkB,KAAA,EAw/BzB,sCAx/ByB,CAAA,EAy/B/B,MAz/B+B,CAy/BxB,QAz/BwB,EAy/Bd,yBAz/Bc,CAAA"}
|
package/dist/index.mjs
CHANGED