@prisma-next/sql-contract-psl 0.12.0-dev.10 → 0.12.0-dev.12
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/dist/index.d.mts +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{interpreter-QE6eZZof.mjs → interpreter-o0m3OC4P.mjs} +5 -9
- package/dist/interpreter-o0m3OC4P.mjs.map +1 -0
- package/dist/provider.mjs +1 -1
- package/package.json +12 -12
- package/src/interpreter.ts +4 -9
- package/dist/interpreter-QE6eZZof.mjs.map +0 -1
package/dist/provider.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as interpretPslDocumentToSqlContract } from "./interpreter-
|
|
1
|
+
import { t as interpretPslDocumentToSqlContract } from "./interpreter-o0m3OC4P.mjs";
|
|
2
2
|
import { ifDefined } from "@prisma-next/utils/defined";
|
|
3
3
|
import { notOk, ok } from "@prisma-next/utils/result";
|
|
4
4
|
import { parsePslDocument } from "@prisma-next/psl-parser";
|
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/sql-contract-psl",
|
|
3
|
-
"version": "0.12.0-dev.
|
|
3
|
+
"version": "0.12.0-dev.12",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"description": "PSL-to-SQL ContractIR interpreter for Prisma Next",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@prisma-next/config": "0.12.0-dev.
|
|
10
|
-
"@prisma-next/contract": "0.12.0-dev.
|
|
11
|
-
"@prisma-next/framework-components": "0.12.0-dev.
|
|
12
|
-
"@prisma-next/psl-parser": "0.12.0-dev.
|
|
13
|
-
"@prisma-next/sql-contract": "0.12.0-dev.
|
|
14
|
-
"@prisma-next/sql-contract-ts": "0.12.0-dev.
|
|
15
|
-
"@prisma-next/utils": "0.12.0-dev.
|
|
9
|
+
"@prisma-next/config": "0.12.0-dev.12",
|
|
10
|
+
"@prisma-next/contract": "0.12.0-dev.12",
|
|
11
|
+
"@prisma-next/framework-components": "0.12.0-dev.12",
|
|
12
|
+
"@prisma-next/psl-parser": "0.12.0-dev.12",
|
|
13
|
+
"@prisma-next/sql-contract": "0.12.0-dev.12",
|
|
14
|
+
"@prisma-next/sql-contract-ts": "0.12.0-dev.12",
|
|
15
|
+
"@prisma-next/utils": "0.12.0-dev.12",
|
|
16
16
|
"pathe": "^2.0.3"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@prisma-next/contract-authoring": "0.12.0-dev.
|
|
20
|
-
"@prisma-next/test-utils": "0.12.0-dev.
|
|
21
|
-
"@prisma-next/tsconfig": "0.12.0-dev.
|
|
22
|
-
"@prisma-next/tsdown": "0.12.0-dev.
|
|
19
|
+
"@prisma-next/contract-authoring": "0.12.0-dev.12",
|
|
20
|
+
"@prisma-next/test-utils": "0.12.0-dev.12",
|
|
21
|
+
"@prisma-next/tsconfig": "0.12.0-dev.12",
|
|
22
|
+
"@prisma-next/tsdown": "0.12.0-dev.12",
|
|
23
23
|
"arktype": "^2.2.0",
|
|
24
24
|
"tsdown": "0.22.0",
|
|
25
25
|
"typescript": "5.9.3",
|
package/src/interpreter.ts
CHANGED
|
@@ -23,7 +23,6 @@ import type {
|
|
|
23
23
|
MutationDefaultGeneratorDescriptor,
|
|
24
24
|
} from '@prisma-next/framework-components/control';
|
|
25
25
|
import type { Namespace } from '@prisma-next/framework-components/ir';
|
|
26
|
-
import { UNBOUND_NAMESPACE_ID } from '@prisma-next/framework-components/ir';
|
|
27
26
|
import type {
|
|
28
27
|
ParsePslDocumentResult,
|
|
29
28
|
PslAttribute,
|
|
@@ -229,10 +228,6 @@ const UNSPECIFIED_PSL_NAMESPACE_NAME = '__unspecified__';
|
|
|
229
228
|
* slot empty (which means the late-bound default at the `StorageTable`
|
|
230
229
|
* layer; emitted JSON omits the field).
|
|
231
230
|
*/
|
|
232
|
-
function defaultSqlNamespaceIdForTarget(targetId: string): string {
|
|
233
|
-
return targetId === 'postgres' ? 'public' : UNBOUND_NAMESPACE_ID;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
231
|
function resolveNamespaceIdForSqlTarget(input: {
|
|
237
232
|
readonly bucketName: string;
|
|
238
233
|
readonly targetId: string;
|
|
@@ -1310,7 +1305,7 @@ function resolvePolymorphism(
|
|
|
1310
1305
|
modelNames: Set<string>,
|
|
1311
1306
|
modelMappings: ReadonlyMap<string, ModelNameMapping>,
|
|
1312
1307
|
modelNamespaceIds: ReadonlyMap<string, string>,
|
|
1313
|
-
|
|
1308
|
+
defaultNamespaceId: string,
|
|
1314
1309
|
sourceId: string,
|
|
1315
1310
|
diagnostics: ContractSourceDiagnostic[],
|
|
1316
1311
|
): Record<string, ContractModel> {
|
|
@@ -1416,7 +1411,7 @@ function resolvePolymorphism(
|
|
|
1416
1411
|
...variantModel,
|
|
1417
1412
|
base: crossRef(
|
|
1418
1413
|
baseDecl.baseName,
|
|
1419
|
-
modelNamespaceIds.get(baseDecl.baseName) ??
|
|
1414
|
+
modelNamespaceIds.get(baseDecl.baseName) ?? defaultNamespaceId,
|
|
1420
1415
|
),
|
|
1421
1416
|
...(resolvedTable ? { storage: { ...variantModel.storage, table: resolvedTable } } : {}),
|
|
1422
1417
|
},
|
|
@@ -1700,7 +1695,7 @@ export function interpretPslDocumentToSqlContract(
|
|
|
1700
1695
|
modelNames,
|
|
1701
1696
|
modelMappings,
|
|
1702
1697
|
modelNamespaceIds,
|
|
1703
|
-
input.target.
|
|
1698
|
+
input.target.defaultNamespaceId,
|
|
1704
1699
|
sourceId,
|
|
1705
1700
|
polyDiagnostics,
|
|
1706
1701
|
);
|
|
@@ -1736,7 +1731,7 @@ export function interpretPslDocumentToSqlContract(
|
|
|
1736
1731
|
...(namespaceSlice.valueObjects !== undefined
|
|
1737
1732
|
? { valueObjects: namespaceSlice.valueObjects }
|
|
1738
1733
|
: {}),
|
|
1739
|
-
...(namespaceId ===
|
|
1734
|
+
...(namespaceId === input.target.defaultNamespaceId &&
|
|
1740
1735
|
Object.keys(valueObjects).length > 0
|
|
1741
1736
|
? { valueObjects }
|
|
1742
1737
|
: {}),
|