@prisma-next/adapter-postgres 0.16.0-dev.27 → 0.16.0-dev.29
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/control.mjs
CHANGED
|
@@ -229,13 +229,6 @@ const postgresScalarAuthoringTypes = {
|
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
};
|
|
232
|
-
/**
|
|
233
|
-
* The former `@db.*` native types as first-class top-level type constructors
|
|
234
|
-
* (TML-2986). Codec ids, native types, and typeParams key shapes mirror the
|
|
235
|
-
* legacy `@db.*` attribute path (`NATIVE_TYPE_SPECS` in sql-contract-psl)
|
|
236
|
-
* exactly; every argument is optional, so each name is also authorable bare
|
|
237
|
-
* (`VarChar` ≡ `VarChar()`), and omitted arguments omit their typeParams keys.
|
|
238
|
-
*/
|
|
239
232
|
const postgresNativeAuthoringTypes = {
|
|
240
233
|
VarChar: {
|
|
241
234
|
kind: "typeConstructor",
|
|
@@ -382,6 +375,13 @@ const postgresNativeAuthoringTypes = {
|
|
|
382
375
|
nativeType: "uuid"
|
|
383
376
|
}
|
|
384
377
|
},
|
|
378
|
+
Inet: {
|
|
379
|
+
kind: "typeConstructor",
|
|
380
|
+
output: {
|
|
381
|
+
codecId: "pg/inet@1",
|
|
382
|
+
nativeType: "inet"
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
385
|
SmallInt: {
|
|
386
386
|
kind: "typeConstructor",
|
|
387
387
|
output: {
|
package/dist/control.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.mjs","names":[],"sources":["../src/core/control-mutation-defaults.ts","../src/exports/control.ts"],"sourcesContent":["import type { ExecutionMutationDefaultValue } from '@prisma-next/contract/types';\nimport { timestampNowControlDescriptor } from '@prisma-next/family-sql/control';\nimport type { AuthoringTypeNamespace } from '@prisma-next/framework-components/authoring';\nimport type {\n ControlMutationDefaultEntry,\n DefaultFunctionLoweringContext,\n LoweredDefaultResult,\n MutationDefaultGeneratorDescriptor,\n TypedDefaultFunctionCall,\n} from '@prisma-next/framework-components/control';\nimport { builtinGeneratorRegistryMetadata } from '@prisma-next/ids';\nimport type { FuncCallSig } from '@prisma-next/psl-parser';\nimport { int, num, oneOf, optional, str } from '@prisma-next/psl-parser';\n\nfunction invalidArgumentDiagnostic(input: {\n readonly context: DefaultFunctionLoweringContext;\n readonly span: TypedDefaultFunctionCall['span'];\n readonly message: string;\n}): LoweredDefaultResult {\n return {\n ok: false,\n diagnostic: {\n code: 'PSL_INVALID_DEFAULT_FUNCTION_ARGUMENT',\n message: input.message,\n sourceId: input.context.sourceId,\n span: input.span,\n },\n };\n}\n\nfunction executionGenerator(\n id: ExecutionMutationDefaultValue['id'],\n params?: Record<string, unknown>,\n): LoweredDefaultResult {\n return {\n ok: true,\n value: {\n kind: 'execution',\n generated: {\n kind: 'generator',\n id,\n ...(params ? { params } : {}),\n },\n },\n };\n}\n\nfunction lowerAutoincrement(): LoweredDefaultResult {\n return {\n ok: true,\n value: {\n kind: 'storage',\n defaultValue: { kind: 'function', expression: 'autoincrement()' },\n },\n };\n}\n\nfunction lowerNow(): LoweredDefaultResult {\n return {\n ok: true,\n value: {\n kind: 'storage',\n defaultValue: { kind: 'function', expression: 'now()' },\n },\n };\n}\n\nfunction lowerUlid(): LoweredDefaultResult {\n return executionGenerator('ulid');\n}\n\nfunction lowerUuid(input: {\n readonly call: TypedDefaultFunctionCall;\n readonly context: DefaultFunctionLoweringContext;\n}): LoweredDefaultResult {\n return input.call.args['version'] === 7\n ? executionGenerator('uuidv7')\n : executionGenerator('uuidv4');\n}\n\nfunction lowerCuid(): LoweredDefaultResult {\n return executionGenerator('cuid2');\n}\n\nfunction lowerNanoid(input: {\n readonly call: TypedDefaultFunctionCall;\n readonly context: DefaultFunctionLoweringContext;\n}): LoweredDefaultResult {\n const size = input.call.args['size'];\n return typeof size === 'number'\n ? executionGenerator('nanoid', { size })\n : executionGenerator('nanoid');\n}\n\nfunction lowerDbgenerated(input: {\n readonly call: TypedDefaultFunctionCall;\n readonly context: DefaultFunctionLoweringContext;\n}): LoweredDefaultResult {\n const expression = input.call.args['expression'];\n if (typeof expression !== 'string' || expression.trim().length === 0) {\n return invalidArgumentDiagnostic({\n context: input.context,\n span: input.call.span,\n message: 'Default function \"dbgenerated\" argument cannot be empty.',\n });\n }\n return {\n ok: true,\n value: {\n kind: 'storage',\n defaultValue: { kind: 'function', expression },\n },\n };\n}\n\nconst nowSig: FuncCallSig = {};\nconst autoincrementSig: FuncCallSig = {};\nconst ulidSig: FuncCallSig = {};\nconst uuidSig: FuncCallSig = {\n positional: [{ key: 'version', type: optional(oneOf(num(4), num(7))) }],\n};\nconst cuidSig: FuncCallSig = { positional: [{ key: 'version', type: num(2) }] };\nconst nanoidSig: FuncCallSig = {\n positional: [{ key: 'size', type: optional(int({ min: 2, max: 255 })) }],\n};\nconst dbgeneratedSig: FuncCallSig = { positional: [{ key: 'expression', type: str() }] };\n\nconst postgresDefaultFunctionRegistryEntries = [\n [\n 'autoincrement',\n {\n signature: autoincrementSig,\n lower: lowerAutoincrement,\n usageSignatures: ['autoincrement()'],\n },\n ],\n ['now', { signature: nowSig, lower: lowerNow, usageSignatures: ['now()'] }],\n [\n 'uuid',\n { signature: uuidSig, lower: lowerUuid, usageSignatures: ['uuid()', 'uuid(4)', 'uuid(7)'] },\n ],\n ['cuid', { signature: cuidSig, lower: lowerCuid, usageSignatures: ['cuid(2)'] }],\n ['ulid', { signature: ulidSig, lower: lowerUlid, usageSignatures: ['ulid()'] }],\n [\n 'nanoid',\n { signature: nanoidSig, lower: lowerNanoid, usageSignatures: ['nanoid()', 'nanoid(<2-255>)'] },\n ],\n [\n 'dbgenerated',\n { signature: dbgeneratedSig, lower: lowerDbgenerated, usageSignatures: ['dbgenerated(\"...\")'] },\n ],\n] satisfies ReadonlyArray<readonly [string, ControlMutationDefaultEntry]>;\n\n/**\n * The base PSL scalars as zero-arg type constructors in the unified authoring\n * channel, with explicit `nativeType` values pinned to the codec manifests\n * (`codecLookup.targetTypesFor(codecId)[0]`).\n *\n * The type position is the only storage decider: a mutation-default generator\n * (`@default(uuid())`) never re-picks a column's storage.\n */\nexport const postgresScalarAuthoringTypes = {\n String: {\n kind: 'typeConstructor',\n output: { codecId: 'pg/text@1', nativeType: 'text' },\n },\n Boolean: {\n kind: 'typeConstructor',\n output: { codecId: 'pg/bool@1', nativeType: 'bool' },\n },\n Int: {\n kind: 'typeConstructor',\n output: { codecId: 'pg/int4@1', nativeType: 'int4' },\n },\n BigInt: {\n kind: 'typeConstructor',\n output: { codecId: 'pg/int8@1', nativeType: 'int8' },\n },\n Float: {\n kind: 'typeConstructor',\n output: { codecId: 'pg/float8@1', nativeType: 'float8' },\n },\n Decimal: {\n kind: 'typeConstructor',\n output: { codecId: 'pg/numeric@1', nativeType: 'numeric' },\n },\n DateTime: {\n kind: 'typeConstructor',\n output: { codecId: 'pg/timestamptz@1', nativeType: 'timestamptz' },\n },\n Json: {\n kind: 'typeConstructor',\n output: { codecId: 'pg/json@1', nativeType: 'json' },\n },\n Jsonb: {\n kind: 'typeConstructor',\n output: { codecId: 'pg/jsonb@1', nativeType: 'jsonb' },\n },\n Bytes: {\n kind: 'typeConstructor',\n output: { codecId: 'pg/bytea@1', nativeType: 'bytea' },\n },\n} as const satisfies AuthoringTypeNamespace;\n\n/**\n * The former `@db.*` native types as first-class top-level type constructors\n * (TML-2986). Codec ids, native types, and typeParams key shapes mirror the\n * legacy `@db.*` attribute path (`NATIVE_TYPE_SPECS` in sql-contract-psl)\n * exactly; every argument is optional, so each name is also authorable bare\n * (`VarChar` ≡ `VarChar()`), and omitted arguments omit their typeParams keys.\n */\nexport const postgresNativeAuthoringTypes = {\n VarChar: {\n kind: 'typeConstructor',\n args: [{ kind: 'number', name: 'length', integer: true, minimum: 1, optional: true }],\n output: {\n codecId: 'sql/varchar@1',\n nativeType: 'character varying',\n typeParams: { length: { kind: 'arg', index: 0 } },\n },\n },\n Char: {\n kind: 'typeConstructor',\n args: [{ kind: 'number', name: 'length', integer: true, minimum: 1, optional: true }],\n output: {\n codecId: 'sql/char@1',\n nativeType: 'character',\n typeParams: { length: { kind: 'arg', index: 0 } },\n },\n },\n Numeric: {\n kind: 'typeConstructor',\n args: [\n { kind: 'number', name: 'precision', integer: true, minimum: 1, optional: true },\n { kind: 'number', name: 'scale', integer: true, minimum: 0, optional: true },\n ],\n output: {\n codecId: 'pg/numeric@1',\n nativeType: 'numeric',\n typeParams: {\n precision: { kind: 'arg', index: 0 },\n scale: { kind: 'arg', index: 1 },\n },\n },\n },\n Timestamp: {\n kind: 'typeConstructor',\n args: [{ kind: 'number', name: 'precision', integer: true, minimum: 0, optional: true }],\n output: {\n codecId: 'pg/timestamp@1',\n nativeType: 'timestamp',\n typeParams: { precision: { kind: 'arg', index: 0 } },\n },\n },\n Timestamptz: {\n kind: 'typeConstructor',\n args: [{ kind: 'number', name: 'precision', integer: true, minimum: 0, optional: true }],\n output: {\n codecId: 'pg/timestamptz@1',\n nativeType: 'timestamptz',\n typeParams: { precision: { kind: 'arg', index: 0 } },\n },\n },\n Time: {\n kind: 'typeConstructor',\n args: [{ kind: 'number', name: 'precision', integer: true, minimum: 0, optional: true }],\n output: {\n codecId: 'pg/time@1',\n nativeType: 'time',\n typeParams: { precision: { kind: 'arg', index: 0 } },\n },\n },\n Timetz: {\n kind: 'typeConstructor',\n args: [{ kind: 'number', name: 'precision', integer: true, minimum: 0, optional: true }],\n output: {\n codecId: 'pg/timetz@1',\n nativeType: 'timetz',\n typeParams: { precision: { kind: 'arg', index: 0 } },\n },\n },\n Uuid: { kind: 'typeConstructor', output: { codecId: 'pg/uuid@1', nativeType: 'uuid' } },\n SmallInt: { kind: 'typeConstructor', output: { codecId: 'pg/int2@1', nativeType: 'int2' } },\n Real: { kind: 'typeConstructor', output: { codecId: 'pg/float4@1', nativeType: 'float4' } },\n Date: { kind: 'typeConstructor', output: { codecId: 'pg/date@1', nativeType: 'date' } },\n} as const satisfies AuthoringTypeNamespace;\n\nexport const postgresAuthoringTypes = {\n ...postgresScalarAuthoringTypes,\n ...postgresNativeAuthoringTypes,\n} as const satisfies AuthoringTypeNamespace;\n\nexport function createPostgresDefaultFunctionRegistry(): ReadonlyMap<\n string,\n ControlMutationDefaultEntry\n> {\n return new Map(postgresDefaultFunctionRegistryEntries);\n}\n\nexport function createPostgresMutationDefaultGeneratorDescriptors(): readonly MutationDefaultGeneratorDescriptor[] {\n return [\n ...builtinGeneratorRegistryMetadata.map(\n ({ id, applicableCodecIds }): MutationDefaultGeneratorDescriptor => ({\n id,\n applicableCodecIds,\n }),\n ),\n timestampNowControlDescriptor(),\n ];\n}\n","import type { SqlControlAdapterDescriptor } from '@prisma-next/family-sql/control';\nimport type { SqlControlAdapter } from '@prisma-next/family-sql/control-adapter';\nimport {\n escapeLiteral,\n qualifyName,\n quoteIdentifier,\n} from '@prisma-next/target-postgres/sql-utils';\nimport { PostgresControlAdapter } from '../core/control-adapter';\nimport {\n createPostgresDefaultFunctionRegistry,\n createPostgresMutationDefaultGeneratorDescriptors,\n postgresAuthoringTypes,\n} from '../core/control-mutation-defaults';\nimport { postgresAdapterDescriptorMeta } from '../core/descriptor-meta';\n\nconst postgresAdapterDescriptor: SqlControlAdapterDescriptor<'postgres'> = {\n ...postgresAdapterDescriptorMeta,\n authoring: { type: postgresAuthoringTypes, valueObjectStorageType: 'Jsonb' },\n controlMutationDefaults: {\n defaultFunctionRegistry: createPostgresDefaultFunctionRegistry(),\n generatorDescriptors: createPostgresMutationDefaultGeneratorDescriptors(),\n },\n create(stack): SqlControlAdapter<'postgres'> {\n return new PostgresControlAdapter(stack.codecLookup);\n },\n};\n\nexport default postgresAdapterDescriptor;\n\nexport { parsePostgresDefault } from '@prisma-next/target-postgres/default-normalizer';\nexport { normalizeSchemaNativeType } from '@prisma-next/target-postgres/native-type-normalizer';\nexport { createPostgresBuiltinCodecLookup } from '../core/codec-lookup';\nexport { PostgresControlAdapter } from '../core/control-adapter';\nexport { escapeLite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Q;GAAE,SAAS;GAAa,YAAY;EAAO;CAAE;CAC1F,MAAM;EAAE,MAAM;EAAmB,QAAQ;GAAE,SAAS;GAAe,YAAY;EAAS;CAAE;CAC1F,MAAM;EAAE,MAAM;EAAmB,QAAQ;GAAE,SAAS;GAAa,YAAY;EAAO;CAAE;AACxF;AAEA,MAAa,yBAAyB;CACpC,GAAG;CACH,GAAG;AACL;AAEA,SAAgB,wCAGd;CACA,OAAO,IAAI,IAAI,sCAAsC;AACvD;AAEA,SAAgB,oDAAmG;CACjH,OAAO,CACL,GAAG,iCAAiC,KACjC,EAAE,IAAI,0BAA8D;EACnE;EACA;CACF,EACF,GACA,8BAA8B,CAChC;AACF;;;ACtSA,MAAM,4BAAqE;CACzE,GAAG;CACH,WAAW;EAAE,MAAM;EAAwB,wBAAwB;CAAQ;CAC3E,yBAAyB;EACvB,yBAAyB,sCAAsC;EAC/D,sBAAsB,kDAAkD;CAC1E;CACA,OAAO,OAAsC;EAC3C,OAAO,IAAI,uBAAuB,MAAM,WAAW;CACrD;AACF"}
|
|
1
|
+
{"version":3,"file":"control.mjs","names":[],"sources":["../src/core/control-mutation-defaults.ts","../src/exports/control.ts"],"sourcesContent":["import type { ExecutionMutationDefaultValue } from '@prisma-next/contract/types';\nimport { timestampNowControlDescriptor } from '@prisma-next/family-sql/control';\nimport type { AuthoringTypeNamespace } from '@prisma-next/framework-components/authoring';\nimport type {\n ControlMutationDefaultEntry,\n DefaultFunctionLoweringContext,\n LoweredDefaultResult,\n MutationDefaultGeneratorDescriptor,\n TypedDefaultFunctionCall,\n} from '@prisma-next/framework-components/control';\nimport { builtinGeneratorRegistryMetadata } from '@prisma-next/ids';\nimport type { FuncCallSig } from '@prisma-next/psl-parser';\nimport { int, num, oneOf, optional, str } from '@prisma-next/psl-parser';\n\nfunction invalidArgumentDiagnostic(input: {\n readonly context: DefaultFunctionLoweringContext;\n readonly span: TypedDefaultFunctionCall['span'];\n readonly message: string;\n}): LoweredDefaultResult {\n return {\n ok: false,\n diagnostic: {\n code: 'PSL_INVALID_DEFAULT_FUNCTION_ARGUMENT',\n message: input.message,\n sourceId: input.context.sourceId,\n span: input.span,\n },\n };\n}\n\nfunction executionGenerator(\n id: ExecutionMutationDefaultValue['id'],\n params?: Record<string, unknown>,\n): LoweredDefaultResult {\n return {\n ok: true,\n value: {\n kind: 'execution',\n generated: {\n kind: 'generator',\n id,\n ...(params ? { params } : {}),\n },\n },\n };\n}\n\nfunction lowerAutoincrement(): LoweredDefaultResult {\n return {\n ok: true,\n value: {\n kind: 'storage',\n defaultValue: { kind: 'function', expression: 'autoincrement()' },\n },\n };\n}\n\nfunction lowerNow(): LoweredDefaultResult {\n return {\n ok: true,\n value: {\n kind: 'storage',\n defaultValue: { kind: 'function', expression: 'now()' },\n },\n };\n}\n\nfunction lowerUlid(): LoweredDefaultResult {\n return executionGenerator('ulid');\n}\n\nfunction lowerUuid(input: {\n readonly call: TypedDefaultFunctionCall;\n readonly context: DefaultFunctionLoweringContext;\n}): LoweredDefaultResult {\n return input.call.args['version'] === 7\n ? executionGenerator('uuidv7')\n : executionGenerator('uuidv4');\n}\n\nfunction lowerCuid(): LoweredDefaultResult {\n return executionGenerator('cuid2');\n}\n\nfunction lowerNanoid(input: {\n readonly call: TypedDefaultFunctionCall;\n readonly context: DefaultFunctionLoweringContext;\n}): LoweredDefaultResult {\n const size = input.call.args['size'];\n return typeof size === 'number'\n ? executionGenerator('nanoid', { size })\n : executionGenerator('nanoid');\n}\n\nfunction lowerDbgenerated(input: {\n readonly call: TypedDefaultFunctionCall;\n readonly context: DefaultFunctionLoweringContext;\n}): LoweredDefaultResult {\n const expression = input.call.args['expression'];\n if (typeof expression !== 'string' || expression.trim().length === 0) {\n return invalidArgumentDiagnostic({\n context: input.context,\n span: input.call.span,\n message: 'Default function \"dbgenerated\" argument cannot be empty.',\n });\n }\n return {\n ok: true,\n value: {\n kind: 'storage',\n defaultValue: { kind: 'function', expression },\n },\n };\n}\n\nconst nowSig: FuncCallSig = {};\nconst autoincrementSig: FuncCallSig = {};\nconst ulidSig: FuncCallSig = {};\nconst uuidSig: FuncCallSig = {\n positional: [{ key: 'version', type: optional(oneOf(num(4), num(7))) }],\n};\nconst cuidSig: FuncCallSig = { positional: [{ key: 'version', type: num(2) }] };\nconst nanoidSig: FuncCallSig = {\n positional: [{ key: 'size', type: optional(int({ min: 2, max: 255 })) }],\n};\nconst dbgeneratedSig: FuncCallSig = { positional: [{ key: 'expression', type: str() }] };\n\nconst postgresDefaultFunctionRegistryEntries = [\n [\n 'autoincrement',\n {\n signature: autoincrementSig,\n lower: lowerAutoincrement,\n usageSignatures: ['autoincrement()'],\n },\n ],\n ['now', { signature: nowSig, lower: lowerNow, usageSignatures: ['now()'] }],\n [\n 'uuid',\n { signature: uuidSig, lower: lowerUuid, usageSignatures: ['uuid()', 'uuid(4)', 'uuid(7)'] },\n ],\n ['cuid', { signature: cuidSig, lower: lowerCuid, usageSignatures: ['cuid(2)'] }],\n ['ulid', { signature: ulidSig, lower: lowerUlid, usageSignatures: ['ulid()'] }],\n [\n 'nanoid',\n { signature: nanoidSig, lower: lowerNanoid, usageSignatures: ['nanoid()', 'nanoid(<2-255>)'] },\n ],\n [\n 'dbgenerated',\n { signature: dbgeneratedSig, lower: lowerDbgenerated, usageSignatures: ['dbgenerated(\"...\")'] },\n ],\n] satisfies ReadonlyArray<readonly [string, ControlMutationDefaultEntry]>;\n\n/**\n * The base PSL scalars as zero-arg type constructors in the unified authoring\n * channel, with explicit `nativeType` values pinned to the codec manifests\n * (`codecLookup.targetTypesFor(codecId)[0]`).\n *\n * The type position is the only storage decider: a mutation-default generator\n * (`@default(uuid())`) never re-picks a column's storage.\n */\nexport const postgresScalarAuthoringTypes = {\n String: {\n kind: 'typeConstructor',\n output: { codecId: 'pg/text@1', nativeType: 'text' },\n },\n Boolean: {\n kind: 'typeConstructor',\n output: { codecId: 'pg/bool@1', nativeType: 'bool' },\n },\n Int: {\n kind: 'typeConstructor',\n output: { codecId: 'pg/int4@1', nativeType: 'int4' },\n },\n BigInt: {\n kind: 'typeConstructor',\n output: { codecId: 'pg/int8@1', nativeType: 'int8' },\n },\n Float: {\n kind: 'typeConstructor',\n output: { codecId: 'pg/float8@1', nativeType: 'float8' },\n },\n Decimal: {\n kind: 'typeConstructor',\n output: { codecId: 'pg/numeric@1', nativeType: 'numeric' },\n },\n DateTime: {\n kind: 'typeConstructor',\n output: { codecId: 'pg/timestamptz@1', nativeType: 'timestamptz' },\n },\n Json: {\n kind: 'typeConstructor',\n output: { codecId: 'pg/json@1', nativeType: 'json' },\n },\n Jsonb: {\n kind: 'typeConstructor',\n output: { codecId: 'pg/jsonb@1', nativeType: 'jsonb' },\n },\n Bytes: {\n kind: 'typeConstructor',\n output: { codecId: 'pg/bytea@1', nativeType: 'bytea' },\n },\n} as const satisfies AuthoringTypeNamespace;\n\nexport const postgresNativeAuthoringTypes = {\n VarChar: {\n kind: 'typeConstructor',\n args: [{ kind: 'number', name: 'length', integer: true, minimum: 1, optional: true }],\n output: {\n codecId: 'sql/varchar@1',\n nativeType: 'character varying',\n typeParams: { length: { kind: 'arg', index: 0 } },\n },\n },\n Char: {\n kind: 'typeConstructor',\n args: [{ kind: 'number', name: 'length', integer: true, minimum: 1, optional: true }],\n output: {\n codecId: 'sql/char@1',\n nativeType: 'character',\n typeParams: { length: { kind: 'arg', index: 0 } },\n },\n },\n Numeric: {\n kind: 'typeConstructor',\n args: [\n { kind: 'number', name: 'precision', integer: true, minimum: 1, optional: true },\n { kind: 'number', name: 'scale', integer: true, minimum: 0, optional: true },\n ],\n output: {\n codecId: 'pg/numeric@1',\n nativeType: 'numeric',\n typeParams: {\n precision: { kind: 'arg', index: 0 },\n scale: { kind: 'arg', index: 1 },\n },\n },\n },\n Timestamp: {\n kind: 'typeConstructor',\n args: [{ kind: 'number', name: 'precision', integer: true, minimum: 0, optional: true }],\n output: {\n codecId: 'pg/timestamp@1',\n nativeType: 'timestamp',\n typeParams: { precision: { kind: 'arg', index: 0 } },\n },\n },\n Timestamptz: {\n kind: 'typeConstructor',\n args: [{ kind: 'number', name: 'precision', integer: true, minimum: 0, optional: true }],\n output: {\n codecId: 'pg/timestamptz@1',\n nativeType: 'timestamptz',\n typeParams: { precision: { kind: 'arg', index: 0 } },\n },\n },\n Time: {\n kind: 'typeConstructor',\n args: [{ kind: 'number', name: 'precision', integer: true, minimum: 0, optional: true }],\n output: {\n codecId: 'pg/time@1',\n nativeType: 'time',\n typeParams: { precision: { kind: 'arg', index: 0 } },\n },\n },\n Timetz: {\n kind: 'typeConstructor',\n args: [{ kind: 'number', name: 'precision', integer: true, minimum: 0, optional: true }],\n output: {\n codecId: 'pg/timetz@1',\n nativeType: 'timetz',\n typeParams: { precision: { kind: 'arg', index: 0 } },\n },\n },\n Uuid: { kind: 'typeConstructor', output: { codecId: 'pg/uuid@1', nativeType: 'uuid' } },\n Inet: { kind: 'typeConstructor', output: { codecId: 'pg/inet@1', nativeType: 'inet' } },\n SmallInt: { kind: 'typeConstructor', output: { codecId: 'pg/int2@1', nativeType: 'int2' } },\n Real: { kind: 'typeConstructor', output: { codecId: 'pg/float4@1', nativeType: 'float4' } },\n Date: { kind: 'typeConstructor', output: { codecId: 'pg/date@1', nativeType: 'date' } },\n} as const satisfies AuthoringTypeNamespace;\n\nexport const postgresAuthoringTypes = {\n ...postgresScalarAuthoringTypes,\n ...postgresNativeAuthoringTypes,\n} as const satisfies AuthoringTypeNamespace;\n\nexport function createPostgresDefaultFunctionRegistry(): ReadonlyMap<\n string,\n ControlMutationDefaultEntry\n> {\n return new Map(postgresDefaultFunctionRegistryEntries);\n}\n\nexport function createPostgresMutationDefaultGeneratorDescriptors(): readonly MutationDefaultGeneratorDescriptor[] {\n return [\n ...builtinGeneratorRegistryMetadata.map(\n ({ id, applicableCodecIds }): MutationDefaultGeneratorDescriptor => ({\n id,\n applicableCodecIds,\n }),\n ),\n timestampNowControlDescriptor(),\n ];\n}\n","import type { SqlControlAdapterDescriptor } from '@prisma-next/family-sql/control';\nimport type { SqlControlAdapter } from '@prisma-next/family-sql/control-adapter';\nimport {\n escapeLiteral,\n qualifyName,\n quoteIdentifier,\n} from '@prisma-next/target-postgres/sql-utils';\nimport { PostgresControlAdapter } from '../core/control-adapter';\nimport {\n createPostgresDefaultFunctionRegistry,\n createPostgresMutationDefaultGeneratorDescriptors,\n postgresAuthoringTypes,\n} from '../core/control-mutation-defaults';\nimport { postgresAdapterDescriptorMeta } from '../core/descriptor-meta';\n\nconst postgresAdapterDescriptor: SqlControlAdapterDescriptor<'postgres'> = {\n ...postgresAdapterDescriptorMeta,\n authoring: { type: postgresAuthoringTypes, valueObjectStorageType: 'Jsonb' },\n controlMutationDefaults: {\n defaultFunctionRegistry: createPostgresDefaultFunctionRegistry(),\n generatorDescriptors: createPostgresMutationDefaultGeneratorDescriptors(),\n },\n create(stack): SqlControlAdapter<'postgres'> {\n return new PostgresControlAdapter(stack.codecLookup);\n },\n};\n\nexport default postgresAdapterDescriptor;\n\nexport { parsePostgresDefault } from '@prisma-next/target-postgres/default-normalizer';\nexport { normalizeSchemaNativeType } from '@prisma-next/target-postgres/native-type-normalizer';\nexport { createPostgresBuiltinCodecLookup } from '../core/codec-lookup';\nexport { PostgresControlAdapter } from '../core/control-adapter';\nexport { escapeLiteral, qualifyName, quoteIdentifier };\n"],"mappings":";;;;;;;;;AAcA,SAAS,0BAA0B,OAIV;CACvB,OAAO;EACL,IAAI;EACJ,YAAY;GACV,MAAM;GACN,SAAS,MAAM;GACf,UAAU,MAAM,QAAQ;GACxB,MAAM,MAAM;EACd;CACF;AACF;AAEA,SAAS,mBACP,IACA,QACsB;CACtB,OAAO;EACL,IAAI;EACJ,OAAO;GACL,MAAM;GACN,WAAW;IACT,MAAM;IACN;IACA,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;GAC7B;EACF;CACF;AACF;AAEA,SAAS,qBAA2C;CAClD,OAAO;EACL,IAAI;EACJ,OAAO;GACL,MAAM;GACN,cAAc;IAAE,MAAM;IAAY,YAAY;GA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;EACA;CACF,EACF,GACA,8BAA8B,CAChC;AACF;;;AChSA,MAAM,4BAAqE;CACzE,GAAG;CACH,WAAW;EAAE,MAAM;EAAwB,wBAAwB;CAAQ;CAC3E,yBAAyB;EACvB,yBAAyB,sCAAsC;EAC/D,sBAAsB,kDAAkD;CAC1E;CACA,OAAO,OAAsC;EAC3C,OAAO,IAAI,uBAAuB,MAAM,WAAW;CACrD;AACF"}
|
package/package.json
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/adapter-postgres",
|
|
3
|
-
"version": "0.16.0-dev.
|
|
3
|
+
"version": "0.16.0-dev.29",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@prisma-next/contract": "0.16.0-dev.
|
|
9
|
-
"@prisma-next/contract-authoring": "0.16.0-dev.
|
|
10
|
-
"@prisma-next/errors": "0.16.0-dev.
|
|
11
|
-
"@prisma-next/family-sql": "0.16.0-dev.
|
|
12
|
-
"@prisma-next/framework-components": "0.16.0-dev.
|
|
13
|
-
"@prisma-next/ids": "0.16.0-dev.
|
|
14
|
-
"@prisma-next/psl-parser": "0.16.0-dev.
|
|
15
|
-
"@prisma-next/sql-contract": "0.16.0-dev.
|
|
16
|
-
"@prisma-next/sql-contract-psl": "0.16.0-dev.
|
|
17
|
-
"@prisma-next/sql-contract-ts": "0.16.0-dev.
|
|
18
|
-
"@prisma-next/sql-operations": "0.16.0-dev.
|
|
19
|
-
"@prisma-next/sql-relational-core": "0.16.0-dev.
|
|
20
|
-
"@prisma-next/sql-runtime": "0.16.0-dev.
|
|
21
|
-
"@prisma-next/sql-schema-ir": "0.16.0-dev.
|
|
22
|
-
"@prisma-next/target-postgres": "0.16.0-dev.
|
|
23
|
-
"@prisma-next/utils": "0.16.0-dev.
|
|
8
|
+
"@prisma-next/contract": "0.16.0-dev.29",
|
|
9
|
+
"@prisma-next/contract-authoring": "0.16.0-dev.29",
|
|
10
|
+
"@prisma-next/errors": "0.16.0-dev.29",
|
|
11
|
+
"@prisma-next/family-sql": "0.16.0-dev.29",
|
|
12
|
+
"@prisma-next/framework-components": "0.16.0-dev.29",
|
|
13
|
+
"@prisma-next/ids": "0.16.0-dev.29",
|
|
14
|
+
"@prisma-next/psl-parser": "0.16.0-dev.29",
|
|
15
|
+
"@prisma-next/sql-contract": "0.16.0-dev.29",
|
|
16
|
+
"@prisma-next/sql-contract-psl": "0.16.0-dev.29",
|
|
17
|
+
"@prisma-next/sql-contract-ts": "0.16.0-dev.29",
|
|
18
|
+
"@prisma-next/sql-operations": "0.16.0-dev.29",
|
|
19
|
+
"@prisma-next/sql-relational-core": "0.16.0-dev.29",
|
|
20
|
+
"@prisma-next/sql-runtime": "0.16.0-dev.29",
|
|
21
|
+
"@prisma-next/sql-schema-ir": "0.16.0-dev.29",
|
|
22
|
+
"@prisma-next/target-postgres": "0.16.0-dev.29",
|
|
23
|
+
"@prisma-next/utils": "0.16.0-dev.29",
|
|
24
24
|
"arktype": "^2.2.2"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@prisma-next/cli": "0.16.0-dev.
|
|
28
|
-
"@prisma-next/driver-postgres": "0.16.0-dev.
|
|
29
|
-
"@prisma-next/migration-tools": "0.16.0-dev.
|
|
30
|
-
"@prisma-next/test-utils": "0.16.0-dev.
|
|
31
|
-
"@prisma-next/tsconfig": "0.16.0-dev.
|
|
32
|
-
"@prisma-next/tsdown": "0.16.0-dev.
|
|
27
|
+
"@prisma-next/cli": "0.16.0-dev.29",
|
|
28
|
+
"@prisma-next/driver-postgres": "0.16.0-dev.29",
|
|
29
|
+
"@prisma-next/migration-tools": "0.16.0-dev.29",
|
|
30
|
+
"@prisma-next/test-utils": "0.16.0-dev.29",
|
|
31
|
+
"@prisma-next/tsconfig": "0.16.0-dev.29",
|
|
32
|
+
"@prisma-next/tsdown": "0.16.0-dev.29",
|
|
33
33
|
"pathe": "^2.0.3",
|
|
34
34
|
"tsdown": "0.22.8",
|
|
35
35
|
"typescript": "5.9.3",
|
|
@@ -202,13 +202,6 @@ export const postgresScalarAuthoringTypes = {
|
|
|
202
202
|
},
|
|
203
203
|
} as const satisfies AuthoringTypeNamespace;
|
|
204
204
|
|
|
205
|
-
/**
|
|
206
|
-
* The former `@db.*` native types as first-class top-level type constructors
|
|
207
|
-
* (TML-2986). Codec ids, native types, and typeParams key shapes mirror the
|
|
208
|
-
* legacy `@db.*` attribute path (`NATIVE_TYPE_SPECS` in sql-contract-psl)
|
|
209
|
-
* exactly; every argument is optional, so each name is also authorable bare
|
|
210
|
-
* (`VarChar` ≡ `VarChar()`), and omitted arguments omit their typeParams keys.
|
|
211
|
-
*/
|
|
212
205
|
export const postgresNativeAuthoringTypes = {
|
|
213
206
|
VarChar: {
|
|
214
207
|
kind: 'typeConstructor',
|
|
@@ -280,6 +273,7 @@ export const postgresNativeAuthoringTypes = {
|
|
|
280
273
|
},
|
|
281
274
|
},
|
|
282
275
|
Uuid: { kind: 'typeConstructor', output: { codecId: 'pg/uuid@1', nativeType: 'uuid' } },
|
|
276
|
+
Inet: { kind: 'typeConstructor', output: { codecId: 'pg/inet@1', nativeType: 'inet' } },
|
|
283
277
|
SmallInt: { kind: 'typeConstructor', output: { codecId: 'pg/int2@1', nativeType: 'int2' } },
|
|
284
278
|
Real: { kind: 'typeConstructor', output: { codecId: 'pg/float4@1', nativeType: 'float4' } },
|
|
285
279
|
Date: { kind: 'typeConstructor', output: { codecId: 'pg/date@1', nativeType: 'date' } },
|