@prisma/orm-postgres 8.0.0-rc.12-dev.16 → 8.0.0-rc.12-dev.17
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.
|
@@ -5,16 +5,17 @@ import { PostgresNativeEnum, postgresCreateNamespace } from "@prisma/orm-target-
|
|
|
5
5
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
6
6
|
import { autoincrement, bindEnumType, buildBoundContract, buildSqlContractFromDefinition, check, field, member, model, now, rel, sql } from "@prisma/orm-family-sql/contract-ts/contract-builder";
|
|
7
7
|
import sqlFamilyPack from "@prisma/orm-family-sql/family/pack";
|
|
8
|
+
import { assemblePostgresCodecRegistryWithBuiltins, pgEnumDescriptor } from "@prisma/orm-target-postgres/target/codecs";
|
|
8
9
|
import { DEFAULT_FULL_TEXT_SEARCH_LANGUAGE, isFullTextIndexableCodec, renderFullTextIndexExpression } from "@prisma/orm-target-postgres/target/sql-utils";
|
|
9
10
|
import { invariant } from "@prisma/orm-framework/utils/assertions";
|
|
10
|
-
import { pgEnumDescriptor } from "@prisma/orm-target-postgres/target/codecs";
|
|
11
11
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
12
12
|
import { POLICY_OPERATION_PREDICATES } from "@prisma/orm-target-postgres/target/rls-canonicalize";
|
|
13
13
|
//#region ../../../3-extensions/postgres/dist/contract-builder.mjs
|
|
14
14
|
function defineContract(definition, factory) {
|
|
15
15
|
const bound = {
|
|
16
16
|
...definition,
|
|
17
|
-
createNamespace: postgresCreateNamespace
|
|
17
|
+
createNamespace: postgresCreateNamespace,
|
|
18
|
+
codecLookup: definition.codecLookup ?? assemblePostgresCodecRegistryWithBuiltins(Object.values(definition.extensions ?? {}))
|
|
18
19
|
};
|
|
19
20
|
if (factory !== void 0) return buildBoundContract(sqlFamilyPack, postgresPackRef, bound, factory);
|
|
20
21
|
return buildBoundContract(sqlFamilyPack, postgresPackRef, bound);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-builder.mjs","names":[],"sources":["../../../../3-extensions/postgres/dist/contract-builder.mjs"],"sourcesContent":["import { t as postgresError } from \"./errors-DfWK9xep.mjs\";\nimport { PG_ENUM_CODEC_ID } from \"@internal/target-postgres/codec-ids\";\nimport postgresPackRef from \"@internal/target-postgres/pack\";\nimport { PostgresNativeEnum, postgresCreateNamespace } from \"@internal/target-postgres/types\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { autoincrement, bindEnumType, buildBoundContract, buildSqlContractFromDefinition, check, field, member, model, now, rel, sql } from \"@internal/sql-contract-ts/contract-builder\";\nimport sqlFamilyPack from \"@internal/family-sql/pack\";\nimport { DEFAULT_FULL_TEXT_SEARCH_LANGUAGE, isFullTextIndexableCodec, renderFullTextIndexExpression } from \"@internal/target-postgres/sql-utils\";\nimport { invariant } from \"@internal/utils/assertions\";\nimport { pgEnumDescriptor } from \"@internal/target-postgres/codecs\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { POLICY_OPERATION_PREDICATES } from \"@internal/target-postgres/rls-canonicalize\";\n//#region src/contract/define-contract.ts\nfunction defineContract(definition, factory) {\n\tconst bound = {\n\t\t...definition,\n\t\tcreateNamespace: postgresCreateNamespace\n\t};\n\tif (factory !== void 0) return buildBoundContract(sqlFamilyPack, postgresPackRef, bound, factory);\n\treturn buildBoundContract(sqlFamilyPack, postgresPackRef, bound);\n}\n//#endregion\n//#region src/contract/enum-type.ts\n/**\n* The `enumType` authors call when building a Postgres contract (re-exported\n* from `@internal/postgres/contract-builder`).\n*\n* `bindEnumType` is the core, codec-agnostic `enumType` factory; calling it with\n* the Postgres pack's codec typemap fixes which member-value type each codec\n* permits, so `member()` values are checked against the column's codec at\n* authoring time: `pg/text@1` requires `string`, `pg/int4@1` requires `number`,\n* and a mismatch is a compile error. The core `enumType` can't know the codec\n* set, which is why the binding happens here, per target.\n*/\nconst enumType = bindEnumType();\n//#endregion\n//#region src/contract/full-text-index.ts\nfunction fullTextIndex(column, options) {\n\tconst language = options.language ?? DEFAULT_FULL_TEXT_SEARCH_LANGUAGE;\n\treturn {\n\t\tkind: \"index\",\n\t\texpression: {\n\t\t\tfields: [column],\n\t\t\trender: (columns) => {\n\t\t\t\tconst resolved = columns[0];\n\t\t\t\tinvariant(resolved !== void 0, `fullTextIndex resolved no column for field \"${column.fieldName}\"`);\n\t\t\t\tif (!isFullTextIndexableCodec(resolved.codecId)) throw postgresError(\"CONTRACT.INDEX_INVALID\", `fullTextIndex indexes a text column, but \"${column.fieldName}\" is stored as \\`${resolved.codecId}\\`.`, {\n\t\t\t\t\twhy: \"to_tsvector takes text; Postgres rejects the CREATE INDEX for any other column type.\",\n\t\t\t\t\tfix: \"Index a text, varchar or char column, or drop the index.\",\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\thelper: \"fullTextIndex\",\n\t\t\t\t\t\tfieldName: column.fieldName,\n\t\t\t\t\t\tcodecId: resolved.codecId\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn renderFullTextIndexExpression(language, resolved.name);\n\t\t\t}\n\t\t},\n\t\ttype: \"gin\",\n\t\t...options.where !== void 0 ? { where: options.where } : {},\n\t\t...options.name !== void 0 ? { name: options.name } : {},\n\t\t...options.map !== void 0 ? { map: options.map } : {}\n\t};\n}\n//#endregion\n//#region src/contract/native-enum.ts\nfunction buildNativeEnumHandle(name, typeName, members) {\n\tif (typeName.trim().length === 0) throw postgresError(\"CONTRACT.ENUM_INVALID\", `nativeEnum(\"${name}\"): the Postgres type name must be a non-empty string.`, {\n\t\tfix: \"Pass a non-empty Postgres type name to .map(typeName).\",\n\t\tmeta: {\n\t\t\tenumName: name,\n\t\t\treason: \"empty type name\"\n\t\t}\n\t});\n\treturn {\n\t\tentityKind: \"native_enum\",\n\t\tname,\n\t\ttypeName,\n\t\tmembers,\n\t\tentity: new PostgresNativeEnum({\n\t\t\ttypeName,\n\t\t\tmembers\n\t\t}),\n\t\tmap: (mappedTypeName) => buildNativeEnumHandle(name, mappedTypeName, members)\n\t};\n}\n/**\n* Declares a native Postgres enum type for use with {@link pg}'s `.enum()`\n* column helper. Mirrors PSL's `native_enum <Name> { … }` lowering\n* (`lowerNativeEnumFromBlock`): validates a non-empty, duplicate-free member\n* list and builds the same {@link PostgresNativeEnum} entity. Its value-set is\n* derived generically at contract-build time — the same\n* `deriveValueSetFromEntity` fold PSL's native enums go through — once\n* `pg.enum(handle)` lands the entity in the field's owning namespace.\n*\n* The first argument is the entity `name` (the `entries.native_enum` /\n* `entries.valueSet` key). The Postgres type name defaults to `name`; use\n* `.map(typeName)` to override it (PSL's `@@map`).\n*\n* A handle referenced by columns in N different namespaces materialises N\n* native enum types (one per namespace) — by design: a Postgres type lives in\n* exactly one schema, and PSL can't share a type across schemas either.\n*\n* @example\n* ```ts\n* // name === Postgres type name\n* const Role = nativeEnum('Role', 'user', 'admin');\n* // entity name `AalLevel`, Postgres type `aal_level` (Supabase's auth.aal_level)\n* const AalLevel = nativeEnum('AalLevel', 'aal1', 'aal2', 'aal3').map('aal_level');\n* model('Session', { fields: { aal: field.column(pg.enum(AalLevel)).optional() } });\n* ```\n*/\nfunction nativeEnum(name, ...members) {\n\tif (name.trim().length === 0) throw postgresError(\"CONTRACT.ENUM_INVALID\", \"nativeEnum(): name must be a non-empty string.\", {\n\t\tfix: \"Pass a non-empty entity name as the first argument to nativeEnum().\",\n\t\tmeta: {\n\t\t\tenumName: name,\n\t\t\treason: \"empty name\"\n\t\t}\n\t});\n\tif (members.length === 0) throw postgresError(\"CONTRACT.ENUM_INVALID\", `nativeEnum(\"${name}\"): must have at least one member.`, {\n\t\twhy: \"Postgres rejects CREATE TYPE ... AS ENUM () with no labels.\",\n\t\tfix: \"Declare at least one member value after the name.\",\n\t\tmeta: {\n\t\t\tenumName: name,\n\t\t\treason: \"zero members\"\n\t\t}\n\t});\n\tconst seenValues = /* @__PURE__ */ new Set();\n\tfor (const value of members) {\n\t\tif (seenValues.has(value)) throw postgresError(\"CONTRACT.ENUM_INVALID\", `nativeEnum(\"${name}\"): duplicate member value \"${value}\". Member values must be unique.`, {\n\t\t\tfix: \"Remove the duplicate member value.\",\n\t\t\tmeta: {\n\t\t\t\tenumName: name,\n\t\t\t\tmember: value,\n\t\t\t\treason: \"duplicate member value\"\n\t\t\t}\n\t\t});\n\t\tseenValues.add(value);\n\t}\n\treturn buildNativeEnumHandle(name, name, members);\n}\n/**\n* Builds the deferred column descriptor for `handle`: the bare Postgres type\n* name and `typeParams` come from `pgEnumDescriptor.columnFromEntity` (the same\n* authoring hook the PSL `pg.enum(Ref)` type constructor resolves through),\n* carrying `handle.entity` as the descriptor's `entityRef` keyed by the entity\n* `name` (not the Postgres type name — they differ when `.map()` was used).\n* Schema qualification and the storage `valueSet` ref are NOT computed here — a\n* `field.column(pg.enum(handle))` call runs before the enclosing `model(...)`\n* associates a namespace, so `buildSqlContractFromDefinition` resolves both\n* once the field's namespace is known.\n*/\nfunction pgEnumColumn(handle) {\n\tconst resolved = pgEnumDescriptor.columnFromEntity(handle.entity);\n\tif (resolved === void 0) throw new InternalError(`pg.enum(\"${handle.name}\"): handle.entity is not a PostgresNativeEnum. This is an authoring-surface bug — nativeEnum() must always produce one.`);\n\treturn {\n\t\tcodecId: PG_ENUM_CODEC_ID,\n\t\tnativeType: resolved.nativeType,\n\t\ttypeParams: resolved.typeParams,\n\t\tentityRef: {\n\t\t\tentityKind: handle.entityKind,\n\t\t\tentityName: handle.name,\n\t\t\tentity: handle.entity\n\t\t}\n\t};\n}\n/** Postgres-specific TS type-constructor namespace, mirroring the PSL `pg.` prefix. */\nconst pg = { enum: pgEnumColumn };\n//#endregion\n//#region src/contract/rls.ts\nfunction assertNonEmptyName(helper, name) {\n\tif (name.trim().length === 0) throw postgresError(\"CONTRACT.POLICY_INVALID\", `${helper}: name must be a non-empty string.`, {\n\t\tfix: \"Pass a non-empty policy name.\",\n\t\tmeta: {\n\t\t\tpolicyName: name,\n\t\t\treason: \"empty name\"\n\t\t}\n\t});\n}\n/** The user-facing helper name per operation, for runtime error messages. */\nconst HELPER_NAMES = {\n\tselect: \"policySelect\",\n\tinsert: \"policyInsert\",\n\tupdate: \"policyUpdate\",\n\tdelete: \"policyDelete\",\n\tall: \"policyAll\"\n};\nfunction buildPolicyHandle(operation, model, descriptor) {\n\tconst helper = HELPER_NAMES[operation];\n\tconst support = POLICY_OPERATION_PREDICATES[operation];\n\tassertNonEmptyName(`${helper}(\"${descriptor.name}\")`, descriptor.name);\n\tconst supported = support.using && support.withCheck ? \"`using` and `withCheck`\" : support.using ? \"`using` only\" : \"`withCheck` only\";\n\tconst rejectPredicate = (predicate) => {\n\t\tthrow postgresError(\"CONTRACT.POLICY_INVALID\", `${helper}: policy \"${descriptor.name}\" does not take a \\`${predicate}\\` predicate; the ${operation.toUpperCase()} operation uses ${supported}.`, {\n\t\t\tfix: `Use only the predicates the ${operation.toUpperCase()} operation supports: ${supported}.`,\n\t\t\tmeta: {\n\t\t\t\tpolicyName: descriptor.name,\n\t\t\t\treason: `unsupported \\`${predicate}\\` predicate`\n\t\t\t}\n\t\t});\n\t};\n\tif (descriptor.using !== void 0 && !support.using) rejectPredicate(\"using\");\n\tif (descriptor.withCheck !== void 0 && !support.withCheck) rejectPredicate(\"withCheck\");\n\tif (descriptor.using === void 0 && descriptor.withCheck === void 0) throw postgresError(\"CONTRACT.POLICY_INVALID\", `${helper}: policy \"${descriptor.name}\" requires at least one predicate; the ${operation.toUpperCase()} operation uses ${supported}.`, {\n\t\tfix: `Provide at least one predicate: ${supported}.`,\n\t\tmeta: {\n\t\t\tpolicyName: descriptor.name,\n\t\t\treason: \"no predicate given\"\n\t\t}\n\t});\n\treturn Object.freeze({\n\t\tentityKind: \"policy\",\n\t\toperation,\n\t\tname: descriptor.name,\n\t\trefs: Object.freeze({ target: model }),\n\t\troles: Object.freeze([...descriptor.roles]),\n\t\t...ifDefined(\"using\", descriptor.using),\n\t\t...ifDefined(\"withCheck\", descriptor.withCheck)\n\t});\n}\n/**\n* Declares a Postgres role by name, mirroring PSL's bare role identifiers.\n* Returns an inert handle: referenced in a policy's `roles` it contributes\n* the bare name; placed in the `entities` list it declares the role\n* (`entries.role`), making it subject to the existence verify.\n*/\nfunction role(name) {\n\tassertNonEmptyName(`role(\"${name}\")`, name);\n\treturn Object.freeze({\n\t\tentityKind: \"role\",\n\t\tname\n\t});\n}\n/**\n* Marks a model's table RLS-controlled, mirroring PSL's `@@rls`. The\n* enablement marker (never the policy set) drives `ENABLE`/`DISABLE ROW\n* LEVEL SECURITY` planning.\n*/\nfunction rlsEnabled(model) {\n\treturn Object.freeze({\n\t\tentityKind: \"rls\",\n\t\trefs: Object.freeze({ target: model })\n\t});\n}\n/** Authors a `FOR SELECT` policy (PSL `policy_select`): row visibility via `using`. */\nfunction policySelect(model, descriptor) {\n\treturn buildPolicyHandle(\"select\", model, descriptor);\n}\n/** Authors a `FOR INSERT` policy (PSL `policy_insert`): new-row validation via `withCheck`. */\nfunction policyInsert(model, descriptor) {\n\treturn buildPolicyHandle(\"insert\", model, descriptor);\n}\n/** Authors a `FOR UPDATE` policy (PSL `policy_update`): takes `using` and `withCheck`. */\nfunction policyUpdate(model, descriptor) {\n\treturn buildPolicyHandle(\"update\", model, descriptor);\n}\n/** Authors a `FOR DELETE` policy (PSL `policy_delete`): row eligibility via `using`. */\nfunction policyDelete(model, descriptor) {\n\treturn buildPolicyHandle(\"delete\", model, descriptor);\n}\n/** Authors a `FOR ALL` policy (PSL `policy_all`): takes `using` and `withCheck`. */\nfunction policyAll(model, descriptor) {\n\treturn buildPolicyHandle(\"all\", model, descriptor);\n}\n//#endregion\nexport { autoincrement, buildSqlContractFromDefinition, check, defineContract, enumType, field, fullTextIndex, member, model, nativeEnum, now, pg, policyAll, policyDelete, policyInsert, policySelect, policyUpdate, rel, rlsEnabled, role, sql };\n\n//# sourceMappingURL=contract-builder.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,SAAS,eAAe,YAAY,SAAS;CAC5C,MAAM,QAAQ;EACb,GAAG;E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AAK,KAAK,IAAI;CAC1C,OAAO,OAAO,OAAO;EACpB,YAAY;EACZ;CACD,CAAC;AACF;;;;;;AAMA,SAAS,WAAW,OAAO;CAC1B,OAAO,OAAO,OAAO;EACpB,YAAY;EACZ,MAAM,OAAO,OAAO,EAAE,QAAQ,MAAM,CAAC;CACtC,CAAC;AACF;;AAEA,SAAS,aAAa,OAAO,YAAY;CACxC,OAAO,kBAAkB,UAAU,OAAO,UAAU;AACrD;;AAEA,SAAS,aAAa,OAAO,YAAY;CACxC,OAAO,kBAAkB,UAAU,OAAO,UAAU;AACrD;;AAEA,SAAS,aAAa,OAAO,YAAY;CACxC,OAAO,kBAAkB,UAAU,OAAO,UAAU;AACrD;;AAEA,SAAS,aAAa,OAAO,YAAY;CACxC,OAAO,kBAAkB,UAAU,OAAO,UAAU;AACrD;;AAEA,SAAS,UAAU,OAAO,YAAY;CACrC,OAAO,kBAAkB,OAAO,OAAO,UAAU;AAClD"}
|
|
1
|
+
{"version":3,"file":"contract-builder.mjs","names":[],"sources":["../../../../3-extensions/postgres/dist/contract-builder.mjs"],"sourcesContent":["import { t as postgresError } from \"./errors-DfWK9xep.mjs\";\nimport { PG_ENUM_CODEC_ID } from \"@internal/target-postgres/codec-ids\";\nimport postgresPackRef from \"@internal/target-postgres/pack\";\nimport { PostgresNativeEnum, postgresCreateNamespace } from \"@internal/target-postgres/types\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { autoincrement, bindEnumType, buildBoundContract, buildSqlContractFromDefinition, check, field, member, model, now, rel, sql } from \"@internal/sql-contract-ts/contract-builder\";\nimport sqlFamilyPack from \"@internal/family-sql/pack\";\nimport { assemblePostgresCodecRegistryWithBuiltins, pgEnumDescriptor } from \"@internal/target-postgres/codecs\";\nimport { DEFAULT_FULL_TEXT_SEARCH_LANGUAGE, isFullTextIndexableCodec, renderFullTextIndexExpression } from \"@internal/target-postgres/sql-utils\";\nimport { invariant } from \"@internal/utils/assertions\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { POLICY_OPERATION_PREDICATES } from \"@internal/target-postgres/rls-canonicalize\";\n//#region src/contract/define-contract.ts\nfunction defineContract(definition, factory) {\n\tconst bound = {\n\t\t...definition,\n\t\tcreateNamespace: postgresCreateNamespace,\n\t\tcodecLookup: definition.codecLookup ?? assemblePostgresCodecRegistryWithBuiltins(Object.values(definition.extensions ?? {}))\n\t};\n\tif (factory !== void 0) return buildBoundContract(sqlFamilyPack, postgresPackRef, bound, factory);\n\treturn buildBoundContract(sqlFamilyPack, postgresPackRef, bound);\n}\n//#endregion\n//#region src/contract/enum-type.ts\n/**\n* The `enumType` authors call when building a Postgres contract (re-exported\n* from `@internal/postgres/contract-builder`).\n*\n* `bindEnumType` is the core, codec-agnostic `enumType` factory; calling it with\n* the Postgres pack's codec typemap fixes which member-value type each codec\n* permits, so `member()` values are checked against the column's codec at\n* authoring time: `pg/text@1` requires `string`, `pg/int4@1` requires `number`,\n* and a mismatch is a compile error. The core `enumType` can't know the codec\n* set, which is why the binding happens here, per target.\n*/\nconst enumType = bindEnumType();\n//#endregion\n//#region src/contract/full-text-index.ts\nfunction fullTextIndex(column, options) {\n\tconst language = options.language ?? DEFAULT_FULL_TEXT_SEARCH_LANGUAGE;\n\treturn {\n\t\tkind: \"index\",\n\t\texpression: {\n\t\t\tfields: [column],\n\t\t\trender: (columns) => {\n\t\t\t\tconst resolved = columns[0];\n\t\t\t\tinvariant(resolved !== void 0, `fullTextIndex resolved no column for field \"${column.fieldName}\"`);\n\t\t\t\tif (!isFullTextIndexableCodec(resolved.codecId)) throw postgresError(\"CONTRACT.INDEX_INVALID\", `fullTextIndex indexes a text column, but \"${column.fieldName}\" is stored as \\`${resolved.codecId}\\`.`, {\n\t\t\t\t\twhy: \"to_tsvector takes text; Postgres rejects the CREATE INDEX for any other column type.\",\n\t\t\t\t\tfix: \"Index a text, varchar or char column, or drop the index.\",\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\thelper: \"fullTextIndex\",\n\t\t\t\t\t\tfieldName: column.fieldName,\n\t\t\t\t\t\tcodecId: resolved.codecId\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn renderFullTextIndexExpression(language, resolved.name);\n\t\t\t}\n\t\t},\n\t\ttype: \"gin\",\n\t\t...options.where !== void 0 ? { where: options.where } : {},\n\t\t...options.name !== void 0 ? { name: options.name } : {},\n\t\t...options.map !== void 0 ? { map: options.map } : {}\n\t};\n}\n//#endregion\n//#region src/contract/native-enum.ts\nfunction buildNativeEnumHandle(name, typeName, members) {\n\tif (typeName.trim().length === 0) throw postgresError(\"CONTRACT.ENUM_INVALID\", `nativeEnum(\"${name}\"): the Postgres type name must be a non-empty string.`, {\n\t\tfix: \"Pass a non-empty Postgres type name to .map(typeName).\",\n\t\tmeta: {\n\t\t\tenumName: name,\n\t\t\treason: \"empty type name\"\n\t\t}\n\t});\n\treturn {\n\t\tentityKind: \"native_enum\",\n\t\tname,\n\t\ttypeName,\n\t\tmembers,\n\t\tentity: new PostgresNativeEnum({\n\t\t\ttypeName,\n\t\t\tmembers\n\t\t}),\n\t\tmap: (mappedTypeName) => buildNativeEnumHandle(name, mappedTypeName, members)\n\t};\n}\n/**\n* Declares a native Postgres enum type for use with {@link pg}'s `.enum()`\n* column helper. Mirrors PSL's `native_enum <Name> { … }` lowering\n* (`lowerNativeEnumFromBlock`): validates a non-empty, duplicate-free member\n* list and builds the same {@link PostgresNativeEnum} entity. Its value-set is\n* derived generically at contract-build time — the same\n* `deriveValueSetFromEntity` fold PSL's native enums go through — once\n* `pg.enum(handle)` lands the entity in the field's owning namespace.\n*\n* The first argument is the entity `name` (the `entries.native_enum` /\n* `entries.valueSet` key). The Postgres type name defaults to `name`; use\n* `.map(typeName)` to override it (PSL's `@@map`).\n*\n* A handle referenced by columns in N different namespaces materialises N\n* native enum types (one per namespace) — by design: a Postgres type lives in\n* exactly one schema, and PSL can't share a type across schemas either.\n*\n* @example\n* ```ts\n* // name === Postgres type name\n* const Role = nativeEnum('Role', 'user', 'admin');\n* // entity name `AalLevel`, Postgres type `aal_level` (Supabase's auth.aal_level)\n* const AalLevel = nativeEnum('AalLevel', 'aal1', 'aal2', 'aal3').map('aal_level');\n* model('Session', { fields: { aal: field.column(pg.enum(AalLevel)).optional() } });\n* ```\n*/\nfunction nativeEnum(name, ...members) {\n\tif (name.trim().length === 0) throw postgresError(\"CONTRACT.ENUM_INVALID\", \"nativeEnum(): name must be a non-empty string.\", {\n\t\tfix: \"Pass a non-empty entity name as the first argument to nativeEnum().\",\n\t\tmeta: {\n\t\t\tenumName: name,\n\t\t\treason: \"empty name\"\n\t\t}\n\t});\n\tif (members.length === 0) throw postgresError(\"CONTRACT.ENUM_INVALID\", `nativeEnum(\"${name}\"): must have at least one member.`, {\n\t\twhy: \"Postgres rejects CREATE TYPE ... AS ENUM () with no labels.\",\n\t\tfix: \"Declare at least one member value after the name.\",\n\t\tmeta: {\n\t\t\tenumName: name,\n\t\t\treason: \"zero members\"\n\t\t}\n\t});\n\tconst seenValues = /* @__PURE__ */ new Set();\n\tfor (const value of members) {\n\t\tif (seenValues.has(value)) throw postgresError(\"CONTRACT.ENUM_INVALID\", `nativeEnum(\"${name}\"): duplicate member value \"${value}\". Member values must be unique.`, {\n\t\t\tfix: \"Remove the duplicate member value.\",\n\t\t\tmeta: {\n\t\t\t\tenumName: name,\n\t\t\t\tmember: value,\n\t\t\t\treason: \"duplicate member value\"\n\t\t\t}\n\t\t});\n\t\tseenValues.add(value);\n\t}\n\treturn buildNativeEnumHandle(name, name, members);\n}\n/**\n* Builds the deferred column descriptor for `handle`: the bare Postgres type\n* name and `typeParams` come from `pgEnumDescriptor.columnFromEntity` (the same\n* authoring hook the PSL `pg.enum(Ref)` type constructor resolves through),\n* carrying `handle.entity` as the descriptor's `entityRef` keyed by the entity\n* `name` (not the Postgres type name — they differ when `.map()` was used).\n* Schema qualification and the storage `valueSet` ref are NOT computed here — a\n* `field.column(pg.enum(handle))` call runs before the enclosing `model(...)`\n* associates a namespace, so `buildSqlContractFromDefinition` resolves both\n* once the field's namespace is known.\n*/\nfunction pgEnumColumn(handle) {\n\tconst resolved = pgEnumDescriptor.columnFromEntity(handle.entity);\n\tif (resolved === void 0) throw new InternalError(`pg.enum(\"${handle.name}\"): handle.entity is not a PostgresNativeEnum. This is an authoring-surface bug — nativeEnum() must always produce one.`);\n\treturn {\n\t\tcodecId: PG_ENUM_CODEC_ID,\n\t\tnativeType: resolved.nativeType,\n\t\ttypeParams: resolved.typeParams,\n\t\tentityRef: {\n\t\t\tentityKind: handle.entityKind,\n\t\t\tentityName: handle.name,\n\t\t\tentity: handle.entity\n\t\t}\n\t};\n}\n/** Postgres-specific TS type-constructor namespace, mirroring the PSL `pg.` prefix. */\nconst pg = { enum: pgEnumColumn };\n//#endregion\n//#region src/contract/rls.ts\nfunction assertNonEmptyName(helper, name) {\n\tif (name.trim().length === 0) throw postgresError(\"CONTRACT.POLICY_INVALID\", `${helper}: name must be a non-empty string.`, {\n\t\tfix: \"Pass a non-empty policy name.\",\n\t\tmeta: {\n\t\t\tpolicyName: name,\n\t\t\treason: \"empty name\"\n\t\t}\n\t});\n}\n/** The user-facing helper name per operation, for runtime error messages. */\nconst HELPER_NAMES = {\n\tselect: \"policySelect\",\n\tinsert: \"policyInsert\",\n\tupdate: \"policyUpdate\",\n\tdelete: \"policyDelete\",\n\tall: \"policyAll\"\n};\nfunction buildPolicyHandle(operation, model, descriptor) {\n\tconst helper = HELPER_NAMES[operation];\n\tconst support = POLICY_OPERATION_PREDICATES[operation];\n\tassertNonEmptyName(`${helper}(\"${descriptor.name}\")`, descriptor.name);\n\tconst supported = support.using && support.withCheck ? \"`using` and `withCheck`\" : support.using ? \"`using` only\" : \"`withCheck` only\";\n\tconst rejectPredicate = (predicate) => {\n\t\tthrow postgresError(\"CONTRACT.POLICY_INVALID\", `${helper}: policy \"${descriptor.name}\" does not take a \\`${predicate}\\` predicate; the ${operation.toUpperCase()} operation uses ${supported}.`, {\n\t\t\tfix: `Use only the predicates the ${operation.toUpperCase()} operation supports: ${supported}.`,\n\t\t\tmeta: {\n\t\t\t\tpolicyName: descriptor.name,\n\t\t\t\treason: `unsupported \\`${predicate}\\` predicate`\n\t\t\t}\n\t\t});\n\t};\n\tif (descriptor.using !== void 0 && !support.using) rejectPredicate(\"using\");\n\tif (descriptor.withCheck !== void 0 && !support.withCheck) rejectPredicate(\"withCheck\");\n\tif (descriptor.using === void 0 && descriptor.withCheck === void 0) throw postgresError(\"CONTRACT.POLICY_INVALID\", `${helper}: policy \"${descriptor.name}\" requires at least one predicate; the ${operation.toUpperCase()} operation uses ${supported}.`, {\n\t\tfix: `Provide at least one predicate: ${supported}.`,\n\t\tmeta: {\n\t\t\tpolicyName: descriptor.name,\n\t\t\treason: \"no predicate given\"\n\t\t}\n\t});\n\treturn Object.freeze({\n\t\tentityKind: \"policy\",\n\t\toperation,\n\t\tname: descriptor.name,\n\t\trefs: Object.freeze({ target: model }),\n\t\troles: Object.freeze([...descriptor.roles]),\n\t\t...ifDefined(\"using\", descriptor.using),\n\t\t...ifDefined(\"withCheck\", descriptor.withCheck)\n\t});\n}\n/**\n* Declares a Postgres role by name, mirroring PSL's bare role identifiers.\n* Returns an inert handle: referenced in a policy's `roles` it contributes\n* the bare name; placed in the `entities` list it declares the role\n* (`entries.role`), making it subject to the existence verify.\n*/\nfunction role(name) {\n\tassertNonEmptyName(`role(\"${name}\")`, name);\n\treturn Object.freeze({\n\t\tentityKind: \"role\",\n\t\tname\n\t});\n}\n/**\n* Marks a model's table RLS-controlled, mirroring PSL's `@@rls`. The\n* enablement marker (never the policy set) drives `ENABLE`/`DISABLE ROW\n* LEVEL SECURITY` planning.\n*/\nfunction rlsEnabled(model) {\n\treturn Object.freeze({\n\t\tentityKind: \"rls\",\n\t\trefs: Object.freeze({ target: model })\n\t});\n}\n/** Authors a `FOR SELECT` policy (PSL `policy_select`): row visibility via `using`. */\nfunction policySelect(model, descriptor) {\n\treturn buildPolicyHandle(\"select\", model, descriptor);\n}\n/** Authors a `FOR INSERT` policy (PSL `policy_insert`): new-row validation via `withCheck`. */\nfunction policyInsert(model, descriptor) {\n\treturn buildPolicyHandle(\"insert\", model, descriptor);\n}\n/** Authors a `FOR UPDATE` policy (PSL `policy_update`): takes `using` and `withCheck`. */\nfunction policyUpdate(model, descriptor) {\n\treturn buildPolicyHandle(\"update\", model, descriptor);\n}\n/** Authors a `FOR DELETE` policy (PSL `policy_delete`): row eligibility via `using`. */\nfunction policyDelete(model, descriptor) {\n\treturn buildPolicyHandle(\"delete\", model, descriptor);\n}\n/** Authors a `FOR ALL` policy (PSL `policy_all`): takes `using` and `withCheck`. */\nfunction policyAll(model, descriptor) {\n\treturn buildPolicyHandle(\"all\", model, descriptor);\n}\n//#endregion\nexport { autoincrement, buildSqlContractFromDefinition, check, defineContract, enumType, field, fullTextIndex, member, model, nativeEnum, now, pg, policyAll, policyDelete, policyInsert, policySelect, policyUpdate, rel, rlsEnabled, role, sql };\n\n//# sourceMappingURL=contract-builder.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,SAAS,eAAe,YAAY,SAAS;CAC5C,MAAM,QAAQ;EACb,GAAG;EACH,iBAAiB;EACjB,aAAa,WAAW,eAAe,0CAA0C,OAAO,OAAO,WAAW,cAAc,CAAC,CAAC,CAAC;CAC5H;CACA,IAAI,YAAY,KAAK,GAAG,OAAO,mBAAmB,eAAe,iBAAiB,OAAO,OAAO;CAChG,OAAO,mBAAmB,eAAe,iBAAiB,KAAK;AAChE;;;;;;;;;;;;AAcA,MAAM,WAAW,aAAa;AAG9B,SAAS,cAAc,QAAQ,SAAS;CACvC,MAAM,WAAW,QAAQ,YAAY;CACrC,OAAO;EACN,MAAM;EACN,YAAY;GACX,QAAQ,CAAC,MAAM;GACf,SAAS,YAAY;IACpB,MAAM,WAAW,QAAQ;IACzB,UAAU,aAAa,KAAK,GAAG,+CAA+C,OAAO,UAAU,EAAE;IACjG,IAAI,CAAC,yBAAyB,SAAS,OAAO,GAAG,MAAM,cAAc,0BAA0B,6CAA6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AAY;CACxC,OAAO,kBAAkB,UAAU,OAAO,UAAU;AACrD;;AAEA,SAAS,UAAU,OAAO,YAAY;CACrC,OAAO,kBAAkB,OAAO,OAAO,UAAU;AAClD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/orm-postgres",
|
|
3
|
-
"version": "8.0.0-rc.12-dev.
|
|
3
|
+
"version": "8.0.0-rc.12-dev.17",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"skills"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@prisma/orm-family-sql": "8.0.0-rc.12-dev.
|
|
14
|
-
"@prisma/orm-framework": "8.0.0-rc.12-dev.
|
|
15
|
-
"@prisma/orm-target-postgres": "8.0.0-rc.12-dev.
|
|
16
|
-
"@prisma/orm-toolchain": "8.0.0-rc.12-dev.
|
|
13
|
+
"@prisma/orm-family-sql": "8.0.0-rc.12-dev.17",
|
|
14
|
+
"@prisma/orm-framework": "8.0.0-rc.12-dev.17",
|
|
15
|
+
"@prisma/orm-target-postgres": "8.0.0-rc.12-dev.17",
|
|
16
|
+
"@prisma/orm-toolchain": "8.0.0-rc.12-dev.17",
|
|
17
17
|
"@types/node": "26.1.2",
|
|
18
18
|
"@types/pg": "8.20.4",
|
|
19
19
|
"pathe": "^2.0.3",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"tinyglobby": "^0.2.17"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@internal/postgres": "8.0.0-rc.12-dev.
|
|
25
|
-
"@repo/tsconfig": "8.0.0-rc.12-dev.
|
|
26
|
-
"@repo/tsdown": "8.0.0-rc.12-dev.
|
|
24
|
+
"@internal/postgres": "8.0.0-rc.12-dev.17",
|
|
25
|
+
"@repo/tsconfig": "8.0.0-rc.12-dev.17",
|
|
26
|
+
"@repo/tsdown": "8.0.0-rc.12-dev.17",
|
|
27
27
|
"tsdown": "0.22.14",
|
|
28
28
|
"typescript": "5.9.3"
|
|
29
29
|
},
|
package/skills/prisma-8/SKILL.md
CHANGED