@prisma/orm-target-postgres 8.0.0-rc.8-dev.16 → 8.0.0-rc.8-dev.18
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/{adapter-CN1viBBx-EQPdOwKw.mjs → adapter-BO4-D_sb-Dv6OpO1E.mjs} +4 -4
- package/dist/{adapter-CN1viBBx-EQPdOwKw.mjs.map → adapter-BO4-D_sb-Dv6OpO1E.mjs.map} +1 -1
- package/dist/{adapter-CPesdzv0.d.mts → adapter-BQrsKoUs.d.mts} +2 -2
- package/dist/{adapter-CPesdzv0.d.mts.map → adapter-BQrsKoUs.d.mts.map} +1 -1
- package/dist/adapter.d.mts +6 -6
- package/dist/adapter.mjs +3 -3
- package/dist/adapter__adapter.d.mts +1 -1
- package/dist/adapter__adapter.mjs +1 -1
- package/dist/adapter__control.d.mts +1 -1
- package/dist/adapter__control.mjs +2 -2
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.d.mts +1 -1
- package/dist/adapter__runtime.mjs +3 -3
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/adapter__sql-renderer.d.mts +1 -1
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/adapter__types.d.mts +2 -2
- package/dist/{check-expressions-DRgG8RN5-DiA-22aC.d.mts → check-expressions-D4R7JhiZ-q-dFPGT2.d.mts} +7 -9
- package/dist/check-expressions-D4R7JhiZ-q-dFPGT2.d.mts.map +1 -0
- package/dist/{check-expressions-B3Xp6IFg-BzCFYrC9.mjs → check-expressions-DFTeR0rd-CSxSpyMV.mjs} +13 -10
- package/dist/check-expressions-DFTeR0rd-CSxSpyMV.mjs.map +1 -0
- package/dist/{control-Cak3bYTc.mjs → control-8vja0qTt.mjs} +3 -3
- package/dist/{control-Cak3bYTc.mjs.map → control-8vja0qTt.mjs.map} +1 -1
- package/dist/{control-adapter-BooAiwn7-Dvrq9-1t.mjs → control-adapter-BM70RkWS-kIC873DD.mjs} +3 -3
- package/dist/{control-adapter-BooAiwn7-Dvrq9-1t.mjs.map → control-adapter-BM70RkWS-kIC873DD.mjs.map} +1 -1
- package/dist/{control-DLTOAEHj.d.mts → control-xdW1bgaP.d.mts} +3 -3
- package/dist/{control-DLTOAEHj.d.mts.map → control-xdW1bgaP.d.mts.map} +1 -1
- package/dist/{descriptor-meta-CTUYG3H7-BupKx02f.mjs → descriptor-meta-DcyEqysx-CR7vdo-V.mjs} +3 -3
- package/dist/{descriptor-meta-CTUYG3H7-BupKx02f.mjs.map → descriptor-meta-DcyEqysx-CR7vdo-V.mjs.map} +1 -1
- package/dist/{descriptor-meta-DM5W6DNx-NUe3nNdU.mjs → descriptor-meta-zQNj82MZ-CDwEiYdj.mjs} +3 -3
- package/dist/{descriptor-meta-DM5W6DNx-NUe3nNdU.mjs.map → descriptor-meta-zQNj82MZ-CDwEiYdj.mjs.map} +1 -1
- package/dist/{pack-D56Ming6.d.mts → pack-DzIekb44.d.mts} +2 -2
- package/dist/{pack-D56Ming6.d.mts.map → pack-DzIekb44.d.mts.map} +1 -1
- package/dist/{runtime-DOXznQe0.d.mts → runtime-BdRKoWQu.d.mts} +2 -2
- package/dist/{runtime-DOXznQe0.d.mts.map → runtime-BdRKoWQu.d.mts.map} +1 -1
- package/dist/{sql-renderer-BgC0ZgLS.d.mts → sql-renderer-Cshx9dNa.d.mts} +2 -2
- package/dist/{sql-renderer-BgC0ZgLS.d.mts.map → sql-renderer-Cshx9dNa.d.mts.map} +1 -1
- package/dist/{sql-renderer-BmPxq1fp-BfTrsyXT.mjs → sql-renderer-DMMtw8lD-K9zLsg-g.mjs} +6 -80
- package/dist/sql-renderer-DMMtw8lD-K9zLsg-g.mjs.map +1 -0
- package/dist/target.d.mts +3 -3
- package/dist/target.mjs +2 -2
- package/dist/target__control.mjs +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__types.d.mts +2 -2
- package/dist/target__types.mjs +1 -1
- package/dist/{types-CjGjPLr5.d.mts → types-B4IkFolc.d.mts} +2 -2
- package/dist/{types-CjGjPLr5.d.mts.map → types-B4IkFolc.d.mts.map} +1 -1
- package/dist/types-C7BEZmFD.d.mts +1 -0
- package/dist/{types-CkryN1AS-BcQRGsDn.d.mts → types-CkryN1AS-CZtzRJFZ.d.mts} +2 -2
- package/dist/{types-CkryN1AS-BcQRGsDn.d.mts.map → types-CkryN1AS-CZtzRJFZ.d.mts.map} +1 -1
- package/package.json +9 -9
- package/dist/check-expressions-B3Xp6IFg-BzCFYrC9.mjs.map +0 -1
- package/dist/check-expressions-DRgG8RN5-DiA-22aC.d.mts.map +0 -1
- package/dist/sql-renderer-BmPxq1fp-BfTrsyXT.mjs.map +0 -1
- package/dist/types-B-4d5_4a.d.mts +0 -1
package/dist/{descriptor-meta-DM5W6DNx-NUe3nNdU.mjs.map → descriptor-meta-zQNj82MZ-CDwEiYdj.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor-meta-DM5W6DNx-NUe3nNdU.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/descriptor-meta-DM5W6DNx.mjs"],"sourcesContent":["import { n as adapterError } from \"./sql-renderer-BmPxq1fp.mjs\";\nimport { postgresCodecRegistry } from \"@internal/target-postgres/codecs\";\nimport { PG_BIT_CODEC_ID, PG_BOOL_CODEC_ID, PG_BYTEA_CODEC_ID, PG_CHAR_CODEC_ID, PG_DATE_STRING_CODEC_ID, PG_DATE_TEMPORAL_CODEC_ID, PG_FLOAT4_CODEC_ID, PG_FLOAT8_CODEC_ID, PG_FLOAT_CODEC_ID, PG_INET_CODEC_ID, PG_INT2_CODEC_ID, PG_INT4_CODEC_ID, PG_INT8_CODEC_ID, PG_INTERVAL_CODEC_ID, PG_INT_CODEC_ID, PG_JSONB_CODEC_ID, PG_JSON_CODEC_ID, PG_NUMERIC_CODEC_ID, PG_TEXT_CODEC_ID, PG_TIMESTAMPTZ_STRING_CODEC_ID, PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, PG_TIMESTAMP_STRING_CODEC_ID, PG_TIMESTAMP_TEMPORAL_CODEC_ID, PG_TIMETZ_CODEC_ID, PG_TIME_STRING_CODEC_ID, PG_TIME_TEMPORAL_CODEC_ID, PG_UUID_CODEC_ID, PG_VARBIT_CODEC_ID, PG_VARCHAR_CODEC_ID, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID } from \"@internal/target-postgres/codec-ids\";\nimport { buildOperation, toExpr } from \"@internal/sql-relational-core/expression\";\nimport { postgresAggregateDescriptors } from \"@internal/target-postgres/aggregates\";\n//#region src/core/descriptor-meta.ts\n/** Creates a type import spec for codec types */\nconst codecTypeImport = (named) => ({\n\tpackage: \"@internal/target-postgres/codec-types\",\n\tnamed,\n\talias: named\n});\nfunction isPositiveInteger(value) {\n\treturn typeof value === \"number\" && Number.isFinite(value) && Number.isInteger(value) && value > 0;\n}\nfunction isNonNegativeInteger(value) {\n\treturn typeof value === \"number\" && Number.isFinite(value) && Number.isInteger(value) && value >= 0;\n}\nfunction expandLength({ nativeType, typeParams }) {\n\tif (!typeParams || !(\"length\" in typeParams)) return nativeType;\n\tconst length = typeParams[\"length\"];\n\tif (!isPositiveInteger(length)) throw adapterError(\"RUNTIME.TYPE_PARAMS_INVALID\", `Invalid \"length\" type parameter for \"${nativeType}\": expected a positive integer, got ${JSON.stringify(length)}`, { meta: {\n\t\tnativeType,\n\t\tparam: \"length\",\n\t\treceived: length\n\t} });\n\treturn `${nativeType}(${length})`;\n}\nfunction expandPrecision({ nativeType, typeParams }) {\n\tif (!typeParams || !(\"precision\" in typeParams)) return nativeType;\n\tconst precision = typeParams[\"precision\"];\n\tif (!isNonNegativeInteger(precision)) throw adapterError(\"RUNTIME.TYPE_PARAMS_INVALID\", `Invalid \"precision\" type parameter for \"${nativeType}\": expected a non-negative integer, got ${JSON.stringify(precision)}`, { meta: {\n\t\tnativeType,\n\t\tparam: \"precision\",\n\t\treceived: precision\n\t} });\n\treturn `${nativeType}(${precision})`;\n}\nfunction expandNumeric({ nativeType, typeParams }) {\n\tconst hasPrecision = typeParams && \"precision\" in typeParams;\n\tconst hasScale = typeParams && \"scale\" in typeParams;\n\tif (!hasPrecision && !hasScale) return nativeType;\n\tif (!hasPrecision && hasScale) throw adapterError(\"RUNTIME.TYPE_PARAMS_INVALID\", `Invalid type parameters for \"${nativeType}\": \"scale\" requires \"precision\" to be specified`, { meta: {\n\t\tnativeType,\n\t\tparam: \"scale\"\n\t} });\n\tif (hasPrecision) {\n\t\tconst precision = typeParams[\"precision\"];\n\t\tif (!isPositiveInteger(precision)) throw adapterError(\"RUNTIME.TYPE_PARAMS_INVALID\", `Invalid \"precision\" type parameter for \"${nativeType}\": expected a positive integer, got ${JSON.stringify(precision)}`, { meta: {\n\t\t\tnativeType,\n\t\t\tparam: \"precision\",\n\t\t\treceived: precision\n\t\t} });\n\t\tif (hasScale) {\n\t\t\tconst scale = typeParams[\"scale\"];\n\t\t\tif (!isNonNegativeInteger(scale)) throw adapterError(\"RUNTIME.TYPE_PARAMS_INVALID\", `Invalid \"scale\" type parameter for \"${nativeType}\": expected a non-negative integer, got ${JSON.stringify(scale)}`, { meta: {\n\t\t\t\tnativeType,\n\t\t\t\tparam: \"scale\",\n\t\t\t\treceived: scale\n\t\t\t} });\n\t\t\treturn `${nativeType}(${precision},${scale})`;\n\t\t}\n\t\treturn `${nativeType}(${precision})`;\n\t}\n\treturn nativeType;\n}\nconst lengthHooks = { expandNativeType: expandLength };\nconst precisionHooks = { expandNativeType: expandPrecision };\nconst numericHooks = { expandNativeType: expandNumeric };\nconst identityHooks = { expandNativeType: ({ nativeType }) => nativeType };\nfunction postgresQueryOperations() {\n\treturn { ilike: {\n\t\tself: { traits: [\"textual\"] },\n\t\timpl: (self, pattern) => {\n\t\t\treturn buildOperation({\n\t\t\t\tmethod: \"ilike\",\n\t\t\t\targs: [toExpr(self), toExpr(pattern, { codecId: PG_TEXT_CODEC_ID })],\n\t\t\t\treturns: {\n\t\t\t\t\tcodecId: PG_BOOL_CODEC_ID,\n\t\t\t\t\tnullable: false\n\t\t\t\t},\n\t\t\t\tlowering: {\n\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\tstrategy: \"infix\",\n\t\t\t\t\ttemplate: \"{{self}} ILIKE {{arg0}}\"\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t} };\n}\nconst postgresAdapterDescriptorMeta = {\n\tkind: \"adapter\",\n\tfamilyId: \"sql\",\n\ttargetId: \"postgres\",\n\tid: \"postgres\",\n\tversion: \"0.0.1\",\n\tcapabilities: {\n\t\tpostgres: {\n\t\t\torderBy: true,\n\t\t\tlimit: true,\n\t\t\tlateral: true,\n\t\t\tjsonAgg: true,\n\t\t\treturning: true,\n\t\t\tdistinctOn: true\n\t\t},\n\t\tsql: {\n\t\t\tenums: true,\n\t\t\treturning: true,\n\t\t\tdefaultInInsert: true,\n\t\t\tlateral: true,\n\t\t\tscalarList: true,\n\t\t\tcheckConstraint: true\n\t\t}\n\t},\n\ttypes: {\n\t\taggregateDescriptors: postgresAggregateDescriptors,\n\t\tcodecTypes: {\n\t\t\tcodecDescriptors: Array.from(postgresCodecRegistry.values()),\n\t\t\timport: {\n\t\t\t\tpackage: \"@internal/target-postgres/codec-types\",\n\t\t\t\tnamed: \"CodecTypes\",\n\t\t\t\talias: \"PgTypes\"\n\t\t\t},\n\t\t\ttypeImports: [\n\t\t\t\t{\n\t\t\t\t\tpackage: \"@internal/target-postgres/codec-types\",\n\t\t\t\t\tnamed: \"JsonValue\",\n\t\t\t\t\talias: \"JsonValue\"\n\t\t\t\t},\n\t\t\t\tcodecTypeImport(\"Char\"),\n\t\t\t\tcodecTypeImport(\"Varchar\"),\n\t\t\t\tcodecTypeImport(\"Numeric\"),\n\t\t\t\tcodecTypeImport(\"Bit\"),\n\t\t\t\tcodecTypeImport(\"VarBit\"),\n\t\t\t\tcodecTypeImport(\"Timestamp\"),\n\t\t\t\tcodecTypeImport(\"Timestamptz\"),\n\t\t\t\tcodecTypeImport(\"Time\"),\n\t\t\t\tcodecTypeImport(\"Timetz\"),\n\t\t\t\tcodecTypeImport(\"Interval\"),\n\t\t\t\tcodecTypeImport(\"TimestampString\"),\n\t\t\t\tcodecTypeImport(\"TimestamptzString\"),\n\t\t\t\tcodecTypeImport(\"TimeString\")\n\t\t\t],\n\t\t\tcontrolPlaneHooks: {\n\t\t\t\t[SQL_CHAR_CODEC_ID]: lengthHooks,\n\t\t\t\t[SQL_VARCHAR_CODEC_ID]: lengthHooks,\n\t\t\t\t[PG_CHAR_CODEC_ID]: lengthHooks,\n\t\t\t\t[PG_VARCHAR_CODEC_ID]: lengthHooks,\n\t\t\t\t[PG_NUMERIC_CODEC_ID]: numericHooks,\n\t\t\t\t[PG_BIT_CODEC_ID]: lengthHooks,\n\t\t\t\t[PG_VARBIT_CODEC_ID]: lengthHooks,\n\t\t\t\t[PG_TIMESTAMP_TEMPORAL_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_TIME_TEMPORAL_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_TIMESTAMP_STRING_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_TIMESTAMPTZ_STRING_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_TIME_STRING_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_TIMETZ_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_INTERVAL_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_JSON_CODEC_ID]: identityHooks,\n\t\t\t\t[PG_JSONB_CODEC_ID]: identityHooks,\n\t\t\t\t[PG_BYTEA_CODEC_ID]: identityHooks,\n\t\t\t\t[PG_UUID_CODEC_ID]: identityHooks,\n\t\t\t\t[PG_INET_CODEC_ID]: identityHooks\n\t\t\t}\n\t\t},\n\t\tstorage: [\n\t\t\t{\n\t\t\t\ttypeId: PG_TEXT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"text\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: SQL_TEXT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"text\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: SQL_CHAR_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"character\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: SQL_VARCHAR_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"character varying\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: SQL_INT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"int4\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: SQL_FLOAT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"float8\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_CHAR_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"character\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_VARCHAR_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"character varying\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"int4\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_FLOAT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"float8\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INT4_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"int4\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INT2_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"int2\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INT8_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"int8\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_FLOAT4_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"float4\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_FLOAT8_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"float8\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_NUMERIC_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"numeric\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_DATE_TEMPORAL_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"date\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIMESTAMP_TEMPORAL_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"timestamp\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"timestamptz\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIME_TEMPORAL_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"time\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_DATE_STRING_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"date\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIMESTAMP_STRING_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"timestamp\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIMESTAMPTZ_STRING_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"timestamptz\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIME_STRING_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"time\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIMETZ_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"timetz\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_BOOL_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"bool\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_BIT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"bit\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_VARBIT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"bit varying\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INTERVAL_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"interval\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_JSON_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"json\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_JSONB_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"jsonb\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_BYTEA_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"bytea\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_UUID_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"uuid\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INET_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"inet\"\n\t\t\t}\n\t\t],\n\t\tqueryOperationTypes: { import: {\n\t\t\tpackage: \"@internal/adapter-postgres/operation-types\",\n\t\t\tnamed: \"QueryOperationTypes\",\n\t\t\talias: \"PgAdapterQueryOps\"\n\t\t} }\n\t}\n};\n//#endregion\nexport { postgresQueryOperations as n, postgresAdapterDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-DM5W6DNx.mjs.map"],"mappings":";;;;;;;AAOA,MAAM,mBAAmB,WAAW;CACnC,SAAS;CACT;CACA,OAAO;AACR;AACA,SAAS,kBAAkB,OAAO;CACjC,OAAO,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,KAAK,OAAO,UAAU,KAAK,KAAK,QAAQ;AAClG;AACA,SAAS,qBAAqB,OAAO;CACpC,OAAO,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,KAAK,OAAO,UAAU,KAAK,KAAK,SAAS;AACnG;AACA,SAAS,aAAa,EAAE,YAAY,cAAc;CACjD,IAAI,CAAC,cAAc,EAAE,YAAY,aAAa,OAAO;CACrD,MAAM,SAAS,WAAW;CAC1B,IAAI,CAAC,kBAAkB,MAAM,GAAG,MAAM,aAAa,+BAA+B,wCAAwC,WAAW,sCAAsC,KAAK,UAAU,MAAM,KAAK,EAAE,MAAM;EAC5M;EACA,OAAO;EACP,UAAU;CACX,EAAE,CAAC;CACH,OAAO,GAAG,WAAW,GAAG,OAAO;AAChC;AACA,SAAS,gBAAgB,EAAE,YAAY,cAAc;CACpD,IAAI,CAAC,cAAc,EAAE,eAAe,aAAa,OAAO;CACxD,MAAM,YAAY,WAAW;CAC7B,IAAI,CAAC,qBAAqB,SAAS,GAAG,MAAM,aAAa,+BAA+B,2CAA2C,WAAW,0CAA0C,KAAK,UAAU,SAAS,KAAK,EAAE,MAAM;EAC5N;EACA,OAAO;EACP,UAAU;CACX,EAAE,CAAC;CACH,OAAO,GAAG,WAAW,GAAG,UAAU;AACnC;AACA,SAAS,cAAc,EAAE,YAAY,cAAc;CAClD,MAAM,eAAe,cAAc,eAAe;CAClD,MAAM,WAAW,cAAc,WAAW;CAC1C,IAAI,CAAC,gBAAgB,CAAC,UAAU,OAAO;CACvC,IAAI,CAAC,gBAAgB,UAAU,MAAM,aAAa,+BAA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;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;EACD;EACA,qBAAqB,EAAE,QAAQ;GAC9B,SAAS;GACT,OAAO;GACP,OAAO;EACR,EAAE;CACH;AACD"}
|
|
1
|
+
{"version":3,"file":"descriptor-meta-zQNj82MZ-CDwEiYdj.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/descriptor-meta-zQNj82MZ.mjs"],"sourcesContent":["import { n as adapterError } from \"./sql-renderer-DMMtw8lD.mjs\";\nimport { postgresCodecRegistry } from \"@internal/target-postgres/codecs\";\nimport { PG_BIT_CODEC_ID, PG_BOOL_CODEC_ID, PG_BYTEA_CODEC_ID, PG_CHAR_CODEC_ID, PG_DATE_STRING_CODEC_ID, PG_DATE_TEMPORAL_CODEC_ID, PG_FLOAT4_CODEC_ID, PG_FLOAT8_CODEC_ID, PG_FLOAT_CODEC_ID, PG_INET_CODEC_ID, PG_INT2_CODEC_ID, PG_INT4_CODEC_ID, PG_INT8_CODEC_ID, PG_INTERVAL_CODEC_ID, PG_INT_CODEC_ID, PG_JSONB_CODEC_ID, PG_JSON_CODEC_ID, PG_NUMERIC_CODEC_ID, PG_TEXT_CODEC_ID, PG_TIMESTAMPTZ_STRING_CODEC_ID, PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, PG_TIMESTAMP_STRING_CODEC_ID, PG_TIMESTAMP_TEMPORAL_CODEC_ID, PG_TIMETZ_CODEC_ID, PG_TIME_STRING_CODEC_ID, PG_TIME_TEMPORAL_CODEC_ID, PG_UUID_CODEC_ID, PG_VARBIT_CODEC_ID, PG_VARCHAR_CODEC_ID, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID } from \"@internal/target-postgres/codec-ids\";\nimport { buildOperation, toExpr } from \"@internal/sql-relational-core/expression\";\nimport { postgresAggregateDescriptors } from \"@internal/target-postgres/aggregates\";\n//#region src/core/descriptor-meta.ts\n/** Creates a type import spec for codec types */\nconst codecTypeImport = (named) => ({\n\tpackage: \"@internal/target-postgres/codec-types\",\n\tnamed,\n\talias: named\n});\nfunction isPositiveInteger(value) {\n\treturn typeof value === \"number\" && Number.isFinite(value) && Number.isInteger(value) && value > 0;\n}\nfunction isNonNegativeInteger(value) {\n\treturn typeof value === \"number\" && Number.isFinite(value) && Number.isInteger(value) && value >= 0;\n}\nfunction expandLength({ nativeType, typeParams }) {\n\tif (!typeParams || !(\"length\" in typeParams)) return nativeType;\n\tconst length = typeParams[\"length\"];\n\tif (!isPositiveInteger(length)) throw adapterError(\"RUNTIME.TYPE_PARAMS_INVALID\", `Invalid \"length\" type parameter for \"${nativeType}\": expected a positive integer, got ${JSON.stringify(length)}`, { meta: {\n\t\tnativeType,\n\t\tparam: \"length\",\n\t\treceived: length\n\t} });\n\treturn `${nativeType}(${length})`;\n}\nfunction expandPrecision({ nativeType, typeParams }) {\n\tif (!typeParams || !(\"precision\" in typeParams)) return nativeType;\n\tconst precision = typeParams[\"precision\"];\n\tif (!isNonNegativeInteger(precision)) throw adapterError(\"RUNTIME.TYPE_PARAMS_INVALID\", `Invalid \"precision\" type parameter for \"${nativeType}\": expected a non-negative integer, got ${JSON.stringify(precision)}`, { meta: {\n\t\tnativeType,\n\t\tparam: \"precision\",\n\t\treceived: precision\n\t} });\n\treturn `${nativeType}(${precision})`;\n}\nfunction expandNumeric({ nativeType, typeParams }) {\n\tconst hasPrecision = typeParams && \"precision\" in typeParams;\n\tconst hasScale = typeParams && \"scale\" in typeParams;\n\tif (!hasPrecision && !hasScale) return nativeType;\n\tif (!hasPrecision && hasScale) throw adapterError(\"RUNTIME.TYPE_PARAMS_INVALID\", `Invalid type parameters for \"${nativeType}\": \"scale\" requires \"precision\" to be specified`, { meta: {\n\t\tnativeType,\n\t\tparam: \"scale\"\n\t} });\n\tif (hasPrecision) {\n\t\tconst precision = typeParams[\"precision\"];\n\t\tif (!isPositiveInteger(precision)) throw adapterError(\"RUNTIME.TYPE_PARAMS_INVALID\", `Invalid \"precision\" type parameter for \"${nativeType}\": expected a positive integer, got ${JSON.stringify(precision)}`, { meta: {\n\t\t\tnativeType,\n\t\t\tparam: \"precision\",\n\t\t\treceived: precision\n\t\t} });\n\t\tif (hasScale) {\n\t\t\tconst scale = typeParams[\"scale\"];\n\t\t\tif (!isNonNegativeInteger(scale)) throw adapterError(\"RUNTIME.TYPE_PARAMS_INVALID\", `Invalid \"scale\" type parameter for \"${nativeType}\": expected a non-negative integer, got ${JSON.stringify(scale)}`, { meta: {\n\t\t\t\tnativeType,\n\t\t\t\tparam: \"scale\",\n\t\t\t\treceived: scale\n\t\t\t} });\n\t\t\treturn `${nativeType}(${precision},${scale})`;\n\t\t}\n\t\treturn `${nativeType}(${precision})`;\n\t}\n\treturn nativeType;\n}\nconst lengthHooks = { expandNativeType: expandLength };\nconst precisionHooks = { expandNativeType: expandPrecision };\nconst numericHooks = { expandNativeType: expandNumeric };\nconst identityHooks = { expandNativeType: ({ nativeType }) => nativeType };\nfunction postgresQueryOperations() {\n\treturn { ilike: {\n\t\tself: { traits: [\"textual\"] },\n\t\timpl: (self, pattern) => {\n\t\t\treturn buildOperation({\n\t\t\t\tmethod: \"ilike\",\n\t\t\t\targs: [toExpr(self), toExpr(pattern, { codecId: PG_TEXT_CODEC_ID })],\n\t\t\t\treturns: {\n\t\t\t\t\tcodecId: PG_BOOL_CODEC_ID,\n\t\t\t\t\tnullable: false\n\t\t\t\t},\n\t\t\t\tlowering: {\n\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\tstrategy: \"infix\",\n\t\t\t\t\ttemplate: \"{{self}} ILIKE {{arg0}}\"\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t} };\n}\nconst postgresAdapterDescriptorMeta = {\n\tkind: \"adapter\",\n\tfamilyId: \"sql\",\n\ttargetId: \"postgres\",\n\tid: \"postgres\",\n\tversion: \"0.0.1\",\n\tcapabilities: {\n\t\tpostgres: {\n\t\t\torderBy: true,\n\t\t\tlimit: true,\n\t\t\tlateral: true,\n\t\t\tjsonAgg: true,\n\t\t\treturning: true,\n\t\t\tdistinctOn: true\n\t\t},\n\t\tsql: {\n\t\t\tenums: true,\n\t\t\treturning: true,\n\t\t\tdefaultInInsert: true,\n\t\t\tlateral: true,\n\t\t\tscalarList: true,\n\t\t\tcheckConstraint: true\n\t\t}\n\t},\n\ttypes: {\n\t\taggregateDescriptors: postgresAggregateDescriptors,\n\t\tcodecTypes: {\n\t\t\tcodecDescriptors: Array.from(postgresCodecRegistry.values()),\n\t\t\timport: {\n\t\t\t\tpackage: \"@internal/target-postgres/codec-types\",\n\t\t\t\tnamed: \"CodecTypes\",\n\t\t\t\talias: \"PgTypes\"\n\t\t\t},\n\t\t\ttypeImports: [\n\t\t\t\t{\n\t\t\t\t\tpackage: \"@internal/target-postgres/codec-types\",\n\t\t\t\t\tnamed: \"JsonValue\",\n\t\t\t\t\talias: \"JsonValue\"\n\t\t\t\t},\n\t\t\t\tcodecTypeImport(\"Char\"),\n\t\t\t\tcodecTypeImport(\"Varchar\"),\n\t\t\t\tcodecTypeImport(\"Numeric\"),\n\t\t\t\tcodecTypeImport(\"Bit\"),\n\t\t\t\tcodecTypeImport(\"VarBit\"),\n\t\t\t\tcodecTypeImport(\"Timestamp\"),\n\t\t\t\tcodecTypeImport(\"Timestamptz\"),\n\t\t\t\tcodecTypeImport(\"Time\"),\n\t\t\t\tcodecTypeImport(\"Timetz\"),\n\t\t\t\tcodecTypeImport(\"Interval\"),\n\t\t\t\tcodecTypeImport(\"TimestampString\"),\n\t\t\t\tcodecTypeImport(\"TimestamptzString\"),\n\t\t\t\tcodecTypeImport(\"TimeString\")\n\t\t\t],\n\t\t\tcontrolPlaneHooks: {\n\t\t\t\t[SQL_CHAR_CODEC_ID]: lengthHooks,\n\t\t\t\t[SQL_VARCHAR_CODEC_ID]: lengthHooks,\n\t\t\t\t[PG_CHAR_CODEC_ID]: lengthHooks,\n\t\t\t\t[PG_VARCHAR_CODEC_ID]: lengthHooks,\n\t\t\t\t[PG_NUMERIC_CODEC_ID]: numericHooks,\n\t\t\t\t[PG_BIT_CODEC_ID]: lengthHooks,\n\t\t\t\t[PG_VARBIT_CODEC_ID]: lengthHooks,\n\t\t\t\t[PG_TIMESTAMP_TEMPORAL_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_TIME_TEMPORAL_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_TIMESTAMP_STRING_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_TIMESTAMPTZ_STRING_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_TIME_STRING_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_TIMETZ_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_INTERVAL_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_JSON_CODEC_ID]: identityHooks,\n\t\t\t\t[PG_JSONB_CODEC_ID]: identityHooks,\n\t\t\t\t[PG_BYTEA_CODEC_ID]: identityHooks,\n\t\t\t\t[PG_UUID_CODEC_ID]: identityHooks,\n\t\t\t\t[PG_INET_CODEC_ID]: identityHooks\n\t\t\t}\n\t\t},\n\t\tstorage: [\n\t\t\t{\n\t\t\t\ttypeId: PG_TEXT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"text\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: SQL_TEXT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"text\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: SQL_CHAR_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"character\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: SQL_VARCHAR_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"character varying\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: SQL_INT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"int4\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: SQL_FLOAT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"float8\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_CHAR_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"character\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_VARCHAR_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"character varying\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"int4\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_FLOAT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"float8\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INT4_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"int4\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INT2_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"int2\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INT8_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"int8\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_FLOAT4_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"float4\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_FLOAT8_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"float8\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_NUMERIC_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"numeric\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_DATE_TEMPORAL_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"date\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIMESTAMP_TEMPORAL_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"timestamp\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"timestamptz\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIME_TEMPORAL_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"time\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_DATE_STRING_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"date\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIMESTAMP_STRING_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"timestamp\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIMESTAMPTZ_STRING_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"timestamptz\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIME_STRING_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"time\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIMETZ_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"timetz\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_BOOL_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"bool\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_BIT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"bit\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_VARBIT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"bit varying\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INTERVAL_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"interval\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_JSON_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"json\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_JSONB_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"jsonb\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_BYTEA_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"bytea\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_UUID_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"uuid\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INET_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"inet\"\n\t\t\t}\n\t\t],\n\t\tqueryOperationTypes: { import: {\n\t\t\tpackage: \"@internal/adapter-postgres/operation-types\",\n\t\t\tnamed: \"QueryOperationTypes\",\n\t\t\talias: \"PgAdapterQueryOps\"\n\t\t} }\n\t}\n};\n//#endregion\nexport { postgresQueryOperations as n, postgresAdapterDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-zQNj82MZ.mjs.map"],"mappings":";;;;;;;AAOA,MAAM,mBAAmB,WAAW;CACnC,SAAS;CACT;CACA,OAAO;AACR;AACA,SAAS,kBA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ACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;EACD;EACA,qBAAqB,EAAE,QAAQ;GAC9B,SAAS;GACT,OAAO;GACP,OAAO;EACR,EAAE;CACH;AACD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as PostgresRlsPolicy } from "./postgres-rls-policy-CnDxf3z9-C3LIHAIG.mjs";
|
|
2
2
|
import { a as PostgresRlsEnablementInput, d as postgresCreateNamespace, i as PostgresRlsEnablement, n as PostgresNativeEnum, o as PostgresRole } from "./postgres-schema-Xsjt3RKO-Buv2X8ai.mjs";
|
|
3
|
-
import { i as postgresRenderCheckExpressions } from "./check-expressions-
|
|
3
|
+
import { i as postgresRenderCheckExpressions } from "./check-expressions-D4R7JhiZ-q-dFPGT2.mjs";
|
|
4
4
|
import { ot as postgresQualifyColumnType } from "./codecs-bwX5JaME-ByuPNLC5.mjs";
|
|
5
5
|
import { r as CodecTypes } from "./codec-types-X0ENu4sQ-C6GS_WDR.mjs";
|
|
6
6
|
import "@prisma/orm-framework/psl-parser";
|
|
@@ -756,4 +756,4 @@ declare const postgresTargetDescriptorMeta: typeof postgresTargetDescriptorMetaB
|
|
|
756
756
|
};
|
|
757
757
|
//#endregion
|
|
758
758
|
export { postgresTargetDescriptorMeta as t };
|
|
759
|
-
//# sourceMappingURL=pack-
|
|
759
|
+
//# sourceMappingURL=pack-DzIekb44.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack-
|
|
1
|
+
{"version":3,"file":"pack-DzIekb44.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/pack.d.mts"],"mappings":";;;;;;;;;;UASU,gCAAgC;WAC/B;;;;;;;WAOA,oBAAoB;;;UAGrB,2BAA2B;WAC1B;;;;;;;;;;;;;iBAaM,2BAA2B,OAAO,qCAAqC;;;cAG1E;WACH;WACA,yDAAyD,iBAAiB,uBAAuB;aAC/F;OACN;aACM;OACN;aACM;OACN;aACM;OACN;aACM;OACN;aACM;;WAEF;aACE;eACE;iBACE;iBACA;mBACE;mBACA;;;eAGJ;iBACE;iBACA;mBACE;mBACA;;;eAGJ;iBACE;mBACE;mBACA;qBACE;qBACA;;mBAEF;qBACE;;;;;aAKR;eACE;iBACE;iBACA;mBACE;mBACA;;;eAGJ;iBACE;iBACA;mBACE;mBACA;;;eAGJ;iBACE;iBACA;mBACE;mBACA;;;eAGJ;iBACE;iBACA;mBACE;mBACA;;;eAGJ;iBACE;iBACA;mBACE;mBACA;;;eAGJ;iBACE;iBACA;mBACE;mBACA;;;eAGJ;iBACE;iBACA;mBACE;mBACA;;;eAGJ;iBACE;iBACA;mBACE;mBACA;;;eAGJ;iBACE;iBACA;mBACE;mBACA;;;eAGJ;iBACE;mBACE;mBACA;qBACE;qBACA;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;qBACA;uBACE;yBACE;yBACA;;;qBAGJ;uBACE;yBACE;yBACA;yBACA;2BACE;6BACE;6BACA;;;;uBAIN;yBACE;yBACA;yBACA;2BACE;6BACE;6BACA;;;;;;;iBAOZ;mBACE;mBACA;qBACE;qBACA;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;qBACA;uBACE;yBACE;yBACA;;;qBAGJ;uBACE;yBACE;yBACA;yBACA;2BACE;6BACE;6BACA;;;;uBAIN;yBACE;yBACA;yBACA;2BACE;6BACE;6BACA;;;;;;;iBAOZ;mBACE;mBACA;qBACE;qBACA;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;qBACA;uBACE;yBACE;yBACA;;;qBAGJ;uBACE;yBACE;yBACA;yBACA;2BACE;6BACE;6BACA;;;;uBAIN;yBACE;yBACA;yBACA;2BACE;6BACE;6BACA;;;;;;;iBAOZ;mBACE;mBACA;qBACE;qBACA;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;qBACA;uBACE;yBACE;yBACA;;;qBAGJ;uBACE;yBACE;yBACA;yBACA;2BACE;6BACE;6BACA;;;;uBAIN;yBACE;yBACA;yBACA;2BACE;6BACE;6BACA;;;;;;;iBAOZ;mBACE;mBACA;qBACE;qBACA;qBACA;uBACE;uBACA;;;;iBAIN;mBACE;mBACA;qBACE;qBACA;qBACA;uBACE;yBACE;yBACA;;uBAEF;yBACE;yBACA;;;;;iBAKR;mBACE;mBACA;qBACE;qBACA;qBACA;uBACE;uBACA;;;;iBAIN;mBACE;mBACA;qBACE;qBACA;qBACA;uBACE;yBACE;yBACA;;uBAEF;yBACE;yBACA;;;;;;eAMV;iBACE;iBACA;mBACE;mBACA;;;eAGJ;iBACE;mBACE;mBACA;qBACE;qBACA;qBACA;uBACE;yBACE;yBACA;;;qBAGJ;;;iBAGJ;mBACE;mBACA;qBACE;qBACA;qBACA;uBACE;yBACE;yBACA;;;qBAGJ;;;;;aAKR;eACE;iBACE;iBACA;iBACA,+DAA+D;UACtE;UACA;UACA;UACA;;iBAEO;mBACE,UAAU,OAAO,oBAAoB,wDAAwD,2BAA2B;;;eAG5H;iBACE;iBACA;iBACA,+DAA+D;UACtE;UACA;UACA;;iBAEO;mBACE,UAAU,OAAO,+BAA+B;;;eAGpD;iBACE;iBACA;iBACA,+DAA+D;UACtE;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;iBAEO;mBACE,UAAU,OAAO,yBAAyB,wDAAwD,2BAA2B;;;eAGjI;iBACE;iBACA;iBACA,+DAA+D;UACtE;UACA;UACA;UACA;;iBAEO;UACP,UAAU,sCAAsC,mBAAmB,wDAAwD,2BAA2B;UACtJ,iBAAiB,QAAQ;YACvB;YACA;;;;;aAKC;eACE;iBACE;iBACA;iBACA;iBACA;mBACE;;iBAEF;mBACE;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;uBACA;uBACA;;;mBAGJ;qBACE;qBACA;qBACA;;mBAEF;qBACE;qBACA;;;iBAGJ;mBACE;mBACA;;;eAGJ;iBACE;iBACA;iBACA;iBACA;mBACE;;iBAEF;mBACE;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;uBACA;uBACA;;;mBAGJ;qBACE;qBACA;qBACA;;mBAEF;qBACE;qBACA;;;iBAGJ;mBACE;mBACA;;;eAGJ;iBACE;iBACA;iBACA;iBACA;mBACE;;iBAEF;mBACE;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;uBACA;uBACA;;;mBAGJ;qBACE;qBACA;qBACA;;mBAEF;qBACE;qBACA;;;iBAGJ;mBACE;mBACA;;;eAGJ;iBACE;iBACA;iBACA;iBACA;mBACE;;iBAEF;mBACE;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;uBACA;uBACA;;;mBAGJ;qBACE;qBACA;qBACA;;mBAEF;qBACE;qBACA;qBACA;;mBAEF;qBACE;qBACA;;;iBAGJ;mBACE;mBACA;;;eAGJ;iBACE;iBACA;iBACA;iBACA;mBACE;;iBAEF;mBACE;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;uBACA;uBACA;;;mBAGJ;qBACE;qBACA;qBACA;;mBAEF;qBACE;qBACA;qBACA;;mBAEF;qBACE;qBACA;;;iBAGJ;mBACE;mBACA;;;eAGJ;iBACE;iBACA;iBACA;iBACA;mBACE;;iBAEF;iBACA;;eAEF;iBACE;iBACA;iBACA;iBACA;mBACE;;iBAEF;;;aAGJ;eACE;iBACE;iBACA;iBACA,qCAAqC;iBACrC,QAAQ,SAAS,sBAAsB,wDAAwD;UACtG;UACA,QAAQ;;;;aAIL,wBAAwB;aACxB,0BAA0B;aAC1B,+BAA+B;aAC/B,2BAA2B;;WAE7B;WACA;WACA;WACA;WACA;WACA;WACA,eAAe;;cAEZ,qCAAqC;WACxC,eAAe"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as PostgresContract } from "./postgres-schema-Xsjt3RKO-Buv2X8ai.mjs";
|
|
2
|
-
import { l as PostgresLoweredStatement } from "./types-CkryN1AS-
|
|
2
|
+
import { l as PostgresLoweredStatement } from "./types-CkryN1AS-CZtzRJFZ.mjs";
|
|
3
3
|
import { Adapter, AnyQueryAst } from "@prisma/orm-family-sql/relational-core/ast";
|
|
4
4
|
import { SqlRuntimeAdapterDescriptor } from "@prisma/orm-family-sql/runtime";
|
|
5
5
|
import { RuntimeAdapterInstance } from "@prisma/orm-framework/components/execution";
|
|
@@ -9,4 +9,4 @@ interface SqlRuntimeAdapter extends RuntimeAdapterInstance<'sql', 'postgres'>, A
|
|
|
9
9
|
declare const postgresRuntimeAdapterDescriptor: SqlRuntimeAdapterDescriptor<'postgres', SqlRuntimeAdapter>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { postgresRuntimeAdapterDescriptor as n, SqlRuntimeAdapter as t };
|
|
12
|
-
//# sourceMappingURL=runtime-
|
|
12
|
+
//# sourceMappingURL=runtime-BdRKoWQu.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-
|
|
1
|
+
{"version":3,"file":"runtime-BdRKoWQu.d.mts","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/runtime.d.mts"],"mappings":";;;;;;;UAKU,0BAA0B,2CAA2C,QAAQ,aAAa,kBAAkB;cACxG,kCAAkC,wCAAwC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as PostgresCodecDescriptorRegistry } from "./codec-descriptor-Bec_zukr-BfvtUqhm.mjs";
|
|
2
2
|
import "./codec-descriptor-Bg-_412t.mjs";
|
|
3
3
|
import { t as PostgresContract } from "./postgres-schema-Xsjt3RKO-Buv2X8ai.mjs";
|
|
4
|
-
import "./types-CkryN1AS-
|
|
4
|
+
import "./types-CkryN1AS-CZtzRJFZ.mjs";
|
|
5
5
|
import { AnyQueryAst, LoweredParam } from "@prisma/orm-family-sql/relational-core/ast";
|
|
6
6
|
//#region ../../../3-targets/6-adapters/postgres/dist/sql-renderer.d.mts
|
|
7
7
|
//#region src/core/sql-renderer.d.ts
|
|
@@ -16,4 +16,4 @@ declare function renderLoweredSql(ast: AnyQueryAst, contract: PostgresContract,
|
|
|
16
16
|
};
|
|
17
17
|
//#endregion
|
|
18
18
|
export { renderLoweredSql as t };
|
|
19
|
-
//# sourceMappingURL=sql-renderer-
|
|
19
|
+
//# sourceMappingURL=sql-renderer-Cshx9dNa.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sql-renderer-
|
|
1
|
+
{"version":3,"file":"sql-renderer-Cshx9dNa.d.mts","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/sql-renderer.d.mts"],"mappings":";;;;;;;;;;;;iBASiB,iBAAiB,KAAK,aAAa,UAAU,kBAAkB,yBAAyB;WAC9F;WACA,iBAAiB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { s as PG_ENUM_CODEC_ID } from "./codec-ids-D3ZEAmt2-DjoKUAas.mjs";
|
|
2
1
|
import { n as isPgEnumParams } from "./codecs-CxWg7WrX-DtVAuuXA.mjs";
|
|
3
2
|
import { i as quoteQualifiedName, r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-6j9YTLpr-BCyCBPBg.mjs";
|
|
4
3
|
import { LiteralExpr, collectOrderedParamRefs } from "@prisma/orm-family-sql/relational-core/ast";
|
|
@@ -6,7 +5,7 @@ import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
|
6
5
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
7
6
|
import { InternalError, assertNever } from "@prisma/orm-framework/utils/internal-error";
|
|
8
7
|
import { runtimeError } from "@prisma/orm-framework/components/runtime";
|
|
9
|
-
//#region ../../../3-targets/6-adapters/postgres/dist/sql-renderer-
|
|
8
|
+
//#region ../../../3-targets/6-adapters/postgres/dist/sql-renderer-DMMtw8lD.mjs
|
|
10
9
|
function adapterError(code, message, options) {
|
|
11
10
|
return structuredError(code, message, options);
|
|
12
11
|
}
|
|
@@ -111,93 +110,20 @@ function renderLimitOffset(keyword, value, contract, pim) {
|
|
|
111
110
|
return `${keyword} ${renderExpr(value, contract, pim)}`;
|
|
112
111
|
}
|
|
113
112
|
function renderSelect(ast, contract, pim) {
|
|
114
|
-
const sourcesByRef = collectTableSources(ast);
|
|
115
113
|
return [
|
|
116
|
-
`SELECT ${renderDistinctPrefix(ast.distinct, ast.distinctOn,
|
|
114
|
+
`SELECT ${renderDistinctPrefix(ast.distinct, ast.distinctOn, contract, pim)}${renderProjection(ast.projection, contract, pim)}`,
|
|
117
115
|
ast.from !== void 0 ? `FROM ${renderSource(ast.from, contract, pim)}` : "",
|
|
118
116
|
ast.joins?.length ? ast.joins.map((join) => renderJoin(join, contract, pim)).join(" ") : "",
|
|
119
117
|
ast.where ? `WHERE ${renderWhere(ast.where, contract, pim)}` : "",
|
|
120
118
|
ast.groupBy?.length ? `GROUP BY ${ast.groupBy.map((expr) => renderExpr(expr, contract, pim)).join(", ")}` : "",
|
|
121
119
|
ast.having ? `HAVING ${renderWhere(ast.having, contract, pim)}` : "",
|
|
122
120
|
ast.orderBy?.length ? `ORDER BY ${ast.orderBy.map((order) => {
|
|
123
|
-
return `${
|
|
121
|
+
return `${renderExpr(order.expr, contract, pim)} ${order.dir.toUpperCase()}`;
|
|
124
122
|
}).join(", ")}` : "",
|
|
125
123
|
renderLimitOffset("LIMIT", ast.limit, contract, pim),
|
|
126
124
|
renderLimitOffset("OFFSET", ast.offset, contract, pim)
|
|
127
125
|
].filter((part) => part.length > 0).join(" ").trim();
|
|
128
126
|
}
|
|
129
|
-
/**
|
|
130
|
-
* Map a SELECT's table references (the FROM source and any JOIN sources) to their storage coordinate, keyed by the name a `ColumnRef.table` would carry (the alias when present, otherwise the table name). Derived-table sources are skipped — their columns are projected through a sub-select, not a base storage column, so the enum hook does not apply.
|
|
131
|
-
*/
|
|
132
|
-
function collectTableSources(ast) {
|
|
133
|
-
const sources = /* @__PURE__ */ new Map();
|
|
134
|
-
const add = (source) => {
|
|
135
|
-
if (source.kind !== "table-source") return;
|
|
136
|
-
const ref = source.alias ?? source.name;
|
|
137
|
-
sources.set(ref, {
|
|
138
|
-
name: source.name,
|
|
139
|
-
namespaceId: source.namespaceId
|
|
140
|
-
});
|
|
141
|
-
};
|
|
142
|
-
if (ast.from !== void 0) add(ast.from);
|
|
143
|
-
for (const join of ast.joins ?? []) add(join.source);
|
|
144
|
-
return sources;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Ordered, codec-encoded values of the value-set a storage column restricts to, or `undefined` when the referenced column carries no value-set (the common, non-enum case). Resolves the column's storage coordinate from the SELECT's table sources, then the column's `valueSet` ref to the value-set's `values`.
|
|
148
|
-
*/
|
|
149
|
-
function allStrings(values) {
|
|
150
|
-
return values.every((value) => typeof value === "string");
|
|
151
|
-
}
|
|
152
|
-
function sortsByDeclarationOrderNatively(column) {
|
|
153
|
-
return column.codecId === PG_ENUM_CODEC_ID;
|
|
154
|
-
}
|
|
155
|
-
function resolveEnumOrderValues(ref, sourcesByRef, contract) {
|
|
156
|
-
const source = sourcesByRef.get(ref.table);
|
|
157
|
-
if (source === void 0 || source.namespaceId === void 0) return;
|
|
158
|
-
const sourceNs = contract.storage.namespaces[source.namespaceId];
|
|
159
|
-
const column = sourceNs !== void 0 ? sourceNs.entries.table?.[source.name]?.columns[ref.column] : void 0;
|
|
160
|
-
if (column === void 0 || sortsByDeclarationOrderNatively(column)) return;
|
|
161
|
-
const valueSet = column.valueSet;
|
|
162
|
-
if (valueSet === void 0) return;
|
|
163
|
-
const valueSetNs = contract.storage.namespaces[valueSet.namespaceId];
|
|
164
|
-
return valueSetNs !== void 0 ? valueSetNs.entries.valueSet?.[valueSet.entityName]?.values : void 0;
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Ordered values for an unqualified ORDER BY column (an `identifier-ref`, the shape the sql-builder emits for `.orderBy('col')`). Scans every FROM/JOIN source for a column of that name. Resolves only when exactly one source has a column of that name and it carries a value-set; if more than one source has such a column the bare identifier is ambiguous (regardless of which are enum-backed), so it falls through to the plain column rendering.
|
|
168
|
-
*/
|
|
169
|
-
function resolveEnumOrderValuesForIdentifier(name, sourcesByRef, contract) {
|
|
170
|
-
let matchedColumns = 0;
|
|
171
|
-
let resolved;
|
|
172
|
-
for (const source of sourcesByRef.values()) {
|
|
173
|
-
if (source.namespaceId === void 0) continue;
|
|
174
|
-
const identNs = contract.storage.namespaces[source.namespaceId];
|
|
175
|
-
const column = identNs !== void 0 ? identNs.entries.table?.[source.name]?.columns[name] : void 0;
|
|
176
|
-
if (column === void 0) continue;
|
|
177
|
-
matchedColumns += 1;
|
|
178
|
-
if (matchedColumns > 1) return;
|
|
179
|
-
if (sortsByDeclarationOrderNatively(column)) return;
|
|
180
|
-
const valueSet = column.valueSet;
|
|
181
|
-
if (valueSet === void 0) return;
|
|
182
|
-
const valueSetNs = contract.storage.namespaces[valueSet.namespaceId];
|
|
183
|
-
resolved = valueSetNs !== void 0 ? valueSetNs.entries.valueSet?.[valueSet.entityName]?.values : void 0;
|
|
184
|
-
}
|
|
185
|
-
return resolved;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Render an ORDER BY expression. A column reference onto an enum-restricted column sorts by declaration order via `array_position(ARRAY[…]::text[], <col>)` over the value-set's ordered values (NULLs return `NULL` from `array_position`, sorting per the clause's default NULL handling). Both qualified `column-ref`s and the unqualified `identifier-ref`s the sql-builder emits for `.orderBy('col')` are intercepted. Every other expression renders unchanged.
|
|
189
|
-
*/
|
|
190
|
-
function renderOrderByExpr(expr, sourcesByRef, contract, pim) {
|
|
191
|
-
if (expr.kind === "column-ref") {
|
|
192
|
-
const orderValues = resolveEnumOrderValues(expr, sourcesByRef, contract);
|
|
193
|
-
if (orderValues !== void 0 && allStrings(orderValues)) return `array_position(ARRAY[${orderValues.map((value) => `'${escapeLiteral(value)}'`).join(", ")}]::text[], ${renderColumn(expr)})`;
|
|
194
|
-
}
|
|
195
|
-
if (expr.kind === "identifier-ref") {
|
|
196
|
-
const orderValues = resolveEnumOrderValuesForIdentifier(expr.name, sourcesByRef, contract);
|
|
197
|
-
if (orderValues !== void 0 && allStrings(orderValues)) return `array_position(ARRAY[${orderValues.map((value) => `'${escapeLiteral(value)}'`).join(", ")}]::text[], ${quoteIdentifier(expr.name)})`;
|
|
198
|
-
}
|
|
199
|
-
return renderExpr(expr, contract, pim);
|
|
200
|
-
}
|
|
201
127
|
function renderProjection(projection, contract, pim) {
|
|
202
128
|
return projection.map((item) => {
|
|
203
129
|
const alias = quoteIdentifier(item.alias);
|
|
@@ -215,8 +141,8 @@ function renderReturning(items, contract, pim) {
|
|
|
215
141
|
return `${renderExpr(item.expr, contract, pim)} AS ${quoteIdentifier(item.alias)}`;
|
|
216
142
|
}).join(", ");
|
|
217
143
|
}
|
|
218
|
-
function renderDistinctPrefix(distinct, distinctOn,
|
|
219
|
-
if (distinctOn && distinctOn.length > 0) return `DISTINCT ON (${distinctOn.map((expr) =>
|
|
144
|
+
function renderDistinctPrefix(distinct, distinctOn, contract, pim) {
|
|
145
|
+
if (distinctOn && distinctOn.length > 0) return `DISTINCT ON (${distinctOn.map((expr) => renderExpr(expr, contract, pim)).join(", ")}) `;
|
|
220
146
|
if (distinct) return "DISTINCT ";
|
|
221
147
|
return "";
|
|
222
148
|
}
|
|
@@ -575,4 +501,4 @@ function renderRawExpr(node, contract, pim) {
|
|
|
575
501
|
//#endregion
|
|
576
502
|
export { renderLoweredSql as n, adapterError as t };
|
|
577
503
|
|
|
578
|
-
//# sourceMappingURL=sql-renderer-
|
|
504
|
+
//# sourceMappingURL=sql-renderer-DMMtw8lD-K9zLsg-g.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sql-renderer-DMMtw8lD-K9zLsg-g.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/sql-renderer-DMMtw8lD.mjs"],"sourcesContent":["import { LiteralExpr, collectOrderedParamRefs } from \"@internal/sql-relational-core/ast\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { isPgEnumParams } from \"@internal/target-postgres/codecs\";\nimport { escapeLiteral, quoteIdentifier, quoteQualifiedName } from \"@internal/target-postgres/sql-utils\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError, assertNever } from \"@internal/utils/internal-error\";\nimport { runtimeError } from \"@internal/framework-components/runtime\";\n//#region src/core/adapter-errors.ts\nfunction adapterError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/core/sql-renderer.ts\n/**\n* Postgres native types whose unknown-OID parameter inference is reliable in arbitrary expression positions. Parameters bound to a descriptor whose `nativeTypeFor` result falls in this set are emitted as plain `$N`; everything else (including `json`, `jsonb`, extension types like `vector`, and unknown user types) is emitted as `$N::<nativeType>` so the planner picks an unambiguous overload.\n*\n* `json` / `jsonb` are intentionally excluded despite being Postgres builtins: their operator overloads make context inference unreliable in expression positions (e.g. `$1 -> 'key'` is ambiguous between the two).\n*\n* Spellings match the target descriptors' `nativeTypeFor` results, not the `udt_name` abbreviations that ADR 205 used as illustrative shorthand. The registry-based cast policy compares against these strings directly.\n*/\nconst POSTGRES_INFERRABLE_NATIVE_TYPES = /* @__PURE__ */ new Set([\n\t\"integer\",\n\t\"smallint\",\n\t\"bigint\",\n\t\"real\",\n\t\"double precision\",\n\t\"numeric\",\n\t\"boolean\",\n\t\"text\",\n\t\"character\",\n\t\"character varying\",\n\t\"timestamp\",\n\t\"timestamp without time zone\",\n\t\"timestamp with time zone\",\n\t\"time\",\n\t\"timetz\",\n\t\"interval\",\n\t\"bit\",\n\t\"bit varying\"\n]);\nfunction renderTypedParam(index, codecId, codecDescriptorRegistry, many, typeParams) {\n\tif (codecId === void 0) return `$${index}`;\n\tconst descriptor = codecDescriptorRegistry.descriptorFor(codecId);\n\tif (descriptor === void 0) throw adapterError(\"RUNTIME.PARAM_REF_MISSING_CODEC\", `Postgres lowering: ParamRef carries codecId \"${codecId}\" but the validated PostgreSQL codec registry has no entry for it. This usually indicates a missing extension pack in the runtime stack — register the pack that contributes this codec (e.g. \\`extensions: [pgvectorRuntime]\\`), or use the codec directly from \\`@internal/target-postgres/codecs\\` if it's a builtin.`, { meta: { codecId } });\n\tconst ref = {\n\t\tcodecId,\n\t\t...ifDefined(\"many\", many),\n\t\t...ifDefined(\"typeParams\", typeParams)\n\t};\n\tconst nativeType = descriptor.nativeTypeFor(ref);\n\tconst arraySuffix = many ? \"[]\" : \"\";\n\tif (isPgEnumParams(typeParams)) return `$${index}::${quoteQualifiedName(nativeType)}${arraySuffix}`;\n\tif (!POSTGRES_INFERRABLE_NATIVE_TYPES.has(nativeType) || many) return `$${index}::${nativeType}${arraySuffix}`;\n\treturn `$${index}`;\n}\nfunction unreachableKind(value) {\n\tconst candidate = value;\n\tif (typeof candidate === \"object\" && candidate !== null && \"kind\" in candidate && typeof candidate.kind === \"string\") return candidate.kind;\n\treturn \"unknown\";\n}\n/**\n* Render a SQL query AST to a Postgres-flavored `{ sql, params }` payload.\n*\n* Shared between the runtime (`PostgresAdapterImpl.lower`) and control (`PostgresControlAdapter.lower`) entrypoints so emit-time and run-time paths produce byte-identical output for the same AST.\n*/\nfunction renderLoweredSql(ast, contract, codecDescriptorRegistry) {\n\tconst orderedRefs = collectOrderedParamRefs(ast);\n\tconst indexMap = /* @__PURE__ */ new Map();\n\tconst params = orderedRefs.map((ref, i) => {\n\t\tindexMap.set(ref, i + 1);\n\t\treturn ref.kind === \"prepared-param-ref\" ? {\n\t\t\tkind: \"bind\",\n\t\t\tname: ref.name\n\t\t} : {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: ref.value\n\t\t};\n\t});\n\tconst pim = {\n\t\tindexMap,\n\t\tcodecDescriptorRegistry\n\t};\n\tconst node = ast;\n\tlet sql;\n\tswitch (node.kind) {\n\t\tcase \"select\":\n\t\t\tsql = renderSelect(node, contract, pim);\n\t\t\tbreak;\n\t\tcase \"insert\":\n\t\t\tsql = renderInsert(node, contract, pim);\n\t\t\tbreak;\n\t\tcase \"update\":\n\t\t\tsql = renderUpdate(node, contract, pim);\n\t\t\tbreak;\n\t\tcase \"delete\":\n\t\t\tsql = renderDelete(node, contract, pim);\n\t\t\tbreak;\n\t\tcase \"raw-query\":\n\t\t\tsql = renderParts(node.parts, contract, pim);\n\t\t\tbreak;\n\t\t// v8 ignore next 4\n\t\tdefault: assertNever(node, `Unsupported AST node kind: ${unreachableKind(node)}`);\n\t}\n\treturn Object.freeze({\n\t\tsql,\n\t\tparams: Object.freeze(params)\n\t});\n}\nfunction renderLimitOffset(keyword, value, contract, pim) {\n\tif (value === void 0) return \"\";\n\tif (typeof value === \"number\") return `${keyword} ${value}`;\n\treturn `${keyword} ${renderExpr(value, contract, pim)}`;\n}\nfunction renderSelect(ast, contract, pim) {\n\treturn [\n\t\t`SELECT ${renderDistinctPrefix(ast.distinct, ast.distinctOn, contract, pim)}${renderProjection(ast.projection, contract, pim)}`,\n\t\tast.from !== void 0 ? `FROM ${renderSource(ast.from, contract, pim)}` : \"\",\n\t\tast.joins?.length ? ast.joins.map((join) => renderJoin(join, contract, pim)).join(\" \") : \"\",\n\t\tast.where ? `WHERE ${renderWhere(ast.where, contract, pim)}` : \"\",\n\t\tast.groupBy?.length ? `GROUP BY ${ast.groupBy.map((expr) => renderExpr(expr, contract, pim)).join(\", \")}` : \"\",\n\t\tast.having ? `HAVING ${renderWhere(ast.having, contract, pim)}` : \"\",\n\t\tast.orderBy?.length ? `ORDER BY ${ast.orderBy.map((order) => {\n\t\t\treturn `${renderExpr(order.expr, contract, pim)} ${order.dir.toUpperCase()}`;\n\t\t}).join(\", \")}` : \"\",\n\t\trenderLimitOffset(\"LIMIT\", ast.limit, contract, pim),\n\t\trenderLimitOffset(\"OFFSET\", ast.offset, contract, pim)\n\t].filter((part) => part.length > 0).join(\" \").trim();\n}\nfunction renderProjection(projection, contract, pim) {\n\treturn projection.map((item) => {\n\t\tconst alias = quoteIdentifier(item.alias);\n\t\tif (item.expr.kind === \"literal\") return `${renderLiteral(item.expr)} AS ${alias}`;\n\t\treturn `${renderExpr(item.expr, contract, pim)} AS ${alias}`;\n\t}).join(\", \");\n}\nfunction renderReturning(items, contract, pim) {\n\treturn items.map((item) => {\n\t\tif (item.expr.kind === \"column-ref\") {\n\t\t\tconst rendered = renderColumn(item.expr);\n\t\t\treturn item.expr.column === item.alias ? rendered : `${rendered} AS ${quoteIdentifier(item.alias)}`;\n\t\t}\n\t\tif (item.expr.kind === \"literal\") return `${renderLiteral(item.expr)} AS ${quoteIdentifier(item.alias)}`;\n\t\treturn `${renderExpr(item.expr, contract, pim)} AS ${quoteIdentifier(item.alias)}`;\n\t}).join(\", \");\n}\nfunction renderDistinctPrefix(distinct, distinctOn, contract, pim) {\n\tif (distinctOn && distinctOn.length > 0) return `DISTINCT ON (${distinctOn.map((expr) => renderExpr(expr, contract, pim)).join(\", \")}) `;\n\tif (distinct) return \"DISTINCT \";\n\treturn \"\";\n}\nfunction hasExplicitSchema(table) {\n\treturn \"schema\" in table && typeof table.schema === \"string\";\n}\nfunction qualifyTableFromNamespaceCoordinate(table, contract) {\n\tif (hasExplicitSchema(table)) return `${quoteIdentifier(table.schema)}.${quoteIdentifier(table.name)}`;\n\tif (table.namespaceId === void 0) return quoteIdentifier(table.name);\n\tconst namespace = contract.storage.namespaces[table.namespaceId];\n\tif (namespace === void 0) throw adapterError(\"RUNTIME.NAMESPACE_UNKNOWN\", `Table \"${table.name}\" references namespace \"${table.namespaceId}\" which is not present as a Postgres schema on the contract`, { meta: {\n\t\ttable: table.name,\n\t\tnamespaceId: table.namespaceId,\n\t\treason: \"not-present\"\n\t} });\n\tconst qualifyTable = namespace.qualifyTable;\n\tif (qualifyTable === void 0) throw adapterError(\"RUNTIME.NAMESPACE_UNKNOWN\", `Table \"${table.name}\" references namespace \"${table.namespaceId}\" which is not materialised as a Postgres schema on the contract`, { meta: {\n\t\ttable: table.name,\n\t\tnamespaceId: table.namespaceId,\n\t\treason: \"not-materialised\"\n\t} });\n\treturn qualifyTable.call(namespace, table.name);\n}\nfunction renderTableSource(source, contract) {\n\tconst qualified = qualifyTableFromNamespaceCoordinate(source, contract);\n\tif (!source.alias) return qualified;\n\treturn `${qualified} AS ${quoteIdentifier(source.alias)}`;\n}\nfunction renderSource(source, contract, pim) {\n\tconst node = source;\n\tswitch (node.kind) {\n\t\tcase \"table-source\": return renderTableSource(node, contract);\n\t\tcase \"derived-table-source\": return `(${renderSelect(node.query, contract, pim)}) AS ${quoteIdentifier(node.alias)}`;\n\t\tcase \"function-source\": {\n\t\t\tconst args = node.args.map((arg) => renderExpr(arg, contract, pim)).join(\", \");\n\t\t\treturn `${`${node.fn}(${args})`}${node.ordinality ? \" WITH ORDINALITY\" : \"\"}${node.alias === void 0 ? \"\" : ` AS ${quoteIdentifier(node.alias)}`}${node.columnAliases === void 0 ? \"\" : `(${node.columnAliases.map((column) => quoteIdentifier(column)).join(\", \")})`}`;\n\t\t}\n\t\t// v8 ignore next 4\n\t\tdefault: assertNever(node, `Unsupported source node kind: ${unreachableKind(node)}`);\n\t}\n}\nfunction assertScalarSubquery(query) {\n\tif (query.projection.length !== 1) throw adapterError(\"RUNTIME.AST_INVALID\", \"Subquery expressions must project exactly one column\", { meta: { node: \"subquery-expr\" } });\n}\nfunction renderSubqueryExpr(expr, contract, pim) {\n\tassertScalarSubquery(expr.query);\n\treturn `(${renderSelect(expr.query, contract, pim)})`;\n}\nfunction renderWhere(expr, contract, pim) {\n\treturn renderExpr(expr, contract, pim);\n}\nfunction renderNullCheck(expr, contract, pim) {\n\tconst rendered = renderExpr(expr.expr, contract, pim);\n\tconst renderedExpr = isAtomicExpressionKind(expr.expr.kind) ? rendered : `(${rendered})`;\n\treturn expr.isNull ? `${renderedExpr} IS NULL` : `${renderedExpr} IS NOT NULL`;\n}\n/**\n* Atomic expression kinds whose rendered SQL is already self-delimited (a column reference, parameter, literal, function call, aggregate, etc.) and therefore does not need surrounding parentheses when used as the left operand of a postfix predicate like `IS NULL` or `IS NOT NULL`, or as either operand of a binary infix operator.\n*\n* Anything not in this set is treated as composite (binary, AND/OR/NOT, EXISTS, nested IS NULL, subqueries, operation templates) and gets wrapped to preserve grouping.\n*/\nfunction isAtomicExpressionKind(kind) {\n\tswitch (kind) {\n\t\tcase \"column-ref\":\n\t\tcase \"identifier-ref\":\n\t\tcase \"param-ref\":\n\t\tcase \"prepared-param-ref\":\n\t\tcase \"literal\":\n\t\tcase \"aggregate\":\n\t\tcase \"window-func\":\n\t\tcase \"function-call\":\n\t\tcase \"cast\":\n\t\tcase \"case\":\n\t\tcase \"json-object\":\n\t\tcase \"json-array-agg\":\n\t\tcase \"list\": return true;\n\t\tcase \"subquery\":\n\t\tcase \"operation\":\n\t\tcase \"binary\":\n\t\tcase \"and\":\n\t\tcase \"or\":\n\t\tcase \"exists\":\n\t\tcase \"null-check\":\n\t\tcase \"not\":\n\t\tcase \"raw-expr\": return false;\n\t}\n}\nfunction renderBinary(expr, contract, pim) {\n\tif (expr.right.kind === \"list\" && expr.right.values.length === 0) {\n\t\tif (expr.op === \"in\") return \"FALSE\";\n\t\tif (expr.op === \"notIn\") return \"TRUE\";\n\t}\n\tconst leftExpr = expr.left;\n\tconst left = renderExpr(leftExpr, contract, pim);\n\tconst leftRendered = leftExpr.kind === \"operation\" || leftExpr.kind === \"subquery\" ? `(${left})` : left;\n\tconst rightNode = expr.right;\n\tlet right;\n\tswitch (rightNode.kind) {\n\t\tcase \"list\":\n\t\t\tright = renderListLiteral(rightNode, contract, pim);\n\t\t\tbreak;\n\t\tcase \"literal\":\n\t\t\tright = renderLiteral(rightNode);\n\t\t\tbreak;\n\t\tcase \"column-ref\":\n\t\t\tright = renderColumn(rightNode);\n\t\t\tbreak;\n\t\tcase \"param-ref\":\n\t\tcase \"prepared-param-ref\":\n\t\t\tright = renderParamRef(rightNode, pim);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tright = renderExpr(rightNode, contract, pim);\n\t\t\tbreak;\n\t}\n\treturn `${leftRendered} ${{\n\t\teq: \"=\",\n\t\tneq: \"!=\",\n\t\tgt: \">\",\n\t\tlt: \"<\",\n\t\tgte: \">=\",\n\t\tlte: \"<=\",\n\t\tlike: \"LIKE\",\n\t\tin: \"IN\",\n\t\tnotIn: \"NOT IN\"\n\t}[expr.op]} ${right}`;\n}\nfunction renderListLiteral(expr, contract, pim) {\n\tif (expr.values.length === 0) return \"(NULL)\";\n\treturn `(${expr.values.map((v) => {\n\t\tif (v.kind === \"param-ref\" || v.kind === \"prepared-param-ref\") return renderParamRef(v, pim);\n\t\tif (v.kind === \"literal\") return renderLiteral(v);\n\t\treturn renderExpr(v, contract, pim);\n\t}).join(\", \")})`;\n}\nfunction renderColumn(ref) {\n\tif (ref.table === \"excluded\") return `excluded.${quoteIdentifier(ref.column)}`;\n\treturn `${quoteIdentifier(ref.table)}.${quoteIdentifier(ref.column)}`;\n}\nfunction renderAggregateExpr(expr, contract, pim) {\n\tconst fn = expr.fn.toUpperCase();\n\tif (!expr.expr) return `${fn}(*)`;\n\treturn `${fn}(${renderExpr(expr.expr, contract, pim)})`;\n}\nfunction renderWindowFuncExpr(expr, contract, pim) {\n\treturn `${expr.fn.toUpperCase()}(${expr.args.map((arg) => renderExpr(arg, contract, pim)).join(\", \")}) OVER (${[expr.partitionBy && expr.partitionBy.length > 0 ? `PARTITION BY ${expr.partitionBy.map((e) => renderExpr(e, contract, pim)).join(\", \")}` : \"\", expr.orderBy && expr.orderBy.length > 0 ? `ORDER BY ${renderOrderByItems(expr.orderBy, contract, pim)}` : \"\"].filter((part) => part.length > 0).join(\" \")})`;\n}\nfunction renderFunctionCallExpr(expr, contract, pim) {\n\tconst args = expr.args.map((arg) => renderExpr(arg, contract, pim)).join(\", \");\n\treturn `${expr.fn}(${args})`;\n}\nfunction renderCastExpr(expr, contract, pim) {\n\treturn `CAST(${renderExpr(expr.expr, contract, pim)} AS ${expr.targetType})`;\n}\nfunction renderCaseExpr(expr, contract, pim) {\n\treturn `CASE ${expr.branches.map((branch) => `WHEN ${renderExpr(branch.condition, contract, pim)} THEN ${renderExpr(branch.value, contract, pim)}`).join(\" \")}${expr.elseExpr === void 0 ? \"\" : ` ELSE ${renderExpr(expr.elseExpr, contract, pim)}`} END`;\n}\nfunction renderJsonValueProjection(projection, contract, pim) {\n\treturn projection.accept({\n\t\tcodec: ({ value, codec }) => renderExpr(projectJsonThroughCodec(value, codec, pim), contract, pim),\n\t\tnative: ({ value }) => renderExpr(value, contract, pim),\n\t\tdocument: ({ value }) => renderExpr(value, contract, pim)\n\t});\n}\nfunction projectJsonThroughCodec(value, codec, pim) {\n\tconst descriptor = pim.codecDescriptorRegistry.descriptorFor(codec.codecId);\n\tif (descriptor === void 0) throw adapterError(\"RUNTIME.PARAM_REF_MISSING_CODEC\", `Postgres lowering: a JSON projection carries codecId \"${codec.codecId}\" but the validated PostgreSQL codec registry has no entry for it. This usually indicates a missing extension pack in the runtime stack — register the pack that contributes this codec (e.g. \\`extensions: [pgvectorRuntime]\\`), or use the codec directly from \\`@internal/target-postgres/codecs\\` if it's a builtin.`, { meta: { codecId: codec.codecId } });\n\treturn descriptor.projectJson(value, codec);\n}\nfunction renderJsonObjectExpr(expr, contract, pim) {\n\treturn `json_build_object(${expr.entries.flatMap((entry) => {\n\t\treturn [`'${escapeLiteral(entry.key)}'`, renderJsonValueProjection(entry.value, contract, pim)];\n\t}).join(\", \")})`;\n}\nfunction renderOrderByItems(items, contract, pim) {\n\treturn items.map((item) => `${renderExpr(item.expr, contract, pim)} ${item.dir.toUpperCase()}`).join(\", \");\n}\nfunction renderJsonArrayAggExpr(expr, contract, pim) {\n\tconst aggregateOrderBy = expr.orderBy && expr.orderBy.length > 0 ? ` ORDER BY ${renderOrderByItems(expr.orderBy, contract, pim)}` : \"\";\n\tconst aggregated = `json_agg(${renderJsonValueProjection(expr.expr, contract, pim)}${aggregateOrderBy})`;\n\tif (expr.onEmpty === \"emptyArray\") return `coalesce(${aggregated}, json_build_array())`;\n\treturn aggregated;\n}\nfunction renderExpr(expr, contract, pim) {\n\tconst node = expr;\n\tswitch (node.kind) {\n\t\tcase \"column-ref\": return renderColumn(node);\n\t\tcase \"identifier-ref\": return quoteIdentifier(node.name);\n\t\tcase \"operation\": return renderOperation(node, contract, pim);\n\t\tcase \"subquery\": return renderSubqueryExpr(node, contract, pim);\n\t\tcase \"aggregate\": return renderAggregateExpr(node, contract, pim);\n\t\tcase \"window-func\": return renderWindowFuncExpr(node, contract, pim);\n\t\tcase \"function-call\": return renderFunctionCallExpr(node, contract, pim);\n\t\tcase \"cast\": return renderCastExpr(node, contract, pim);\n\t\tcase \"case\": return renderCaseExpr(node, contract, pim);\n\t\tcase \"json-object\": return renderJsonObjectExpr(node, contract, pim);\n\t\tcase \"json-array-agg\": return renderJsonArrayAggExpr(node, contract, pim);\n\t\tcase \"binary\": return renderBinary(node, contract, pim);\n\t\tcase \"and\":\n\t\t\tif (node.exprs.length === 0) return \"TRUE\";\n\t\t\treturn `(${node.exprs.map((part) => renderExpr(part, contract, pim)).join(\" AND \")})`;\n\t\tcase \"or\":\n\t\t\tif (node.exprs.length === 0) return \"FALSE\";\n\t\t\treturn `(${node.exprs.map((part) => renderExpr(part, contract, pim)).join(\" OR \")})`;\n\t\tcase \"exists\": return `${node.notExists ? \"NOT \" : \"\"}EXISTS (${renderSelect(node.subquery, contract, pim)})`;\n\t\tcase \"null-check\": return renderNullCheck(node, contract, pim);\n\t\tcase \"not\": return `NOT (${renderExpr(node.expr, contract, pim)})`;\n\t\tcase \"param-ref\":\n\t\tcase \"prepared-param-ref\": return renderParamRef(node, pim);\n\t\tcase \"literal\": return renderLiteral(node);\n\t\tcase \"list\": return renderListLiteral(node, contract, pim);\n\t\tcase \"raw-expr\": return renderRawExpr(node, contract, pim);\n\t\t// v8 ignore next 4\n\t\tdefault: assertNever(node, `Unsupported expression node kind: ${unreachableKind(node)}`);\n\t}\n}\nfunction renderParamRef(ref, pim) {\n\tconst index = pim.indexMap.get(ref);\n\tif (index === void 0) throw new InternalError(\"ParamRef not found in index map\");\n\tif (ref.kind === \"prepared-param-ref\") return renderTypedParam(index, ref.codec.codecId, pim.codecDescriptorRegistry, ref.codec.many, ref.codec.typeParams);\n\tif (ref.codec === void 0) throw runtimeError(\"RUNTIME.PARAM_REF_MISSING_CODEC\", \"Postgres renderer: ParamRef reached lowering without a bound CodecRef. Every column-bound ParamRef must carry a codec under the AST-bound codec contract. This usually indicates a builder path that constructed a ParamRef without threading the column codec.\", {\n\t\tparamIndex: index,\n\t\t...ifDefined(\"name\", ref.name)\n\t});\n\treturn renderTypedParam(index, ref.codec.codecId, pim.codecDescriptorRegistry, ref.codec.many, ref.codec.typeParams);\n}\nfunction renderLiteral(expr) {\n\tif (typeof expr.value === \"string\") return `'${escapeLiteral(expr.value)}'`;\n\tif (typeof expr.value === \"number\" || typeof expr.value === \"boolean\") return String(expr.value);\n\tif (typeof expr.value === \"bigint\") return String(expr.value);\n\tif (expr.value === null) return \"NULL\";\n\tif (expr.value === void 0) return \"NULL\";\n\tif (expr.value instanceof Date) return `'${escapeLiteral(expr.value.toISOString())}'`;\n\tif (Array.isArray(expr.value)) return `ARRAY[${expr.value.map((v) => renderLiteral(new LiteralExpr(v))).join(\", \")}]`;\n\tconst json = JSON.stringify(expr.value);\n\tif (json === void 0) return \"NULL\";\n\treturn `'${escapeLiteral(json)}'`;\n}\nfunction renderOperation(expr, contract, pim) {\n\tconst self = renderExpr(expr.self, contract, pim);\n\tconst args = expr.args.map((arg) => {\n\t\treturn renderExpr(arg, contract, pim);\n\t});\n\treturn expr.lowering.template.replace(/\\{\\{self\\}\\}|\\{\\{arg(\\d+)\\}\\}/g, (token, argIndex) => {\n\t\tif (token === \"{{self}}\") return self;\n\t\tconst arg = args[Number(argIndex)];\n\t\tif (arg === void 0) throw adapterError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Operation lowering template for \"${expr.method}\" referenced missing argument {{arg${argIndex}}}; template has ${args.length} arg(s)`, { meta: { method: expr.method } });\n\t\treturn arg;\n\t});\n}\nfunction renderJoin(join, contract, pim) {\n\treturn `${join.joinType.toUpperCase()} JOIN ${join.lateral ? \"LATERAL \" : \"\"}${renderSource(join.source, contract, pim)} ON ${renderJoinOn(join.on, contract, pim)}`;\n}\nfunction renderJoinOn(on, contract, pim) {\n\tif (on.kind === \"eq-col-join-on\") return `${renderColumn(on.left)} = ${renderColumn(on.right)}`;\n\treturn renderWhere(on, contract, pim);\n}\nfunction getInsertColumnOrder(rows, contract, tableRef) {\n\tconst tableName = tableRef.name;\n\tconst orderedColumns = [];\n\tconst seenColumns = /* @__PURE__ */ new Set();\n\tfor (const row of rows) for (const column of Object.keys(row)) {\n\t\tif (seenColumns.has(column)) continue;\n\t\tseenColumns.add(column);\n\t\torderedColumns.push(column);\n\t}\n\tif (orderedColumns.length > 0) return orderedColumns;\n\tlet table;\n\tif (tableRef.namespaceId !== void 0) {\n\t\tconst ns = contract.storage.namespaces[tableRef.namespaceId];\n\t\ttable = ns !== void 0 ? ns.entries.table?.[tableName] : void 0;\n\t}\n\tif (table === void 0) for (const ns of Object.values(contract.storage.namespaces)) {\n\t\tconst found = ns.entries.table?.[tableName];\n\t\tif (found !== void 0) {\n\t\t\ttable = found;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (!table) throw adapterError(\"RUNTIME.AST_INVALID\", `INSERT target table not found in contract storage: ${tableName}`, { meta: {\n\t\tnode: \"insert\",\n\t\ttable: tableName\n\t} });\n\treturn Object.keys(table.columns);\n}\nfunction renderInsertValue(value, contract, pim) {\n\tif (!value || value.kind === \"default-value\") return \"DEFAULT\";\n\tswitch (value.kind) {\n\t\tcase \"param-ref\":\n\t\tcase \"prepared-param-ref\": return renderParamRef(value, pim);\n\t\tcase \"column-ref\": return renderColumn(value);\n\t\tcase \"raw-expr\": return renderExpr(value, contract, pim);\n\t\t// v8 ignore next 4\n\t\tdefault: assertNever(value, `Unsupported value node in INSERT: ${unreachableKind(value)}`);\n\t}\n}\nfunction renderInsert(ast, contract, pim) {\n\tconst table = qualifyTableFromNamespaceCoordinate(ast.table, contract);\n\tconst rows = ast.rows;\n\tif (rows.length === 0) throw adapterError(\"RUNTIME.AST_INVALID\", \"INSERT requires at least one row\", { meta: { node: \"insert\" } });\n\tconst hasExplicitValues = rows.some((row) => Object.keys(row).length > 0);\n\treturn `${(() => {\n\t\tif (!hasExplicitValues) {\n\t\t\tif (rows.length === 1) return `INSERT INTO ${table} DEFAULT VALUES`;\n\t\t\tconst defaultColumns = getInsertColumnOrder(rows, contract, ast.table);\n\t\t\tif (defaultColumns.length === 0) return `INSERT INTO ${table} VALUES ${rows.map(() => \"()\").join(\", \")}`;\n\t\t\tconst quotedColumns = defaultColumns.map((column) => quoteIdentifier(column));\n\t\t\tconst defaultRow = `(${defaultColumns.map(() => \"DEFAULT\").join(\", \")})`;\n\t\t\treturn `INSERT INTO ${table} (${quotedColumns.join(\", \")}) VALUES ${rows.map(() => defaultRow).join(\", \")}`;\n\t\t}\n\t\tconst columnOrder = getInsertColumnOrder(rows, contract, ast.table);\n\t\tconst columns = columnOrder.map((column) => quoteIdentifier(column));\n\t\tconst values = rows.map((row) => {\n\t\t\treturn `(${columnOrder.map((column) => renderInsertValue(row[column], contract, pim)).join(\", \")})`;\n\t\t}).join(\", \");\n\t\treturn `INSERT INTO ${table} (${columns.join(\", \")}) VALUES ${values}`;\n\t})()}${ast.onConflict ? (() => {\n\t\tconst conflictColumns = ast.onConflict.columns.map((col) => quoteIdentifier(col.column));\n\t\tif (conflictColumns.length === 0) throw adapterError(\"RUNTIME.AST_INVALID\", \"INSERT onConflict requires at least one conflict column\", { meta: { node: \"insert-on-conflict\" } });\n\t\tconst action = ast.onConflict.action;\n\t\tswitch (action.kind) {\n\t\t\tcase \"do-nothing\": return ` ON CONFLICT (${conflictColumns.join(\", \")}) DO NOTHING`;\n\t\t\tcase \"do-update-set\": {\n\t\t\t\tconst updateEntries = Object.entries(action.set);\n\t\t\t\tif (updateEntries.length === 0) throw adapterError(\"RUNTIME.AST_INVALID\", \"INSERT onConflict do-update-set requires at least one assignment\", { meta: { node: \"insert-on-conflict\" } });\n\t\t\t\tconst updates = updateEntries.map(([colName, value]) => {\n\t\t\t\t\treturn `${quoteIdentifier(colName)} = ${renderExpr(value, contract, pim)}`;\n\t\t\t\t});\n\t\t\t\treturn ` ON CONFLICT (${conflictColumns.join(\", \")}) DO UPDATE SET ${updates.join(\", \")}`;\n\t\t\t}\n\t\t\t// v8 ignore next 4\n\t\t\tdefault: assertNever(action, `Unsupported onConflict action: ${unreachableKind(action)}`);\n\t\t}\n\t})() : \"\"}${ast.returning?.length ? ` RETURNING ${renderReturning(ast.returning, contract, pim)}` : \"\"}`;\n}\nfunction renderUpdate(ast, contract, pim) {\n\tconst table = qualifyTableFromNamespaceCoordinate(ast.table, contract);\n\tconst setEntries = Object.entries(ast.set);\n\tif (setEntries.length === 0) throw adapterError(\"RUNTIME.AST_INVALID\", \"UPDATE requires at least one SET assignment\", { meta: { node: \"update\" } });\n\tconst setClauses = setEntries.map(([col, val]) => {\n\t\treturn `${quoteIdentifier(col)} = ${renderExpr(val, contract, pim)}`;\n\t});\n\tconst whereClause = ast.where ? ` WHERE ${renderWhere(ast.where, contract, pim)}` : \"\";\n\tconst returningClause = ast.returning?.length ? ` RETURNING ${renderReturning(ast.returning, contract, pim)}` : \"\";\n\treturn `UPDATE ${table} SET ${setClauses.join(\", \")}${whereClause}${returningClause}`;\n}\nfunction renderDelete(ast, contract, pim) {\n\treturn `DELETE FROM ${qualifyTableFromNamespaceCoordinate(ast.table, contract)}${ast.where ? ` WHERE ${renderWhere(ast.where, contract, pim)}` : \"\"}${ast.returning?.length ? ` RETURNING ${renderReturning(ast.returning, contract, pim)}` : \"\"}`;\n}\nfunction renderParts(parts, contract, pim) {\n\treturn parts.map((part) => typeof part === \"string\" ? part : renderExpr(part, contract, pim)).join(\"\");\n}\nfunction renderRawExpr(node, contract, pim) {\n\treturn renderParts(node.parts, contract, pim);\n}\n//#endregion\nexport { adapterError as n, renderLoweredSql as t };\n\n//# sourceMappingURL=sql-renderer-DMMtw8lD.mjs.map"],"mappings":";;;;;;;;AAQA,SAAS,aAAa,MAAM,SAAS,SAAS;CAC7C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;;;;;;;;AAUA,MAAM,mDAAmD,IAAI,IAAI;CAChE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,SAAS,iBAAiB,OAAO,SAAS,yBAAyB,MAAM,YAAY;CACpF,IAAI,YAAY,KAAK,GAAG,OAAO,IAAI;CACnC,MAAM,aAAa,wBAAwB,cAAc,OAAO;CAChE,IAAI,eAAe,KAAK,GAAG,MAAM,aAAa,mCAAmC,gDAAgD,QAAQ,2TAA2T,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;CACzd,MAAM,MAAM;EACX;EACA,GAAG,UAAU,QAAQ,IAAI;EACzB,GAAG,UAAU,cAAc,UAAU;CACtC;CACA,MAAM,aAAa,WAAW,cAAc,GAAG;CAC/C,MAAM,cAAc,OAAO,OAAO;CAClC,IAAI,eAAe,UAAU,GAAG,OAAO,IAAI,MAAM,IAAI,mBAAmB,UAAU,IAAI;CACtF,IAAI,CAAC,iCAAiC,IAAI,UAAU,KAAK,MAAM,OAAO,IAAI,MAAM,IAAI,aAAa;CACjG,OAAO,IAAI;AACZ;AACA,SAAS,gBAAgB,OAAO;CAC/B,MAAM,YAAY;CAClB,IAAI,OAAO,cAAc,YAAY,cAAc,QAAQ,UAAU,aAAa,OAAO,UAAU,SAAS,UAAU,OAAO,UAAU;CACvI,OAAO;AACR;;;;;;AAMA,SAAS,iBAAiB,K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C;CACD,MAAM,cAAc,IAAI,QAAQ,UAAU,YAAY,IAAI,OAAO,UAAU,GAAG,MAAM;CACpF,MAAM,kBAAkB,IAAI,WAAW,SAAS,cAAc,gBAAgB,IAAI,WAAW,UAAU,GAAG,MAAM;CAChH,OAAO,UAAU,MAAM,OAAO,WAAW,KAAK,IAAI,IAAI,cAAc;AACrE;AACA,SAAS,aAAa,KAAK,UAAU,KAAK;CACzC,OAAO,eAAe,oCAAoC,IAAI,OAAO,QAAQ,IAAI,IAAI,QAAQ,UAAU,YAAY,IAAI,OAAO,UAAU,GAAG,MAAM,KAAK,IAAI,WAAW,SAAS,cAAc,gBAAgB,IAAI,WAAW,UAAU,GAAG,MAAM;AAC/O;AACA,SAAS,YAAY,OAAO,UAAU,KAAK;CAC1C,OAAO,MAAM,KAAK,SAAS,OAAO,SAAS,WAAW,OAAO,WAAW,MAAM,UAAU,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE;AACtG;AACA,SAAS,cAAc,MAAM,UAAU,KAAK;CAC3C,OAAO,YAAY,KAAK,OAAO,UAAU,GAAG;AAC7C"}
|
package/dist/target.d.mts
CHANGED
|
@@ -6,8 +6,8 @@ import { t as PostgresSchemaNodeKind } from "./schema-node-kinds-qlnURWJy-Bo30pw
|
|
|
6
6
|
import { t as PostgresColumnDefault } from "./types-ue6jkJyF-BQJzjx1P.mjs";
|
|
7
7
|
import { t as PostgresTableSource } from "./table-source-ikHOZmhD-DriY1Lcr.mjs";
|
|
8
8
|
import { a as PostgresRlsEnablementInput, c as PostgresSchema, d as postgresCreateNamespace, i as PostgresRlsEnablement, l as PostgresUnboundSchema, n as PostgresNativeEnum, o as PostgresRole, r as PostgresNativeEnumInput, s as PostgresRoleInput, t as PostgresContract, u as isPostgresSchema } from "./postgres-schema-Xsjt3RKO-Buv2X8ai.mjs";
|
|
9
|
-
import { i as postgresRenderCheckExpressions, n as PostgresCheckExpressionInput, r as PostgresCheckKind, t as PostgresCheckExpressionCandidate } from "./check-expressions-
|
|
10
|
-
import { n as policyInputFromSerialized, t as SerializedRlsPolicy } from "./types-
|
|
9
|
+
import { i as postgresRenderCheckExpressions, n as PostgresCheckExpressionInput, r as PostgresCheckKind, t as PostgresCheckExpressionCandidate } from "./check-expressions-D4R7JhiZ-q-dFPGT2.mjs";
|
|
10
|
+
import { n as policyInputFromSerialized, t as SerializedRlsPolicy } from "./types-B4IkFolc.mjs";
|
|
11
11
|
import { i as computeContentHash, n as POLICY_OPERATION_PREDICATES, r as RlsPolicyOperation, t as ContentHashParts } from "./canonicalize-CQlxSR4D-MnrT5gtW.mjs";
|
|
12
12
|
import { _ as PostgresDisableRowLevelSecurity, a as DdlIndexElements, b as PostgresDropType, c as PostgresAlterPolicyRename, d as PostgresCreatePolicy, f as PostgresCreateSchema, g as PostgresDdlVisitor, h as PostgresDdlNode, i as AnyPostgresDdlNode, l as PostgresAlterTable, m as PostgresCreateType, n as AlterTableActionVisitor, o as DropDefaultAction, p as PostgresCreateTable, r as AnyAlterTableAction, s as PostgresAlterIndexRename, t as AddColumnAction, u as PostgresCreateIndex, v as PostgresDropIndex, y as PostgresDropPolicy } from "./nodes-BU-V-aZA-RqwPH68u.mjs";
|
|
13
13
|
import "./ddl-B4Rh8ntj.mjs";
|
|
@@ -35,7 +35,7 @@ import { t as PostgresContractView } from "./postgres-contract-view-2OP5JnXl-D2f
|
|
|
35
35
|
import { t as PostgresMigration } from "./postgres-migration-BNsrwlxh-CwI5BqAu.mjs";
|
|
36
36
|
import { a as fn, c as placeholder, d as unique, i as createExtension, l as primaryKey, n as checkExpression, o as foreignKey, r as col, s as lit, t as MigrationCLI, u as rawSql } from "./migration-aFeTWTOJ.mjs";
|
|
37
37
|
import "./op-factory-call-BTU8I_x0.mjs";
|
|
38
|
-
import "./pack-
|
|
38
|
+
import "./pack-DzIekb44.mjs";
|
|
39
39
|
import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-BaviT8KK-Yo9kw6rs.mjs";
|
|
40
40
|
import { n as createPostgresMigrationPlanner, t as contractToPostgresDatabaseSchemaNode } from "./planner-CT-7zSfk.mjs";
|
|
41
41
|
import { n as buildColumnTypeSql, r as renderDefaultLiteral, t as buildColumnDefaultSql } from "./planner-ddl-builders-ijp60-JO.mjs";
|
package/dist/target.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import { a as jsonb, c as textArray, i as int8, l as timestamptz, n as buildSign
|
|
|
13
13
|
import { n as postgresResolveDefault, t as parsePostgresDefault } from "./default-normalizer-Ba5ZebHM-isV86rjy.mjs";
|
|
14
14
|
import { n as computeContentHash, t as POLICY_OPERATION_PREDICATES } from "./canonicalize-CrN3u_xM-D4MrOqcB.mjs";
|
|
15
15
|
import { n as instantNow, r as instantNowControlDescriptor, t as INSTANT_NOW_GENERATOR_ID } from "./authoring-BP1g8vkt-BTMgtNw-.mjs";
|
|
16
|
-
import { t as postgresRenderCheckExpressions } from "./check-expressions-
|
|
16
|
+
import { t as postgresRenderCheckExpressions } from "./check-expressions-DFTeR0rd-CSxSpyMV.mjs";
|
|
17
17
|
import { n as PostgresSchemaNodeKind, r as PostgresTableSchemaNode, t as PostgresNativeEnumSchemaNode } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
|
|
18
18
|
import { i as PostgresRoleSchemaNode, n as PostgresNamespaceSchemaNode, r as PostgresPolicySchemaNode, t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs";
|
|
19
19
|
import { t as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-Cab6g5MC-SRco-A7L.mjs";
|
|
@@ -31,7 +31,7 @@ import { t as renderOps } from "./render-ops-D2vJApKB-B281fzmn.mjs";
|
|
|
31
31
|
import { t as renderCallsToTypeScript } from "./render-typescript-Dqp1Spgn-B128r1qw.mjs";
|
|
32
32
|
import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-Xm7J_t52-DQhQj0-H.mjs";
|
|
33
33
|
import { t as createPostgresMigrationPlanner } from "./planner-DAtZtAe_-DKrBXmoL.mjs";
|
|
34
|
-
import { t as postgresRenderDefault } from "./control-
|
|
34
|
+
import { t as postgresRenderDefault } from "./control-8vja0qTt.mjs";
|
|
35
35
|
import { a as foreignKey, c as primaryKey, i as fn, l as rawSql, n as checkExpression, o as lit, r as col, s as placeholder, t as MigrationCLI, u as unique } from "./migration-PTHAY9Cv.mjs";
|
|
36
36
|
import { t as normalizeSchemaNativeType } from "./native-type-normalizer-yvd3tqv-.mjs";
|
|
37
37
|
export { AddCheckConstraintCall, AddColumnAction, AddColumnCall, AddForeignKeyCall, AddNativeEnumValueCall, AddNotNullColumnWithTempDefaultCall, AddPrimaryKeyCall, AddUniqueCall, AlterColumnTypeCall, CreateExtensionCall, CreateIndexCall, CreateNativeEnumTypeCall, CreatePostgresRlsPolicyCall, CreateSchemaCall, CreateTableCall, DataTransformCall, DisableRowLevelSecurityCall, DropCheckConstraintCall, DropColumnCall, DropConstraintCall, DropDefaultAction, DropDefaultCall, DropIndexCall, DropNativeEnumTypeCall, DropNotNullCall, DropPostgresRlsPolicyCall, DropTableCall, EnableRowLevelSecurityCall, INSTANT_NOW_GENERATOR_ID, PostgresMigration as Migration, MigrationCLI, PG_BIT_CODEC_ID, PG_BOOL_CODEC_ID, PG_BYTEA_CODEC_ID, PG_CHAR_CODEC_ID, PG_DATE_STRING_CODEC_ID, PG_DATE_TEMPORAL_CODEC_ID, PG_ENUM_CODEC_ID, PG_FLOAT4_CODEC_ID, PG_FLOAT8_CODEC_ID, PG_FLOAT_CODEC_ID, PG_INET_CODEC_ID, PG_INT2_CODEC_ID, PG_INT4_CODEC_ID, PG_INT8_CODEC_ID, PG_INT8_NUMBER_CODEC_ID, PG_INTERVAL_CODEC_ID, PG_INT_CODEC_ID, PG_JSONB_CODEC_ID, PG_JSON_CODEC_ID, PG_NUMERIC_CODEC_ID, PG_TEXT_ARRAY_CODEC_ID, PG_TEXT_CODEC_ID, PG_TIMESTAMPTZ_STRING_CODEC_ID, PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, PG_TIMESTAMP_STRING_CODEC_ID, PG_TIMESTAMP_TEMPORAL_CODEC_ID, PG_TIMETZ_CODEC_ID, PG_TIME_STRING_CODEC_ID, PG_TIME_TEMPORAL_CODEC_ID, PG_UNBOUNDED_INT_CODEC_ID, PG_UUID_CODEC_ID, PG_VARBIT_CODEC_ID, PG_VARCHAR_CODEC_ID, POLICY_OPERATION_PREDICATES, PostgresAlterIndexRename, PostgresAlterPolicyRename, PostgresAlterTable, PostgresCodecDescriptor, PostgresContractSerializer, PostgresContractView, PostgresCreateIndex, PostgresCreatePolicy, PostgresCreateSchema, PostgresCreateTable, PostgresCreateType, PostgresDatabaseSchemaNode, PostgresDdlNode, PostgresDisableRowLevelSecurity, PostgresDropIndex, PostgresDropPolicy, PostgresDropType, PostgresNamespaceSchemaNode, PostgresNativeEnum, PostgresNativeEnumSchemaNode, PostgresPolicySchemaNode, PostgresRlsEnablement, PostgresRlsPolicy, PostgresRole, PostgresRoleSchemaNode, PostgresSchema, PostgresSchemaNodeKind, PostgresTableSchemaNode, PostgresTableSource, PostgresUnboundSchema, RawSqlCall, RenameCheckConstraintCall, RenameIndexCall, RenamePostgresRlsPolicyCall, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID, SetDefaultCall, SetNotNullCall, TypeScriptRenderablePostgresMigration, addColumnAction, alterTable, buildBuiltinIdentityValue, buildColumnDefaultSql, buildColumnTypeSql, buildControlTableBootstrapQueries, buildExpectedFormatType, buildPostgresCodecDescriptorRegistry, buildPostgresPlanDiff, buildSchemaLookupMap, buildSignMarkerBootstrapQueries, checkExpression, coalesceSubtreeIssues, col, columnDefaultAst, columnExistsAst, columnNullabilityAst, columnTypeAst, computeContentHash, constraintExistsAst, contractToPostgresDatabaseSchemaNode, createExtension, createPostgresMigrationPlanner, createSchema, createTable, dataTransform, definePostgresCodecs, dropDefaultAction, errorPostgresMigrationStackMissing, escapeLiteral, extensionExistsAst, fn, foreignKey, hasForeignKey, hasIndex, hasUniqueConstraint, indexExistsAst, instantNow, instantNowControlDescriptor, int4, int8, isPgEnumParams, isPostgresCodecDescriptor, isPostgresSchema, jsonb, lit, noNullValuesAst, normalizeSchemaNativeType, parsePostgresDefault, pgBitColumn, pgBoolColumn, pgCharColumn, pgEnumDescriptor, pgFloat4Column, pgFloat8Column, pgFloatColumn, pgInetColumn, pgInt2Column, pgInt4Column, pgInt8Column, pgInt8NumberColumn, pgIntColumn, pgIntervalColumn, pgJsonColumn, pgJsonbColumn, pgNumericColumn, pgTable, pgTextColumn, pgTimetzColumn, pgUnboundedIntColumn, pgUuidColumn, pgVarbitColumn, pgVarcharColumn, placeholder, planIssues, policyInputFromSerialized, postgresAggregateDescriptors, postgresCodec, postgresCodecDescriptorRegistry, postgresCodecRegistry, postgresCreateNamespace, postgresError, postgresRenderCheckExpressions, postgresRenderDefault, postgresResolveDefault, primaryKey, qualifyName, qualifyTableName, quoteIdentifier, quoteQualifiedName, rawSql, renderCallsToTypeScript, renderDefaultLiteral, renderOps, resolveDdlSchemaForNamespaceStorage, resolveIdentityValue, rlsEnabledAst, rlsPolicyExistsAst, tableExistsAst, tableIsEmptyAst, tablePrimaryKeyAst, text, textArray, timestamptz, toRegclass, unique, validateEnumValueLength };
|
package/dist/target__control.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { r as instantNowControlDescriptor, t as INSTANT_NOW_GENERATOR_ID } from "./authoring-BP1g8vkt-BTMgtNw-.mjs";
|
|
2
|
-
import { n as postgresTargetDescriptor, t as postgresRenderDefault } from "./control-
|
|
2
|
+
import { n as postgresTargetDescriptor, t as postgresRenderDefault } from "./control-8vja0qTt.mjs";
|
|
3
3
|
export { INSTANT_NOW_GENERATOR_ID, postgresTargetDescriptor as default, instantNowControlDescriptor, postgresRenderDefault };
|
package/dist/target__pack.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as postgresTargetDescriptorMeta } from "./pack-
|
|
1
|
+
import { t as postgresTargetDescriptorMeta } from "./pack-DzIekb44.mjs";
|
|
2
2
|
export { postgresTargetDescriptorMeta as default };
|
package/dist/target__pack.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-
|
|
1
|
+
import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-DcyEqysx-CR7vdo-V.mjs";
|
|
2
2
|
export { postgresTargetDescriptorMeta as default };
|
package/dist/target__types.d.mts
CHANGED
|
@@ -3,6 +3,6 @@ import { a as PostgresNativeEnumSchemaNode, c as PostgresPolicySchemaNodeInput,
|
|
|
3
3
|
import { t as PostgresSchemaNodeKind } from "./schema-node-kinds-qlnURWJy-Bo30pwTM.mjs";
|
|
4
4
|
import { t as PostgresColumnDefault } from "./types-ue6jkJyF-BQJzjx1P.mjs";
|
|
5
5
|
import { a as PostgresRlsEnablementInput, c as PostgresSchema, d as postgresCreateNamespace, i as PostgresRlsEnablement, l as PostgresUnboundSchema, n as PostgresNativeEnum, o as PostgresRole, r as PostgresNativeEnumInput, s as PostgresRoleInput, t as PostgresContract, u as isPostgresSchema } from "./postgres-schema-Xsjt3RKO-Buv2X8ai.mjs";
|
|
6
|
-
import { i as postgresRenderCheckExpressions, n as PostgresCheckExpressionInput, r as PostgresCheckKind, t as PostgresCheckExpressionCandidate } from "./check-expressions-
|
|
7
|
-
import { n as policyInputFromSerialized, t as SerializedRlsPolicy } from "./types-
|
|
6
|
+
import { i as postgresRenderCheckExpressions, n as PostgresCheckExpressionInput, r as PostgresCheckKind, t as PostgresCheckExpressionCandidate } from "./check-expressions-D4R7JhiZ-q-dFPGT2.mjs";
|
|
7
|
+
import { n as policyInputFromSerialized, t as SerializedRlsPolicy } from "./types-B4IkFolc.mjs";
|
|
8
8
|
export { type PostgresCheckExpressionCandidate, type PostgresCheckExpressionInput, type PostgresCheckKind, type PostgresColumnDefault, type PostgresContract, PostgresDatabaseSchemaNode, type PostgresDatabaseSchemaNodeInput, PostgresNamespaceSchemaNode, type PostgresNamespaceSchemaNodeInput, PostgresNativeEnum, type PostgresNativeEnumInput, PostgresNativeEnumSchemaNode, type PostgresNativeEnumSchemaNodeInput, PostgresPolicySchemaNode, type PostgresPolicySchemaNodeInput, PostgresRlsEnablement, type PostgresRlsEnablementInput, PostgresRlsPolicy, type PostgresRlsPolicyInput, PostgresRole, type PostgresRoleInput, PostgresRoleSchemaNode, type PostgresRoleSchemaNodeInput, PostgresSchema, PostgresSchemaNodeKind, PostgresTableSchemaNode, type PostgresTableSchemaNodeInput, PostgresUnboundSchema, type RenderedRlsPolicyLiteral, type RlsPolicyOperation, type SerializedRlsPolicy, isPostgresSchema, policyInputFromSerialized, postgresCreateNamespace, postgresRenderCheckExpressions };
|
package/dist/target__types.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as PostgresNativeEnum } from "./postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs";
|
|
2
2
|
import { c as PostgresSchema, d as isPostgresSchema, h as postgresCreateNamespace, i as PostgresRlsPolicy, m as policyInputFromSerialized, n as PostgresRlsEnablement, o as PostgresRole, u as PostgresUnboundSchema } from "./postgres-schema-B3t7Zr52-CMlY9aGw.mjs";
|
|
3
|
-
import { t as postgresRenderCheckExpressions } from "./check-expressions-
|
|
3
|
+
import { t as postgresRenderCheckExpressions } from "./check-expressions-DFTeR0rd-CSxSpyMV.mjs";
|
|
4
4
|
import { n as PostgresSchemaNodeKind, r as PostgresTableSchemaNode, t as PostgresNativeEnumSchemaNode } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
|
|
5
5
|
import { i as PostgresRoleSchemaNode, n as PostgresNamespaceSchemaNode, r as PostgresPolicySchemaNode, t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs";
|
|
6
6
|
export { PostgresDatabaseSchemaNode, PostgresNamespaceSchemaNode, PostgresNativeEnum, PostgresNativeEnumSchemaNode, PostgresPolicySchemaNode, PostgresRlsEnablement, PostgresRlsPolicy, PostgresRole, PostgresRoleSchemaNode, PostgresSchema, PostgresSchemaNodeKind, PostgresTableSchemaNode, PostgresUnboundSchema, isPostgresSchema, policyInputFromSerialized, postgresCreateNamespace, postgresRenderCheckExpressions };
|
|
@@ -3,7 +3,7 @@ import "./postgres-database-schema-node-CyfpHXDr-BqyozkQE.mjs";
|
|
|
3
3
|
import "./schema-node-kinds-qlnURWJy-Bo30pwTM.mjs";
|
|
4
4
|
import "./types-ue6jkJyF-BQJzjx1P.mjs";
|
|
5
5
|
import "./postgres-schema-Xsjt3RKO-Buv2X8ai.mjs";
|
|
6
|
-
import "./check-expressions-
|
|
6
|
+
import "./check-expressions-D4R7JhiZ-q-dFPGT2.mjs";
|
|
7
7
|
//#region ../../../3-targets/3-targets/postgres/dist/types.d.mts
|
|
8
8
|
//#region src/core/serialized-rls-policy.d.ts
|
|
9
9
|
/**
|
|
@@ -30,4 +30,4 @@ type SerializedRlsPolicy = {
|
|
|
30
30
|
declare function policyInputFromSerialized(flat: SerializedRlsPolicy): PostgresRlsPolicyInput;
|
|
31
31
|
//#endregion
|
|
32
32
|
export { policyInputFromSerialized as n, SerializedRlsPolicy as t };
|
|
33
|
-
//# sourceMappingURL=types-
|
|
33
|
+
//# sourceMappingURL=types-B4IkFolc.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-B4IkFolc.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/types.d.mts"],"mappings":";;;;;;;;;;;;;KAYK;WACM;WACA;WACA;WACA;WACA,WAAW;WACX;WACA;WACA;WACA;;;;;;;iBAOM,0BAA0B,MAAM,sBAAsB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./types-CkryN1AS-CZtzRJFZ.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as PostgresCodecDescriptorRegistry, n as AnyPostgresCodecDescriptor } from "./codec-descriptor-Bec_zukr-BfvtUqhm.mjs";
|
|
2
2
|
import "./codec-descriptor-Bg-_412t.mjs";
|
|
3
|
-
import "./types-
|
|
3
|
+
import "./types-B4IkFolc.mjs";
|
|
4
4
|
import { BinaryExpr as BinaryExpr$1, ColumnRef as ColumnRef$1, DefaultValueExpr, Direction, LoweredStatement, ParamRef, SelectAst as SelectAst$1 } from "@prisma/orm-family-sql/relational-core/ast";
|
|
5
5
|
import { CodecRegistry } from "@prisma/orm-framework/components/codec";
|
|
6
6
|
import { StorageColumn as StorageColumn$1, StorageTable as StorageTable$1 } from "@prisma/orm-family-sql/contract/types";
|
|
@@ -24,4 +24,4 @@ interface OrderClause {
|
|
|
24
24
|
type PostgresLoweredStatement = LoweredStatement;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { OrderClause as a, PostgresCodecRegistry as c, StorageColumn$1 as d, StorageTable$1 as f, Expr as i, PostgresLoweredStatement as l, ColumnRef$1 as n, ParamRef as o, Direction as r, PostgresAdapterOptions as s, BinaryExpr$1 as t, SelectAst$1 as u };
|
|
27
|
-
//# sourceMappingURL=types-CkryN1AS-
|
|
27
|
+
//# sourceMappingURL=types-CkryN1AS-CZtzRJFZ.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-CkryN1AS-
|
|
1
|
+
{"version":3,"file":"types-CkryN1AS-CZtzRJFZ.d.mts","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/types-CkryN1AS.d.mts"],"mappings":";;;;;;;;KAMK,wBAAwB,gBAAgB;UACnC;WACC;;;;;;WAMA,4BAA4B;;KAElC,OAAO,cAAY,WAAW;UACzB;WACC,MAAM;WACN,KAAK;;KAEX,2BAA2B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/orm-target-postgres",
|
|
3
|
-
"version": "8.0.0-rc.8-dev.
|
|
3
|
+
"version": "8.0.0-rc.8-dev.18",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@prisma/orm-family-sql": "8.0.0-rc.8-dev.
|
|
13
|
-
"@prisma/orm-framework": "8.0.0-rc.8-dev.
|
|
14
|
-
"@prisma/orm-toolchain": "8.0.0-rc.8-dev.
|
|
12
|
+
"@prisma/orm-family-sql": "8.0.0-rc.8-dev.18",
|
|
13
|
+
"@prisma/orm-framework": "8.0.0-rc.8-dev.18",
|
|
14
|
+
"@prisma/orm-toolchain": "8.0.0-rc.8-dev.18",
|
|
15
15
|
"@standard-schema/spec": "^1.1.0",
|
|
16
16
|
"@types/pg": "8.20.4",
|
|
17
17
|
"arktype": "^2.2.2",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"pg-cursor": "^2.21.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@internal/adapter-postgres": "8.0.0-rc.8-dev.
|
|
24
|
-
"@internal/driver-postgres": "8.0.0-rc.8-dev.
|
|
25
|
-
"@internal/target-postgres": "8.0.0-rc.8-dev.
|
|
26
|
-
"@repo/tsconfig": "8.0.0-rc.8-dev.
|
|
27
|
-
"@repo/tsdown": "8.0.0-rc.8-dev.
|
|
23
|
+
"@internal/adapter-postgres": "8.0.0-rc.8-dev.18",
|
|
24
|
+
"@internal/driver-postgres": "8.0.0-rc.8-dev.18",
|
|
25
|
+
"@internal/target-postgres": "8.0.0-rc.8-dev.18",
|
|
26
|
+
"@repo/tsconfig": "8.0.0-rc.8-dev.18",
|
|
27
|
+
"@repo/tsdown": "8.0.0-rc.8-dev.18",
|
|
28
28
|
"tsdown": "0.22.14",
|
|
29
29
|
"typescript": "5.9.3",
|
|
30
30
|
"vitest": "5.0.0-rc.2"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"check-expressions-B3Xp6IFg-BzCFYrC9.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/check-expressions-B3Xp6IFg.mjs"],"sourcesContent":["import { r as quoteIdentifier, t as escapeLiteral } from \"./sql-utils-6j9YTLpr.mjs\";\nimport { invariant } from \"@internal/utils/assertions\";\n//#region src/core/check-expressions.ts\n/**\n* Renders the checks a Postgres column needs, as opaque predicate text.\n*\n* A text-backed domain enum has no type-level enforcement, so membership is a\n* predicate: `IN` for a scalar, and `<@` containment for an array — an array\n* column cannot use `IN` at all (`operator does not exist: text[] = text`),\n* and containment additionally rejects NULL elements. Every list column also\n* gets an element-non-null check, which no Postgres column type can express.\n*\n* The array side casts the COLUMN to `text[]` rather than assuming its element\n* type already is: `<@` needs both operands in one type, so a `varchar[]` or\n* `char[]` column meeting a bare `text[]` literal raises the same\n* `operator does not exist` this project exists to eliminate. The scalar `IN`\n* form needs no cast — `varchar = text` resolves on its own.\n*/\nfunction postgresRenderCheckExpressions(input) {\n\tconst candidates = [];\n\tconst column = quoteIdentifier(input.columnName);\n\tif (input.memberValues !== void 0) {\n\t\tinvariant(input.memberValues.length > 0, `check for \"${input.tableName}\".\"${input.columnName}\": empty member set; both authoring surfaces reject a member-less enum before rendering`);\n\t\tconst members = input.memberValues.map((value) => `'${escapeLiteral(value)}'`).join(\", \");\n\t\tcandidates.push({\n\t\t\tkind: \"membership\",\n\t\t\tcolumnName: input.columnName,\n\t\t\texpression: input.many ? `${column}::text[] <@ ARRAY[${members}]::text[]` : `${column} IN (${members})`\n\t\t});\n\t}\n\tif (input.many) candidates.push({\n\t\tkind: \"elementNotNull\",\n\t\tcolumnName: input.columnName,\n\t\texpression: `array_position(${column}, NULL) IS NULL`\n\t});\n\treturn candidates;\n}\n//#endregion\nexport { postgresRenderCheckExpressions as t };\n\n//# sourceMappingURL=check-expressions-B3Xp6IFg.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,SAAS,+BAA+B,OAAO;CAC9C,MAAM,aAAa,CAAC;CACpB,MAAM,SAAS,gBAAgB,MAAM,UAAU;CAC/C,IAAI,MAAM,iBAAiB,KAAK,GAAG;EAClC,UAAU,MAAM,aAAa,SAAS,GAAG,cAAc,MAAM,UAAU,KAAK,MAAM,WAAW,wFAAwF;EACrL,MAAM,UAAU,MAAM,aAAa,KAAK,UAAU,IAAI,cAAc,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI;EACxF,WAAW,KAAK;GACf,MAAM;GACN,YAAY,MAAM;GAClB,YAAY,MAAM,OAAO,GAAG,OAAO,oBAAoB,QAAQ,aAAa,GAAG,OAAO,OAAO,QAAQ;EACtG,CAAC;CACF;CACA,IAAI,MAAM,MAAM,WAAW,KAAK;EAC/B,MAAM;EACN,YAAY,MAAM;EAClB,YAAY,kBAAkB,OAAO;CACtC,CAAC;CACD,OAAO;AACR"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"check-expressions-DRgG8RN5-DiA-22aC.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/check-expressions-DRgG8RN5.d.mts"],"mappings":";;;;;;;;;KAQK,oBAAoB;;;;;;;UAOf;WACC;WACA;WACA;WACA;;;;;;;;UAQD;WACC,MAAM;;WAEN;;WAEA;;;;;;;;;;;;;;;;;iBAiBM,+BAA+B,OAAO,wCAAwC"}
|