@prisma/orm-family-sql 8.0.0-rc.22-dev.13 → 8.0.0-rc.22-dev.14
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/{attribute-specs-67xYCptU.d.mts → attribute-specs-DL1btx0j.d.mts} +4 -4
- package/dist/{attribute-specs-67xYCptU.d.mts.map → attribute-specs-DL1btx0j.d.mts.map} +1 -1
- package/dist/{authoring-entity-types-CgKIgWq5-DrdNt_VL.d.mts → authoring-entity-types-CgKIgWq5-BqNs-56x.d.mts} +2 -2
- package/dist/{authoring-entity-types-CgKIgWq5-DrdNt_VL.d.mts.map → authoring-entity-types-CgKIgWq5-BqNs-56x.d.mts.map} +1 -1
- package/dist/{contract-builder-1Ml9yJ0j.d.mts → contract-builder-BfPC4mQK.d.mts} +7 -3
- package/dist/{contract-builder-1Ml9yJ0j.d.mts.map → contract-builder-BfPC4mQK.d.mts.map} +1 -1
- package/dist/{contract-builder-BX4vfJCt.mjs → contract-builder-m9XW9MgR.mjs} +4 -2
- package/dist/{contract-builder-BX4vfJCt.mjs.map → contract-builder-m9XW9MgR.mjs.map} +1 -1
- package/dist/contract-prisma7__provider.mjs +7 -19
- package/dist/contract-prisma7__provider.mjs.map +1 -1
- package/dist/contract-psl.d.mts +1 -1
- package/dist/contract-psl.mjs +1 -1
- package/dist/contract-psl__attribute-specs.d.mts +1 -1
- package/dist/contract-psl__provider.mjs +1 -1
- package/dist/contract-psl__provider.mjs.map +1 -1
- package/dist/contract-ts.d.mts +2 -2
- package/dist/contract-ts.mjs +2 -2
- package/dist/contract-ts__contract-builder.d.mts +2 -2
- package/dist/contract-ts__contract-builder.mjs +2 -2
- package/dist/contract.d.mts +1 -1
- package/dist/contract__entity-handle-lowering-hook.d.mts +1 -1
- package/dist/{control-9kQv_V31.mjs → control-DcEzEBvW.mjs} +45 -3
- package/dist/control-DcEzEBvW.mjs.map +1 -0
- package/dist/{control-CaWlb92W.d.mts → control-DpKSNUXr.d.mts} +3 -3
- package/dist/{control-CaWlb92W.d.mts.map → control-DpKSNUXr.d.mts.map} +1 -1
- package/dist/{entity-handle-lowering-hook-Bmgnj7Dk.d.mts → entity-handle-lowering-hook-BzQxbmYy.d.mts} +2 -2
- package/dist/{entity-handle-lowering-hook-Bmgnj7Dk.d.mts.map → entity-handle-lowering-hook-BzQxbmYy.d.mts.map} +1 -1
- package/dist/family.d.mts +2 -2
- package/dist/family.mjs +2 -2
- package/dist/family__control.d.mts +1 -1
- package/dist/family__control.mjs +1 -1
- package/dist/family__pack.d.mts +1 -1
- package/dist/family__pack.mjs +1 -1
- package/dist/{generator-functions-Hy4pDDr9-N4PMe9ob.mjs → generator-functions-Hy4pDDr9-DkN0qbPW.mjs} +2 -2
- package/dist/{generator-functions-Hy4pDDr9-N4PMe9ob.mjs.map → generator-functions-Hy4pDDr9-DkN0qbPW.mjs.map} +1 -1
- package/dist/{interpreter-Cpal-yJC-mQRY-mo3.mjs → interpreter-CVd521dx-B3prmAMy.mjs} +24 -7
- package/dist/interpreter-CVd521dx-B3prmAMy.mjs.map +1 -0
- package/dist/{pack-Cnw2IEkm.d.mts → pack-7m3efDkY.d.mts} +3 -3
- package/dist/{pack-Cnw2IEkm.d.mts.map → pack-7m3efDkY.d.mts.map} +1 -1
- package/dist/{psl-column-resolution-Bv_-TDHZ-CLGqCPXA.d.mts → psl-column-resolution-Bv_-TDHZ-Cuu5X_9o.d.mts} +2 -2
- package/dist/{psl-column-resolution-Bv_-TDHZ-CLGqCPXA.d.mts.map → psl-column-resolution-Bv_-TDHZ-Cuu5X_9o.d.mts.map} +1 -1
- package/package.json +18 -18
- package/dist/control-9kQv_V31.mjs.map +0 -1
- package/dist/interpreter-Cpal-yJC-mQRY-mo3.mjs.map +0 -1
package/dist/contract-psl.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as SqlNamespaceBase, c as SqlNamespaceInput } from "./sql-storage-B_AM6tU1-BOPQxXo7.mjs";
|
|
2
2
|
import "./types-CXRxo_TK.mjs";
|
|
3
|
-
import { t as ColumnDescriptor } from "./psl-column-resolution-Bv_-TDHZ-
|
|
3
|
+
import { t as ColumnDescriptor } from "./psl-column-resolution-Bv_-TDHZ-Cuu5X_9o.mjs";
|
|
4
4
|
import { AuthoringContributions, DataTypeSupport } from "@prisma/orm-framework/components/authoring";
|
|
5
5
|
import { Contract } from "@prisma/orm-framework/contract/types";
|
|
6
6
|
import { CodecLookupWithDescriptors } from "@prisma/orm-framework/components/codec";
|
package/dist/contract-psl.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as interpretPslDocumentToSqlContract } from "./interpreter-
|
|
1
|
+
import { i as interpretPslDocumentToSqlContract } from "./interpreter-CVd521dx-B3prmAMy.mjs";
|
|
2
2
|
export { interpretPslDocumentToSqlContract };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as EnumMemberListDefault, c as sqlAttributeSpecs, i as EnumMemberDefault, n as DefaultFunctionCall, o as ParsedNullLiteral, r as DefaultFunctionSignature, s as defaultFunctionCall, t as describeUnsupportedSqlAttribute } from "./attribute-specs-
|
|
1
|
+
import { a as EnumMemberListDefault, c as sqlAttributeSpecs, i as EnumMemberDefault, n as DefaultFunctionCall, o as ParsedNullLiteral, r as DefaultFunctionSignature, s as defaultFunctionCall, t as describeUnsupportedSqlAttribute } from "./attribute-specs-DL1btx0j.mjs";
|
|
2
2
|
export { type DefaultFunctionCall, type DefaultFunctionSignature, type EnumMemberDefault, type EnumMemberListDefault, type ParsedNullLiteral, defaultFunctionCall, describeUnsupportedSqlAttribute, sqlAttributeSpecs };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as applySqlSpecifierControlPolicy } from "./derived-checks-zjkmqsa_-D7VKKK_q.mjs";
|
|
2
|
-
import { i as interpretPslDocumentToSqlContract } from "./interpreter-
|
|
2
|
+
import { i as interpretPslDocumentToSqlContract } from "./interpreter-CVd521dx-B3prmAMy.mjs";
|
|
3
3
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
4
4
|
import { collectScalarTypeConstructors } from "@prisma/orm-framework/components/authoring";
|
|
5
5
|
import { assertDefined } from "@prisma/orm-framework/utils/assertions";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-psl__provider.mjs","names":[],"sources":["../../../../2-sql-family/2-authoring/contract-psl/dist/provider.mjs"],"sourcesContent":["import { n as interpretPslDocumentToSqlContract } from \"./interpreter-
|
|
1
|
+
{"version":3,"file":"contract-psl__provider.mjs","names":[],"sources":["../../../../2-sql-family/2-authoring/contract-psl/dist/provider.mjs"],"sourcesContent":["import { n as interpretPslDocumentToSqlContract } from \"./interpreter-CVd521dx.mjs\";\nimport { buildSymbolTable, createBinder, isPrismaNextSchema, mapPslDiagnostics } from \"@internal/psl-parser\";\nimport { applySqlSpecifierControlPolicy } from \"@internal/sql-contract-ts/contract-builder\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { collectScalarTypeConstructors } from \"@internal/framework-components/authoring\";\nimport { withSeedDiagnostics } from \"@internal/psl-parser/interpret\";\nimport { parse } from \"@internal/psl-parser/syntax\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { readFile } from \"node:fs/promises\";\nimport { basename, extname } from \"pathe\";\nimport { isDynamicPattern } from \"tinyglobby\";\n//#region src/provider.ts\n/**\n* The directory portion of `pattern` before its first glob-magic segment,\n* joined back with `/` (e.g. a `prisma` directory holding a recursive\n* `.prisma` glob derives `./prisma`). A rootless pattern with no static\n* segments yields `''`.\n*/\nfunction staticPrefixDirectory(pattern) {\n\tconst staticSegments = [];\n\tfor (const segment of pattern.replaceAll(\"\\\\\", \"/\").split(\"/\")) {\n\t\tif (isDynamicPattern(segment)) break;\n\t\tstaticSegments.push(segment);\n\t}\n\treturn staticSegments.join(\"/\");\n}\n/**\n* Derives the emit output path from the schema input path so artefacts land\n* colocated with the source (e.g. `src/contract/schema.prisma` →\n* `src/contract/contract.json`). A glob-shaped path derives from its static\n* prefix directory instead (a recursive glob under `prisma` derives\n* `./prisma/contract.json`). The provider owns this because it is the only\n* layer that knows the input path; the upstream `normalizeContractConfig`\n* default is a last-resort fallback for providers that don't carry one.\n*/\nfunction defaultOutputFromSchemaPath(schemaPath) {\n\tif (isDynamicPattern(schemaPath)) {\n\t\tconst prefix = staticPrefixDirectory(schemaPath);\n\t\treturn prefix.length === 0 ? \"contract.json\" : `${prefix}/contract.json`;\n\t}\n\tconst ext = extname(schemaPath);\n\tif (ext.length === 0) return `${schemaPath}.json`;\n\tconst base = schemaPath.slice(0, -ext.length);\n\tif (basename(base) === \"schema\") return `${base.slice(0, -6)}contract.json`;\n\treturn `${base}.json`;\n}\nfunction prismaContract(schemaPath, options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"psl\",\n\t\t\tinputs: [schemaPath],\n\t\t\tinterpret(input, context) {\n\t\t\t\tconst scalarColumnDescriptors = collectScalarTypeConstructors(context.authoringContributions.type);\n\t\t\t\treturn interpretPslDocumentToSqlContract({\n\t\t\t\t\tdocuments: input.documents,\n\t\t\t\t\tsymbolTable: input.symbolTable,\n\t\t\t\t\tsources: input.sources,\n\t\t\t\t\tbinder: input.binder,\n\t\t\t\t\tseedDiagnostics: [],\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\tauthoringContributions: context.authoringContributions,\n\t\t\t\t\tscalarColumnDescriptors,\n\t\t\t\t\t...ifDefined(\"composedExtensions\", context.composedExtensions.length > 0 ? [...context.composedExtensions] : void 0),\n\t\t\t\t\tcomposedExtensionContracts: context.composedExtensionContracts,\n\t\t\t\t\t...ifDefined(\"composedExtensionPackRefs\", options.composedExtensionPackRefs?.length ? options.composedExtensionPackRefs : void 0),\n\t\t\t\t\tcontrolMutationDefaults: context.controlMutationDefaults,\n\t\t\t\t\tgeneratorFunctions: context.generatorFunctions,\n\t\t\t\t\tcreateNamespace: options.createNamespace,\n\t\t\t\t\tcapabilities: context.capabilities,\n\t\t\t\t\tcodecLookup: context.codecLookup,\n\t\t\t\t\tdataTypes: context.dataTypes,\n\t\t\t\t\t...ifDefined(\"enumInferenceCodecs\", options.enumInferenceCodecs),\n\t\t\t\t\t...ifDefined(\"reportWarning\", context.reportWarning)\n\t\t\t\t});\n\t\t\t},\n\t\t\tasync load(context) {\n\t\t\t\tconst candidates = [...new Set(context.resolvedInputs)].sort();\n\t\t\t\tif (candidates.length === 0) return notOk({\n\t\t\t\t\tsummary: \"No schema files matched the configured contract source\",\n\t\t\t\t\tdiagnostics: [{\n\t\t\t\t\t\tcode: \"PSL_NO_SCHEMA_FILES_MATCHED\",\n\t\t\t\t\t\tmessage: `No files matched the configured pattern \"${schemaPath}\"`,\n\t\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t\tconst readDiagnostics = [];\n\t\t\t\tconst members = [];\n\t\t\t\tconst undirected = [];\n\t\t\t\tfor (const path of candidates) {\n\t\t\t\t\tlet text;\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttext = await readFile(path, \"utf-8\");\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconst message = String(error);\n\t\t\t\t\t\treadDiagnostics.push({\n\t\t\t\t\t\t\tcode: \"PSL_SCHEMA_READ_FAILED\",\n\t\t\t\t\t\t\tmessage,\n\t\t\t\t\t\t\tsourceId: path\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (isPrismaNextSchema(text)) members.push({\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\ttext\n\t\t\t\t\t});\n\t\t\t\t\telse undirected.push(path);\n\t\t\t\t}\n\t\t\t\tif (members.length === 0) {\n\t\t\t\t\tif (undirected.length === 0) return notOk({\n\t\t\t\t\t\tsummary: \"Failed to read Prisma schema files\",\n\t\t\t\t\t\tdiagnostics: readDiagnostics\n\t\t\t\t\t});\n\t\t\t\t\treturn notOk({\n\t\t\t\t\t\tsummary: \"No schema file carries the \\\"// use prisma-8\\\" directive\",\n\t\t\t\t\t\tdiagnostics: [...readDiagnostics, {\n\t\t\t\t\t\t\tcode: \"PSL_NO_OPTED_IN_SCHEMA_FILES\",\n\t\t\t\t\t\t\tmessage: `None of the matched files carry the \"// use prisma-8\" directive: ${undirected.join(\", \")}`,\n\t\t\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconst parsed = members.map(({ path, text }) => parse(text, path));\n\t\t\t\tconst documents = parsed.map(({ document }) => document);\n\t\t\t\tconst [firstSources, ...restSources] = parsed.map(({ sources }) => sources);\n\t\t\t\tassertDefined(firstSources, \"prismaContract requires at least one parsed schema file\");\n\t\t\t\tconst sources = firstSources.merge(...restSources);\n\t\t\t\tconst seedDiagnostics = [...readDiagnostics, ...mapPslDiagnostics(parsed.flatMap(({ diagnostics }) => diagnostics), sources)];\n\t\t\t\tconst { symbolTable, diagnostics: symbolTableDiagnostics } = buildSymbolTable({\n\t\t\t\t\tdocuments,\n\t\t\t\t\tsources,\n\t\t\t\t\tdefaultNamespaceId: context.defaultNamespaceId\n\t\t\t\t});\n\t\t\t\tconst { binder, diagnostics: binderDiagnostics } = createBinder({\n\t\t\t\t\tsymbolTable,\n\t\t\t\t\tsources,\n\t\t\t\t\tcontext\n\t\t\t\t});\n\t\t\t\tconst interpreted = withSeedDiagnostics(this.interpret({\n\t\t\t\t\tdocuments,\n\t\t\t\t\tsources,\n\t\t\t\t\tsymbolTable,\n\t\t\t\t\tbinder\n\t\t\t\t}, context), [...seedDiagnostics, ...mapPslDiagnostics([...symbolTableDiagnostics, ...binderDiagnostics], sources)]);\n\t\t\t\tif (!interpreted.ok) return interpreted;\n\t\t\t\treturn ok(applySqlSpecifierControlPolicy(interpreted.value, options.defaultControlPolicy, options.createNamespace));\n\t\t\t}\n\t\t},\n\t\toutput: options.output ?? defaultOutputFromSchemaPath(schemaPath)\n\t};\n}\n//#endregion\nexport { prismaContract };\n\n//# sourceMappingURL=provider.mjs.map"],"mappings":"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"}
|
package/dist/contract-ts.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as applySqlSpecifierControlPolicy, t as SqlNamespaceFactory } from "./derived-checks-DpPkO6Dt-CQIM17j5.mjs";
|
|
2
2
|
import { r as SqlExpression, u as sql } from "./sql-expression-1yO8GiBc.mjs";
|
|
3
|
-
import { $ as enumType, A as MergeEnums, B as UniqueConstraintNode, C as ForeignKeyTableReference, D as IndexOptionsFunction, E as IndexNode, F as ScalarFieldBuilder, G as bindEnumType, H as ValueObjectMemberNode, I as ScalarMemberNode, J as buildSqlContractFromDefinition, K as buildBoundContract, L as TableNode, M as ModelNode, N as PrimaryKeyNode, O as IndexOptionsInput, P as RelationNode, Q as defineContract, R as TableProperties, S as ForeignKeyNode, T as IndexExpressionInput, U as ValueObjectNode, V as ValueObjectFieldNode, W as autoincrement, X as composedExtensionPackRefs, Y as check, Z as createComposedAuthoringHelpers, _ as EnumMember, a as CheckNode, at as now, b as FieldNode, c as ColumnNode, d as ContractDefinition, et as extensionModel, f as ContractInput, g as DeferredIndexOptions, h as DeferredIndexExpression, i as BoundEnumType, it as model, j as ModelLike, k as ManyOptions, l as ColumnRef, m as DeferredIndexColumn, n as AuthoredColumnDefault, nt as isValueObjectMember, o as CodecInput, ot as rel, p as ContractModelBuilder, q as buildContractDefinition, r as AuthoredColumnDefaultLiteralValue, rt as member, s as CodecTypeMap, st as storedAsListColumn, t as AttachedEntities, tt as field, u as ComposedAuthoringHelpers, v as EnumTypeHandle, w as IndexConstraint, x as ForeignKeyModelReference, y as ExtractCodecTypesFromPack, z as TargetFieldRef } from "./contract-builder-
|
|
3
|
+
import { $ as enumType, A as MergeEnums, B as UniqueConstraintNode, C as ForeignKeyTableReference, D as IndexOptionsFunction, E as IndexNode, F as ScalarFieldBuilder, G as bindEnumType, H as ValueObjectMemberNode, I as ScalarMemberNode, J as buildSqlContractFromDefinition, K as buildBoundContract, L as TableNode, M as ModelNode, N as PrimaryKeyNode, O as IndexOptionsInput, P as RelationNode, Q as defineContract, R as TableProperties, S as ForeignKeyNode, T as IndexExpressionInput, U as ValueObjectNode, V as ValueObjectFieldNode, W as autoincrement, X as composedExtensionPackRefs, Y as check, Z as createComposedAuthoringHelpers, _ as EnumMember, a as CheckNode, at as now, b as FieldNode, c as ColumnNode, ct as unbound, d as ContractDefinition, et as extensionModel, f as ContractInput, g as DeferredIndexOptions, h as DeferredIndexExpression, i as BoundEnumType, it as model, j as ModelLike, k as ManyOptions, l as ColumnRef, m as DeferredIndexColumn, n as AuthoredColumnDefault, nt as isValueObjectMember, o as CodecInput, ot as rel, p as ContractModelBuilder, q as buildContractDefinition, r as AuthoredColumnDefaultLiteralValue, rt as member, s as CodecTypeMap, st as storedAsListColumn, t as AttachedEntities, tt as field, u as ComposedAuthoringHelpers, v as EnumTypeHandle, w as IndexConstraint, x as ForeignKeyModelReference, y as ExtractCodecTypesFromPack, z as TargetFieldRef } from "./contract-builder-BfPC4mQK.mjs";
|
|
4
4
|
import { i as typescriptContractFromPath, n as emptyContract, r as typescriptContract, t as ContractConfig } from "./config-types-Ce1tAJ0B.mjs";
|
|
5
|
-
export { type AttachedEntities, type AuthoredColumnDefault, type AuthoredColumnDefaultLiteralValue, type BoundEnumType, type CheckNode, type CodecInput, type CodecTypeMap, type ColumnNode, type ColumnRef, type ComposedAuthoringHelpers, type ContractConfig, type ContractDefinition, type ContractInput, type ContractModelBuilder, type DeferredIndexColumn, type DeferredIndexExpression, type DeferredIndexOptions, type EnumMember, type EnumTypeHandle, type ExtractCodecTypesFromPack, type FieldNode, type ForeignKeyModelReference, type ForeignKeyNode, type ForeignKeyTableReference, type IndexConstraint, type IndexExpressionInput, type IndexNode, type IndexOptionsFunction, type IndexOptionsInput, type ManyOptions, type MergeEnums, type ModelLike, type ModelNode, type PrimaryKeyNode, type RelationNode, type ScalarFieldBuilder, type ScalarMemberNode, type SqlExpression, type SqlNamespaceFactory, type TableNode, type TableProperties, type TargetFieldRef, type UniqueConstraintNode, type ValueObjectFieldNode, type ValueObjectMemberNode, type ValueObjectNode, applySqlSpecifierControlPolicy, autoincrement, bindEnumType, buildBoundContract, buildContractDefinition, buildSqlContractFromDefinition, check, composedExtensionPackRefs, createComposedAuthoringHelpers, defineContract, emptyContract, enumType, extensionModel, field, isValueObjectMember, member, model, now, rel, sql, storedAsListColumn, typescriptContract, typescriptContractFromPath };
|
|
5
|
+
export { type AttachedEntities, type AuthoredColumnDefault, type AuthoredColumnDefaultLiteralValue, type BoundEnumType, type CheckNode, type CodecInput, type CodecTypeMap, type ColumnNode, type ColumnRef, type ComposedAuthoringHelpers, type ContractConfig, type ContractDefinition, type ContractInput, type ContractModelBuilder, type DeferredIndexColumn, type DeferredIndexExpression, type DeferredIndexOptions, type EnumMember, type EnumTypeHandle, type ExtractCodecTypesFromPack, type FieldNode, type ForeignKeyModelReference, type ForeignKeyNode, type ForeignKeyTableReference, type IndexConstraint, type IndexExpressionInput, type IndexNode, type IndexOptionsFunction, type IndexOptionsInput, type ManyOptions, type MergeEnums, type ModelLike, type ModelNode, type PrimaryKeyNode, type RelationNode, type ScalarFieldBuilder, type ScalarMemberNode, type SqlExpression, type SqlNamespaceFactory, type TableNode, type TableProperties, type TargetFieldRef, type UniqueConstraintNode, type ValueObjectFieldNode, type ValueObjectMemberNode, type ValueObjectNode, applySqlSpecifierControlPolicy, autoincrement, bindEnumType, buildBoundContract, buildContractDefinition, buildSqlContractFromDefinition, check, composedExtensionPackRefs, createComposedAuthoringHelpers, defineContract, emptyContract, enumType, extensionModel, field, isValueObjectMember, member, model, now, rel, sql, storedAsListColumn, typescriptContract, typescriptContractFromPath, unbound };
|
package/dist/contract-ts.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { l as sql } from "./sql-expression-CKgKznXS.mjs";
|
|
2
2
|
import { i as isValueObjectMember, n as buildSqlContractFromDefinition, o as storedAsListColumn, t as applySqlSpecifierControlPolicy } from "./derived-checks-zjkmqsa_-D7VKKK_q.mjs";
|
|
3
|
-
import { a as check, c as defineContract, d as field, f as member, h as rel, i as buildContractDefinition, l as enumType, m as now, n as bindEnumType, o as composedExtensionPackRefs, p as model, r as buildBoundContract, s as createComposedAuthoringHelpers, t as autoincrement, u as extensionModel } from "./contract-builder-
|
|
3
|
+
import { a as check, c as defineContract, d as field, f as member, g as unbound, h as rel, i as buildContractDefinition, l as enumType, m as now, n as bindEnumType, o as composedExtensionPackRefs, p as model, r as buildBoundContract, s as createComposedAuthoringHelpers, t as autoincrement, u as extensionModel } from "./contract-builder-m9XW9MgR.mjs";
|
|
4
4
|
import { n as typescriptContract, r as typescriptContractFromPath, t as emptyContract } from "./config-types-BSn4oo7q.mjs";
|
|
5
|
-
export { applySqlSpecifierControlPolicy, autoincrement, bindEnumType, buildBoundContract, buildContractDefinition, buildSqlContractFromDefinition, check, composedExtensionPackRefs, createComposedAuthoringHelpers, defineContract, emptyContract, enumType, extensionModel, field, isValueObjectMember, member, model, now, rel, sql, storedAsListColumn, typescriptContract, typescriptContractFromPath };
|
|
5
|
+
export { applySqlSpecifierControlPolicy, autoincrement, bindEnumType, buildBoundContract, buildContractDefinition, buildSqlContractFromDefinition, check, composedExtensionPackRefs, createComposedAuthoringHelpers, defineContract, emptyContract, enumType, extensionModel, field, isValueObjectMember, member, model, now, rel, sql, storedAsListColumn, typescriptContract, typescriptContractFromPath, unbound };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { n as applySqlSpecifierControlPolicy, t as SqlNamespaceFactory } from "./derived-checks-DpPkO6Dt-CQIM17j5.mjs";
|
|
2
2
|
import { r as SqlExpression, u as sql } from "./sql-expression-1yO8GiBc.mjs";
|
|
3
|
-
import { $ as enumType, A as MergeEnums, B as UniqueConstraintNode, C as ForeignKeyTableReference, D as IndexOptionsFunction, E as IndexNode, F as ScalarFieldBuilder, G as bindEnumType, H as ValueObjectMemberNode, I as ScalarMemberNode, J as buildSqlContractFromDefinition, K as buildBoundContract, L as TableNode, M as ModelNode, N as PrimaryKeyNode, O as IndexOptionsInput, P as RelationNode, Q as defineContract, R as TableProperties, S as ForeignKeyNode, T as IndexExpressionInput, U as ValueObjectNode, V as ValueObjectFieldNode, W as autoincrement, X as composedExtensionPackRefs, Y as check, Z as createComposedAuthoringHelpers, _ as EnumMember, a as CheckNode, at as now, b as FieldNode, c as ColumnNode, d as ContractDefinition, et as extensionModel, f as ContractInput, g as DeferredIndexOptions, h as DeferredIndexExpression, i as BoundEnumType, it as model, j as ModelLike, k as ManyOptions, l as ColumnRef, m as DeferredIndexColumn, n as AuthoredColumnDefault, nt as isValueObjectMember, o as CodecInput, ot as rel, p as ContractModelBuilder, q as buildContractDefinition, r as AuthoredColumnDefaultLiteralValue, rt as member, s as CodecTypeMap, st as storedAsListColumn, t as AttachedEntities, tt as field, u as ComposedAuthoringHelpers, v as EnumTypeHandle, w as IndexConstraint, x as ForeignKeyModelReference, y as ExtractCodecTypesFromPack, z as TargetFieldRef } from "./contract-builder-
|
|
4
|
-
export { type AttachedEntities, type AuthoredColumnDefault, type AuthoredColumnDefaultLiteralValue, type BoundEnumType, type CheckNode, type CodecInput, type CodecTypeMap, type ColumnNode, type ColumnRef, type ComposedAuthoringHelpers, type ContractDefinition, type ContractInput, type ContractModelBuilder, type DeferredIndexColumn, type DeferredIndexExpression, type DeferredIndexOptions, type EnumMember, type EnumTypeHandle, type ExtractCodecTypesFromPack, type FieldNode, type ForeignKeyModelReference, type ForeignKeyNode, type ForeignKeyTableReference, type IndexConstraint, type IndexExpressionInput, type IndexNode, type IndexOptionsFunction, type IndexOptionsInput, type ManyOptions, type MergeEnums, type ModelLike, type ModelNode, type PrimaryKeyNode, type RelationNode, type ScalarFieldBuilder, type ScalarMemberNode, type SqlExpression, type SqlNamespaceFactory, type TableNode, type TableProperties, type TargetFieldRef, type UniqueConstraintNode, type ValueObjectFieldNode, type ValueObjectMemberNode, type ValueObjectNode, applySqlSpecifierControlPolicy, autoincrement, bindEnumType, buildBoundContract, buildContractDefinition, buildSqlContractFromDefinition, check, composedExtensionPackRefs, createComposedAuthoringHelpers, defineContract, enumType, extensionModel, field, isValueObjectMember, member, model, now, rel, sql, storedAsListColumn };
|
|
3
|
+
import { $ as enumType, A as MergeEnums, B as UniqueConstraintNode, C as ForeignKeyTableReference, D as IndexOptionsFunction, E as IndexNode, F as ScalarFieldBuilder, G as bindEnumType, H as ValueObjectMemberNode, I as ScalarMemberNode, J as buildSqlContractFromDefinition, K as buildBoundContract, L as TableNode, M as ModelNode, N as PrimaryKeyNode, O as IndexOptionsInput, P as RelationNode, Q as defineContract, R as TableProperties, S as ForeignKeyNode, T as IndexExpressionInput, U as ValueObjectNode, V as ValueObjectFieldNode, W as autoincrement, X as composedExtensionPackRefs, Y as check, Z as createComposedAuthoringHelpers, _ as EnumMember, a as CheckNode, at as now, b as FieldNode, c as ColumnNode, ct as unbound, d as ContractDefinition, et as extensionModel, f as ContractInput, g as DeferredIndexOptions, h as DeferredIndexExpression, i as BoundEnumType, it as model, j as ModelLike, k as ManyOptions, l as ColumnRef, m as DeferredIndexColumn, n as AuthoredColumnDefault, nt as isValueObjectMember, o as CodecInput, ot as rel, p as ContractModelBuilder, q as buildContractDefinition, r as AuthoredColumnDefaultLiteralValue, rt as member, s as CodecTypeMap, st as storedAsListColumn, t as AttachedEntities, tt as field, u as ComposedAuthoringHelpers, v as EnumTypeHandle, w as IndexConstraint, x as ForeignKeyModelReference, y as ExtractCodecTypesFromPack, z as TargetFieldRef } from "./contract-builder-BfPC4mQK.mjs";
|
|
4
|
+
export { type AttachedEntities, type AuthoredColumnDefault, type AuthoredColumnDefaultLiteralValue, type BoundEnumType, type CheckNode, type CodecInput, type CodecTypeMap, type ColumnNode, type ColumnRef, type ComposedAuthoringHelpers, type ContractDefinition, type ContractInput, type ContractModelBuilder, type DeferredIndexColumn, type DeferredIndexExpression, type DeferredIndexOptions, type EnumMember, type EnumTypeHandle, type ExtractCodecTypesFromPack, type FieldNode, type ForeignKeyModelReference, type ForeignKeyNode, type ForeignKeyTableReference, type IndexConstraint, type IndexExpressionInput, type IndexNode, type IndexOptionsFunction, type IndexOptionsInput, type ManyOptions, type MergeEnums, type ModelLike, type ModelNode, type PrimaryKeyNode, type RelationNode, type ScalarFieldBuilder, type ScalarMemberNode, type SqlExpression, type SqlNamespaceFactory, type TableNode, type TableProperties, type TargetFieldRef, type UniqueConstraintNode, type ValueObjectFieldNode, type ValueObjectMemberNode, type ValueObjectNode, applySqlSpecifierControlPolicy, autoincrement, bindEnumType, buildBoundContract, buildContractDefinition, buildSqlContractFromDefinition, check, composedExtensionPackRefs, createComposedAuthoringHelpers, defineContract, enumType, extensionModel, field, isValueObjectMember, member, model, now, rel, sql, storedAsListColumn, unbound };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { l as sql } from "./sql-expression-CKgKznXS.mjs";
|
|
2
2
|
import { i as isValueObjectMember, n as buildSqlContractFromDefinition, o as storedAsListColumn, t as applySqlSpecifierControlPolicy } from "./derived-checks-zjkmqsa_-D7VKKK_q.mjs";
|
|
3
|
-
import { a as check, c as defineContract, d as field, f as member, h as rel, i as buildContractDefinition, l as enumType, m as now, n as bindEnumType, o as composedExtensionPackRefs, p as model, r as buildBoundContract, s as createComposedAuthoringHelpers, t as autoincrement, u as extensionModel } from "./contract-builder-
|
|
4
|
-
export { applySqlSpecifierControlPolicy, autoincrement, bindEnumType, buildBoundContract, buildContractDefinition, buildSqlContractFromDefinition, check, composedExtensionPackRefs, createComposedAuthoringHelpers, defineContract, enumType, extensionModel, field, isValueObjectMember, member, model, now, rel, sql, storedAsListColumn };
|
|
3
|
+
import { a as check, c as defineContract, d as field, f as member, g as unbound, h as rel, i as buildContractDefinition, l as enumType, m as now, n as bindEnumType, o as composedExtensionPackRefs, p as model, r as buildBoundContract, s as createComposedAuthoringHelpers, t as autoincrement, u as extensionModel } from "./contract-builder-m9XW9MgR.mjs";
|
|
4
|
+
export { applySqlSpecifierControlPolicy, autoincrement, bindEnumType, buildBoundContract, buildContractDefinition, buildSqlContractFromDefinition, check, composedExtensionPackRefs, createComposedAuthoringHelpers, defineContract, enumType, extensionModel, field, isValueObjectMember, member, model, now, rel, sql, storedAsListColumn, unbound };
|
package/dist/contract.d.mts
CHANGED
|
@@ -9,7 +9,7 @@ import { _ as nonEmptyTypeParams, a as SqlNamespaceBase, c as SqlNamespaceInput,
|
|
|
9
9
|
import { i as indexInputFromSerialized, n as SerializedIndex, r as checkConstraintInputFromSerialized, t as SerializedCheckConstraint } from "./serialized-index-CrgG8ct1-Duy5-kFV.mjs";
|
|
10
10
|
import { A as ResolveCodecTypes, C as NamespacedStorageColumnTypeMap, D as QueryOperationTypesBase, E as QueryOperationTypeEntry, F as StorageColumnInputTypesOf, I as StorageColumnTypesOf, L as TypeMaps, M as SqlModelFieldStorage, N as SqlModelStorage, O as QueryOperationTypesFunction, P as SqlQueryOperationTypes, R as TypeMapsPhantomKey, S as NamespacedFieldTypeMap, T as QueryOperationSelfSpec, _ as ExtractStorageColumnTypes, a as AggregateTypesOf, b as FieldOutputTypesOf, c as ContractWithTypeMaps, d as ExtractAggregateTypes, f as ExtractCodecTypes, g as ExtractStorageColumnInputTypes, h as ExtractQueryOperationTypes, i as AggregateTypesFromDescriptors, j as SqlControlDriverInstance, k as QueryOperationTypesOf, l as DEFAULT_FK_CONSTRAINT, m as ExtractFieldOutputTypes, n as AggregateResultType, o as ApplyQueryOperationTypes, p as ExtractFieldInputTypes, r as AggregateTypesBase, s as CodecTypesOf, t as AggregateOperationTypes, u as DEFAULT_FK_INDEX, v as ExtractTypeMapsFromContract, w as QueryOperationReturn, x as ForeignKeyOptions, y as FieldInputTypesOf, z as applyFkDefaults } from "./types-DNTLudNR-DiVulPhL.mjs";
|
|
11
11
|
import { a as RelationNamesOf, c as ShapeSpec, i as RelationKeys, l as StorageColumnMapAt, n as HasExecutionCreateDefault, o as Scalars, r as IsOptionalCreateColumn, s as Shape, t as ColumnTypesFromStorage, u as StorageColumnTypeAcrossNamespaces } from "./types-CXRxo_TK.mjs";
|
|
12
|
-
import { a as ResolvedPackEntityHandle, c as SqlNameUniqueAcrossNamespacesOutput, d as providesPslEntityPlacement, f as requiresNameUniqueAcrossNamespaces, i as ResolvedEntityHandleRef, l as SqlPslEntityPlacementOutput, n as LoweredPackEntity, o as ResolvedPslModelRefs, r as PackEntityHandle, s as SqlEntityHandleLoweringContribution, t as EntityHandleLoweringInput, u as providesEntityHandleLowering } from "./entity-handle-lowering-hook-
|
|
12
|
+
import { a as ResolvedPackEntityHandle, c as SqlNameUniqueAcrossNamespacesOutput, d as providesPslEntityPlacement, f as requiresNameUniqueAcrossNamespaces, i as ResolvedEntityHandleRef, l as SqlPslEntityPlacementOutput, n as LoweredPackEntity, o as ResolvedPslModelRefs, r as PackEntityHandle, s as SqlEntityHandleLoweringContribution, t as EntityHandleLoweringInput, u as providesEntityHandleLowering } from "./entity-handle-lowering-hook-BzQxbmYy.mjs";
|
|
13
13
|
import { a as assertNothingCastsFromSqlExpression, c as readSqlExpression, d as sqlExpressionAuthoringEntry, f as sqlExpressionDataType, g as storedSqlText, h as sqlTextsReadBack, i as SqlExpressionRegistration, l as requireSqlExpression, m as sqlTextFromStored, n as SQL_EXPRESSION_TAG, o as isSqlExpression, p as sqlExpressionRegistration, r as SqlExpression, s as printSqlExpressionLiteral, t as SQL_EXPRESSION_DATA_TYPE_ID, u as sql } from "./sql-expression-1yO8GiBc.mjs";
|
|
14
14
|
import { a as IndexTypeRegistry, c as defineIndexTypes, i as IndexTypeRegistration, l as indexTypeRegistryOf, n as IndexTypeEntry, o as accessMethodOf, r as IndexTypeMap, s as createIndexTypeRegistry, t as IndexTypeBuilder, u as rendersIndexBody } from "./index-types-H1O43iYT-BD0VwPqV.mjs";
|
|
15
15
|
import "./index-types-snhtt_Fo.mjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ResolvedPackEntityHandle, c as SqlNameUniqueAcrossNamespacesOutput, d as providesPslEntityPlacement, f as requiresNameUniqueAcrossNamespaces, i as ResolvedEntityHandleRef, l as SqlPslEntityPlacementOutput, n as LoweredPackEntity, o as ResolvedPslModelRefs, r as PackEntityHandle, s as SqlEntityHandleLoweringContribution, t as EntityHandleLoweringInput, u as providesEntityHandleLowering } from "./entity-handle-lowering-hook-
|
|
1
|
+
import { a as ResolvedPackEntityHandle, c as SqlNameUniqueAcrossNamespacesOutput, d as providesPslEntityPlacement, f as requiresNameUniqueAcrossNamespaces, i as ResolvedEntityHandleRef, l as SqlPslEntityPlacementOutput, n as LoweredPackEntity, o as ResolvedPslModelRefs, r as PackEntityHandle, s as SqlEntityHandleLoweringContribution, t as EntityHandleLoweringInput, u as providesEntityHandleLowering } from "./entity-handle-lowering-hook-BzQxbmYy.mjs";
|
|
2
2
|
export { type EntityHandleLoweringInput, type LoweredPackEntity, type PackEntityHandle, type ResolvedEntityHandleRef, type ResolvedPackEntityHandle, type ResolvedPslModelRefs, type SqlEntityHandleLoweringContribution, type SqlNameUniqueAcrossNamespacesOutput, type SqlPslEntityPlacementOutput, providesEntityHandleLowering, providesPslEntityPlacement, requiresNameUniqueAcrossNamespaces };
|
|
@@ -4,6 +4,7 @@ import { n as declaredJsonType } from "./codec-json-type-DUWyBtJk-BVTavkH0.mjs";
|
|
|
4
4
|
import { n as isStorageValueSet } from "./storage-value-set-uGUEBAMJ-hX-zFqN5.mjs";
|
|
5
5
|
import { n as reachesAny, r as referenceKey } from "./check-expressions-Mmzgx0XE.mjs";
|
|
6
6
|
import { _ as unquotedSqlBaseName, a as renderSqlTypeName, c as sameSqlColumnType, m as sqlStorageType, n as isSqlDataType, p as sqlDataTypeOfCodec, r as nameIsCatalogText, u as sqlCodecColumnLength, y as validateSqlTypeParams } from "./sql-data-type-LVBldu1a-Bq203xWX.mjs";
|
|
7
|
+
import { r as requiresNameUniqueAcrossNamespaces } from "./entity-handle-lowering-hook-3KYrW-BT.mjs";
|
|
7
8
|
import { s as StorageTable } from "./storage-table-B_MrLtQX-eWx6BgGT.mjs";
|
|
8
9
|
import { c as SqlSchemaIR, n as RelationalSchemaNodeKind, u as SqlTableIR } from "./types-1ZKE0deC-Dou4ugcz.mjs";
|
|
9
10
|
import { f as sqlExpressionRegistration, m as sqlTextsReadBack, o as printSqlExpressionLiteral } from "./sql-expression-CKgKznXS.mjs";
|
|
@@ -12,14 +13,14 @@ import { g as valueObjectStorageTypeMissingMessage } from "./validators-qcQteqs2
|
|
|
12
13
|
import { a as describeUnsupportedSqlAttribute, b as sqlAttributeSpecs } from "./psl-field-resolution-GN4iup8d-CcMRk9It.mjs";
|
|
13
14
|
import { t as describeUnresolvedSqlType } from "./diagnostics-CSrneG0n.mjs";
|
|
14
15
|
import { t as sqlEmission } from "./dist-BJjqJT_M.mjs";
|
|
15
|
-
import { a as sqlFamilyGeneratorFunctions, i as sqlFamilyGeneratorDescriptors, n as sqlFamilyAuthoringTypes, o as sqlFamilyPslBlockDescriptors, r as sqlFamilyEntityTypes } from "./generator-functions-Hy4pDDr9-
|
|
16
|
+
import { a as sqlFamilyGeneratorFunctions, i as sqlFamilyGeneratorDescriptors, n as sqlFamilyAuthoringTypes, o as sqlFamilyPslBlockDescriptors, r as sqlFamilyEntityTypes } from "./generator-functions-Hy4pDDr9-DkN0qbPW.mjs";
|
|
16
17
|
import { c as verifySqlSchemaByDiff, n as classifyDiffSubjectGranularity, o as enforceSqlDataTypeInvariants, t as classifyDiffEntityKind } from "./schema-verify-C3wbdviw-nQ4tG9N7.mjs";
|
|
17
18
|
import { t as sqlFamilyError } from "./errors-B5g0xWro-C8plbqga.mjs";
|
|
18
19
|
import { t as SqlContractSerializer } from "./sql-contract-serializer-sMY3prTx-BfYfhVR_.mjs";
|
|
19
20
|
import { t as collectSupportedCodecTypeIds } from "./verify-BVk5bjdH-DhKm6hB3.mjs";
|
|
20
21
|
import { isStructuredError, structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
21
22
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
22
|
-
import { collectScalarTypeConstructors, isAuthoringTypeChoiceDescriptor, isAuthoringTypeConstructorDescriptor, tsTaggedTemplateSource } from "@prisma/orm-framework/components/authoring";
|
|
23
|
+
import { collectScalarTypeConstructors, isAuthoringEntityTypeDescriptor, isAuthoringTypeChoiceDescriptor, isAuthoringTypeConstructorDescriptor, tsTaggedTemplateSource } from "@prisma/orm-framework/components/authoring";
|
|
23
24
|
import { ContractValidationError } from "@prisma/orm-framework/contract/contract-validation-error";
|
|
24
25
|
import { UNBOUND_NAMESPACE_ID, isPlainRecord } from "@prisma/orm-framework/components/ir";
|
|
25
26
|
import { asNamespaceId, governingControlPolicy, valueObjectAt, valueObjectsWithCoordinates } from "@prisma/orm-framework/contract/types";
|
|
@@ -29,6 +30,7 @@ import { canonicalizeJson } from "@prisma/orm-framework/components/utils";
|
|
|
29
30
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
30
31
|
import { InternalError, isInternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
31
32
|
import { type } from "arktype";
|
|
33
|
+
import { UNBOUND_PSL_NAMESPACE_NAME } from "@prisma/orm-framework/components/psl-ast";
|
|
32
34
|
import { notOk, ok } from "@prisma/orm-framework/utils/result";
|
|
33
35
|
import { APP_SPACE_ID, SchemaTreeNode, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_TARGET_MISMATCH, assembleAuthoringContributions as assembleAuthoringContributions$1, describeMigrationStatement, enumValueStatementText, extractCodecLookup, fieldStatementText, issueOutcome, migrationRunnerFailure, modelDisplayName, modelStatementText, sameMarkerHashes, valueObjectFieldStatementText } from "@prisma/orm-framework/components/control";
|
|
34
36
|
import { assertDescriptorSelfConsistency } from "@prisma/orm-toolchain/migration-tools/spaces";
|
|
@@ -351,6 +353,45 @@ function assertNoCrossSpaceFkReverseReferences(extensions) {
|
|
|
351
353
|
}
|
|
352
354
|
}
|
|
353
355
|
}
|
|
356
|
+
/** The discriminators of the composed entity types whose names are unique across namespaces. */
|
|
357
|
+
function entityKindsNamedOnce(entityTypes) {
|
|
358
|
+
return Object.values(entityTypes).flatMap((value) => {
|
|
359
|
+
if (!isAuthoringEntityTypeDescriptor(value)) return entityKindsNamedOnce(value);
|
|
360
|
+
return requiresNameUniqueAcrossNamespaces(value.output) ? [value.discriminator] : [];
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Checks the packs' entities of a kind whose names are unique across namespaces, such as a Postgres extension: each must be in the unbound namespace, and no two packs may declare the same one.
|
|
365
|
+
*/
|
|
366
|
+
function assertPackEntitiesDeclaredOnce(extensions, entityTypes) {
|
|
367
|
+
for (const kind of entityKindsNamedOnce(entityTypes)) {
|
|
368
|
+
const declaringPack = /* @__PURE__ */ new Map();
|
|
369
|
+
for (const ext of extensions) {
|
|
370
|
+
const namespaces = ext.contractSpace?.contractJson?.storage?.namespaces;
|
|
371
|
+
if (!isObjectRecord(namespaces)) continue;
|
|
372
|
+
for (const [namespaceId, ns] of Object.entries(namespaces)) {
|
|
373
|
+
if (!isObjectRecord(ns) || !isObjectRecord(ns["entries"])) continue;
|
|
374
|
+
const declared = ns["entries"][kind];
|
|
375
|
+
if (!isObjectRecord(declared)) continue;
|
|
376
|
+
for (const name of Object.keys(declared)) {
|
|
377
|
+
if (namespaceId !== UNBOUND_NAMESPACE_ID) throw sqlFamilyError("CONTRACT.PACK_CONTRIBUTION_INVALID", `Extension pack "${ext.id}" declares ${kind} "${name}" in namespace "${namespaceId}". A pack declares each ${kind} in namespace "${UNBOUND_PSL_NAMESPACE_NAME}", so the connection's search path finds it.`, { meta: {
|
|
378
|
+
entityKind: kind,
|
|
379
|
+
entityName: name,
|
|
380
|
+
packId: ext.id,
|
|
381
|
+
namespaceId
|
|
382
|
+
} });
|
|
383
|
+
const earlier = declaringPack.get(name);
|
|
384
|
+
if (earlier !== void 0 && earlier !== ext.id) throw sqlFamilyError("CONTRACT.PACK_CONTRIBUTION_INVALID", `Extension packs "${earlier}" and "${ext.id}" both declare ${kind} "${name}". Each ${kind} can be declared by one contract space only; compose only one of these packs.`, { meta: {
|
|
385
|
+
entityKind: kind,
|
|
386
|
+
entityName: name,
|
|
387
|
+
packIds: [earlier, ext.id]
|
|
388
|
+
} });
|
|
389
|
+
declaringPack.set(name, ext.id);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
354
395
|
function createSqlFamilyInstance(stack) {
|
|
355
396
|
enforceSqlDataTypeInvariants(stack.declaredDataTypes, stack.codecDescriptors);
|
|
356
397
|
if (!stack.adapter) throw new InternalError("SQL family requires an adapter descriptor in ControlStack");
|
|
@@ -369,6 +410,7 @@ function createSqlFamilyInstance(stack) {
|
|
|
369
410
|
});
|
|
370
411
|
}
|
|
371
412
|
assertNoCrossSpaceFkReverseReferences(extensions);
|
|
413
|
+
assertPackEntitiesDeclaredOnce(extensions, stack.authoringContributions.entityTypes);
|
|
372
414
|
const { codecTypeImports, extensionIds } = stack;
|
|
373
415
|
let controlAdapter;
|
|
374
416
|
const getControlAdapter = () => controlAdapter ??= adapter.create(stack);
|
|
@@ -4254,4 +4296,4 @@ var control_default = new SqlFamilyDescriptor();
|
|
|
4254
4296
|
//#endregion
|
|
4255
4297
|
export { requiredColumnsOfMigration as $, jsonPathText as A, planFieldEventOperations as B, fieldEventStorage as C, fillKeyProblem as D, fieldStatementColumns as E, parseJsonPath as F, planVariantRowRewrites as G, planStoredRewrites as H, partitionCallsByControlPolicy as I, readColumnDefault as J, plannerFailure as K, partitionIssuesByControlPolicy as L, keyPathOf as M, modelRenameStorageEffect as N, fillValueProblem as O, otherSpaceDeclaring as P, requiredColumnOf as Q, planEnumValueRewrites as R, encodeStoredValue as S, unnamedFieldFillOf as St, fieldRenameStorageEffect as T, planValueObjectFieldFills as U, planStatements as V, planValueObjectFieldRewrites as W, removalsOfMigration as X, readReportedDefault as Y, requiredColumnMeta as Z, convertedColumnOf as _, subjectsOfCalls as _t, UnfilledValue as a, rowsWithoutValueFailure as at, detectDestructiveChanges as b, unmatchedColumnRename as bt, assembleAuthoringContributions$1 as c, runnerSuccess as ct, columnTakesTemporaryValue as d, sqlDefaultFunctions as dt, resolveColumnRenameAgainst as et, contractColumns as f, sqlOfSlot as ft, convertedColumnMeta as g, storedValueSubjects as gt, control_default as h, storedValueOperationIndexes as ht, TABLE_NAME_CASE_CHANGED_CODE as i, rowsHoldingValueOf as it, keepRowsEdit as j, isUnfilledSlot as k, backfillOfDefaultedField as l, scalarTypeNamesOf as lt, contractToSchemaIR as m, storageNameOfOperation as mt, INIT_ADDITIVE_POLICY as n, rowsHoldingValueFailure as nt, acceptedByDataType as o, rowsWithoutValueSummary as ot, contractNamespaceToSchemaIR as p, sqlTypeLookupsOf as pt, plannerSuccess as q, NO_RENAMED_ORIGINS as r, rowsHoldingValueMeta as rt, appliedStatementsInOrder as s, runnerFailure as st, COLUMN_RENAME_UNMATCHED_CODE as t, resolveTableRenameAgainst as tt, checkSqlExpressionText as u, slotSource as ut, createMigrationPlan as v, unconvertedFieldOf as vt, fieldOfColumn as w, detectTableNameCaseChanges as x, unmatchedTableRename as xt, createSqlTextSources as y, unknownCallNames as yt, planFieldEventCalls as z };
|
|
4256
4298
|
|
|
4257
|
-
//# sourceMappingURL=control-
|
|
4299
|
+
//# sourceMappingURL=control-DcEzEBvW.mjs.map
|