viborm 1.1.0 → 1.2.1
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-namespace-DMhEF6my.mjs → adapter-namespace-DqkJQdrD.mjs} +2 -2
- package/dist/{adapter-namespace-DMhEF6my.mjs.map → adapter-namespace-DqkJQdrD.mjs.map} +1 -1
- package/dist/adapters.d.mts +1 -1
- package/dist/adapters.mjs +1 -1
- package/dist/{array-literal-DcEm5tt_.mjs → array-literal-BsbbSLw3.mjs} +1 -1
- package/dist/{array-literal-DcEm5tt_.mjs.map → array-literal-BsbbSLw3.mjs.map} +1 -1
- package/dist/base-AdXAoy6l.mjs +2 -0
- package/dist/base-AdXAoy6l.mjs.map +1 -0
- package/dist/batch-refs-4L8ECdPU.mjs +2 -0
- package/dist/batch-refs-4L8ECdPU.mjs.map +1 -0
- package/dist/bind-parameter-capacity-CjPgqnmx.mjs +2 -0
- package/dist/{bind-parameter-capacity-DzMcIB95.mjs.map → bind-parameter-capacity-CjPgqnmx.mjs.map} +1 -1
- package/dist/builder-Ycvq3ETg.mjs +2 -0
- package/dist/builder-Ycvq3ETg.mjs.map +1 -0
- package/dist/bun-sql.d.mts +19 -2
- package/dist/bun-sql.mjs +1 -1
- package/dist/bun-sql.mjs.map +1 -1
- package/dist/bun-sqlite.d.mts +9 -8
- package/dist/bun-sqlite.mjs +1 -1
- package/dist/bun-sqlite.mjs.map +1 -1
- package/dist/cache/cloudflare-kv.d.mts +1 -1
- package/dist/cache/cloudflare-kv.mjs +1 -1
- package/dist/cache/memory.d.mts +1 -1
- package/dist/cache/memory.mjs +1 -1
- package/dist/cache/memory.mjs.map +1 -1
- package/dist/cache-BO57X0TT.mjs +2 -0
- package/dist/cache-BO57X0TT.mjs.map +1 -0
- package/dist/cache.d.mts +1 -1
- package/dist/cache.mjs +1 -1
- package/dist/cache.mjs.map +1 -1
- package/dist/canonical-json-rfC2Dg0X.mjs +2 -0
- package/dist/canonical-json-rfC2Dg0X.mjs.map +1 -0
- package/dist/chain-Dh0FV72b.mjs +2 -0
- package/dist/chain-Dh0FV72b.mjs.map +1 -0
- package/dist/cli.mjs +5 -6
- package/dist/cli.mjs.map +1 -1
- package/dist/client-BLiBmykn.mjs +2 -0
- package/dist/client-BLiBmykn.mjs.map +1 -0
- package/dist/client-CCgfcp5A.mjs +52 -0
- package/dist/client-CCgfcp5A.mjs.map +1 -0
- package/dist/client-XQSEkF90.d.mts +610 -0
- package/dist/client.d.mts +1 -1
- package/dist/client.mjs +1 -1
- package/dist/{clock-W8H2Khng.mjs → clock-CK41KO7t.mjs} +1 -1
- package/dist/{clock-W8H2Khng.mjs.map → clock-CK41KO7t.mjs.map} +1 -1
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +1 -1
- package/dist/controls-DXgIn4zh.mjs +2 -0
- package/dist/controls-DXgIn4zh.mjs.map +1 -0
- package/dist/d1.d.mts +1 -1
- package/dist/d1.mjs +1 -1
- package/dist/d1.mjs.map +1 -1
- package/dist/datetime-physical-codec-oIhiYZEP.mjs +2 -0
- package/dist/{datetime-physical-codec-BK93pJGW.mjs.map → datetime-physical-codec-oIhiYZEP.mjs.map} +1 -1
- package/dist/driver-B19QlFqn.mjs +2 -0
- package/dist/{driver-ZIbkciaz.mjs.map → driver-B19QlFqn.mjs.map} +1 -1
- package/dist/driver-BlnKXPFF.mjs +2 -0
- package/dist/driver-BlnKXPFF.mjs.map +1 -0
- package/dist/driver.d.mts +2 -2
- package/dist/driver.mjs +1 -1
- package/dist/error-mapping-CnPCv1dm.mjs +2 -0
- package/dist/error-mapping-CnPCv1dm.mjs.map +1 -0
- package/dist/every-4KE0p2Gw.mjs +2 -0
- package/dist/every-4KE0p2Gw.mjs.map +1 -0
- package/dist/{execution-context-Bm_qTp1i.mjs → execution-context-BKR3bgES.mjs} +1 -1
- package/dist/{execution-context-Bm_qTp1i.mjs.map → execution-context-BKR3bgES.mjs.map} +1 -1
- package/dist/fs-estate-CAhDg7nY.mjs +2 -0
- package/dist/fs-estate-CAhDg7nY.mjs.map +1 -0
- package/dist/{geo-area-codec-B4DRInvA.mjs → geo-area-codec-1SY9im7O.mjs} +2 -2
- package/dist/{geo-area-codec-B4DRInvA.mjs.map → geo-area-codec-1SY9im7O.mjs.map} +1 -1
- package/dist/geo-point-codec-lhxH42SK.mjs +2 -0
- package/dist/geo-point-codec-lhxH42SK.mjs.map +1 -0
- package/dist/{hydration-D6JICBQG.mjs → hydration-CAxOL4aI.mjs} +2 -2
- package/dist/{hydration-D6JICBQG.mjs.map → hydration-CAxOL4aI.mjs.map} +1 -1
- package/dist/identifier-conversion-GgbwHc2G.mjs +2 -0
- package/dist/identifier-conversion-GgbwHc2G.mjs.map +1 -0
- package/dist/{identifier-EsWKVHXi.mjs → identifier-hQCs8M1n.mjs} +2 -2
- package/dist/{identifier-EsWKVHXi.mjs.map → identifier-hQCs8M1n.mjs.map} +1 -1
- package/dist/identity-CLFhCTZx.mjs +2 -0
- package/dist/identity-CLFhCTZx.mjs.map +1 -0
- package/dist/{index-BbcE-gyl.d.mts → index-Likdf5qP.d.mts} +638 -351
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/instrumentation.d.mts +1 -1
- package/dist/instrumentation.mjs +1 -1
- package/dist/instrumentation.mjs.map +1 -1
- package/dist/{invariant-DCsftyml.mjs → invariant-BnLYqsHO.mjs} +1 -1
- package/dist/{invariant-DCsftyml.mjs.map → invariant-BnLYqsHO.mjs.map} +1 -1
- package/dist/{json-number-TpD-pfqt.mjs → json-number-CGXpPu4D.mjs} +1 -1
- package/dist/{json-number-TpD-pfqt.mjs.map → json-number-CGXpPu4D.mjs.map} +1 -1
- package/dist/key-BeoOwGr3.mjs +2 -0
- package/dist/key-BeoOwGr3.mjs.map +1 -0
- package/dist/libsql-Bu_IdFU1.mjs +11 -0
- package/dist/libsql-Bu_IdFU1.mjs.map +1 -0
- package/dist/libsql.d.mts +1 -1
- package/dist/libsql.mjs +1 -1
- package/dist/libsql.mjs.map +1 -1
- package/dist/memory-D4yxtCPK.mjs +2 -0
- package/dist/memory-D4yxtCPK.mjs.map +1 -0
- package/dist/migrations/mysql.d.mts +6 -0
- package/dist/migrations/mysql.mjs +2 -0
- package/dist/migrations/mysql.mjs.map +1 -0
- package/dist/migrations/postgres.d.mts +6 -0
- package/dist/migrations/postgres.mjs +2 -0
- package/dist/migrations/postgres.mjs.map +1 -0
- package/dist/migrations/sqlite.d.mts +6 -0
- package/dist/migrations/sqlite.mjs +2 -0
- package/dist/migrations/sqlite.mjs.map +1 -0
- package/dist/migrations/storage/durable-object.d.mts +17 -0
- package/dist/migrations/storage/durable-object.mjs +2 -0
- package/dist/migrations/storage/durable-object.mjs.map +1 -0
- package/dist/migrations/storage/fs.d.mts +6 -1
- package/dist/migrations/storage/fs.mjs +1 -1
- package/dist/migrations/storage/r2.d.mts +14 -0
- package/dist/migrations/storage/r2.mjs +2 -0
- package/dist/migrations/storage/r2.mjs.map +1 -0
- package/dist/migrations/tenant.d.mts +92 -0
- package/dist/migrations/tenant.mjs +2 -0
- package/dist/migrations/tenant.mjs.map +1 -0
- package/dist/{migrations-BWZSBMZh.mjs → migrations-DTObIjAm.mjs} +2 -2
- package/dist/migrations-DTObIjAm.mjs.map +1 -0
- package/dist/migrations.d.mts +6 -561
- package/dist/migrations.mjs +1 -1
- package/dist/migrations.mjs.map +1 -1
- package/dist/mysql-CibPaHSp.mjs +99 -0
- package/dist/mysql-CibPaHSp.mjs.map +1 -0
- package/dist/mysql-adapter-DkJPfoGf.mjs +2 -0
- package/dist/mysql-adapter-DkJPfoGf.mjs.map +1 -0
- package/dist/mysql2.d.mts +1 -3
- package/dist/mysql2.mjs +1 -1
- package/dist/mysql2.mjs.map +1 -1
- package/dist/neon-http.d.mts +1 -1
- package/dist/neon-http.mjs +1 -1
- package/dist/neon-http.mjs.map +1 -1
- package/dist/object-store-CbjhsBQ3.d.mts +156 -0
- package/dist/object-store-DQR6bTBY.mjs +2 -0
- package/dist/object-store-DQR6bTBY.mjs.map +1 -0
- package/dist/observation-DUSm7oXK.mjs +2 -0
- package/dist/observation-DUSm7oXK.mjs.map +1 -0
- package/dist/pg.d.mts +37 -12
- package/dist/pg.mjs +1 -1
- package/dist/pg.mjs.map +1 -1
- package/dist/pglite.d.mts +2 -1
- package/dist/pglite.mjs +1 -1
- package/dist/pglite.mjs.map +1 -1
- package/dist/physical-6V_LNU3L.mjs +2 -0
- package/dist/{physical-BkelResN.mjs.map → physical-6V_LNU3L.mjs.map} +1 -1
- package/dist/pinned-session-CLxj5M5e.mjs +2 -0
- package/dist/pinned-session-CLxj5M5e.mjs.map +1 -0
- package/dist/planetscale.d.mts +1 -1
- package/dist/planetscale.mjs +1 -1
- package/dist/planetscale.mjs.map +1 -1
- package/dist/{planner-Bbw8W81b.d.mts → planner-CwFUkNHP.d.mts} +57 -3
- package/dist/postgres-adapter-B3SQvcV1.mjs +2 -0
- package/dist/postgres-adapter-B3SQvcV1.mjs.map +1 -0
- package/dist/postgres-adapter-CQD2oGuD.mjs +2 -0
- package/dist/postgres-adapter-CQD2oGuD.mjs.map +1 -0
- package/dist/postgres-oqNW9xqo.mjs +415 -0
- package/dist/postgres-oqNW9xqo.mjs.map +1 -0
- package/dist/{postgres-result-Dc_iW3Hb.mjs → postgres-result-7F0DllQe.mjs} +2 -2
- package/dist/{postgres-result-Dc_iW3Hb.mjs.map → postgres-result-7F0DllQe.mjs.map} +1 -1
- package/dist/postgres.d.mts +11 -1
- package/dist/postgres.mjs +1 -1
- package/dist/postgres.mjs.map +1 -1
- package/dist/{provider-limits-DXj_pOT0.mjs → provider-limits-BHATED_m.mjs} +2 -2
- package/dist/{provider-limits-DXj_pOT0.mjs.map → provider-limits-BHATED_m.mjs.map} +1 -1
- package/dist/registration-preflight-DEjv050M.mjs +4 -0
- package/dist/registration-preflight-DEjv050M.mjs.map +1 -0
- package/dist/result-shape-CTNdNSW3.mjs +2 -0
- package/dist/result-shape-CTNdNSW3.mjs.map +1 -0
- package/dist/scalar-U0wD5bKy.mjs +2 -0
- package/dist/{scalar-BTktMqvO.mjs.map → scalar-U0wD5bKy.mjs.map} +1 -1
- package/dist/schema/json.d.mts +1 -1
- package/dist/schema/json.mjs +1 -1
- package/dist/schema/json.mjs.map +1 -1
- package/dist/schema-Cjem1-0f.mjs +2 -0
- package/dist/{schema-BFNcMdO6.mjs.map → schema-Cjem1-0f.mjs.map} +1 -1
- package/dist/schema-introspection-DEYGC2qg.mjs +6 -0
- package/dist/schema-introspection-DEYGC2qg.mjs.map +1 -0
- package/dist/schema.d.mts +1 -1
- package/dist/schema.mjs +1 -1
- package/dist/{select-assembly-BgqlrePH.mjs → select-assembly-f1UGoblh.mjs} +2 -2
- package/dist/select-assembly-f1UGoblh.mjs.map +1 -0
- package/dist/settle-B9Vg1FnP.mjs +2 -0
- package/dist/settle-B9Vg1FnP.mjs.map +1 -0
- package/dist/soft-delete.d.mts +1 -1
- package/dist/{sql--69HUgel.mjs → sql-Bp7jicEX.mjs} +1 -1
- package/dist/{sql--69HUgel.mjs.map → sql-Bp7jicEX.mjs.map} +1 -1
- package/dist/{sql-statement-tokens-CykxFmOJ.mjs → sql-statement-tokens-BBcoGmJb.mjs} +1 -1
- package/dist/{sql-statement-tokens-CykxFmOJ.mjs.map → sql-statement-tokens-BBcoGmJb.mjs.map} +1 -1
- package/dist/sql.d.mts +1 -1
- package/dist/sql.mjs +1 -1
- package/dist/sqlite-adapter-CW_3l6ea.mjs +2 -0
- package/dist/sqlite-adapter-CW_3l6ea.mjs.map +1 -0
- package/dist/sqlite-utils-DlgokMJN.mjs +2 -0
- package/dist/sqlite-utils-DlgokMJN.mjs.map +1 -0
- package/dist/sqlite3.d.mts +2 -8
- package/dist/sqlite3.mjs +1 -1
- package/dist/sqlite3.mjs.map +1 -1
- package/dist/standard-sql-Bk4RZPqJ.mjs +6 -0
- package/dist/standard-sql-Bk4RZPqJ.mjs.map +1 -0
- package/dist/{suppressed-failure-BPxfHTMc.mjs → suppressed-failure-BwULh-8h.mjs} +1 -1
- package/dist/{suppressed-failure-BPxfHTMc.mjs.map → suppressed-failure-BwULh-8h.mjs.map} +1 -1
- package/dist/{terminal-BbRi0CNZ.mjs → terminal-C8cq1WWX.mjs} +2 -2
- package/dist/{terminal-BbRi0CNZ.mjs.map → terminal-C8cq1WWX.mjs.map} +1 -1
- package/dist/{transaction-oskVwmsf.mjs → transaction-Bnl6ULTw.mjs} +2 -2
- package/dist/transaction-Bnl6ULTw.mjs.map +1 -0
- package/dist/{transaction-operation-BC7aua5V.mjs → transaction-operation-CKK3l_9x.mjs} +2 -2
- package/dist/{transaction-operation-BC7aua5V.mjs.map → transaction-operation-CKK3l_9x.mjs.map} +1 -1
- package/dist/{utils-CRFUUfNn.mjs → utils-CZNaOZR7.mjs} +4 -3
- package/dist/utils-CZNaOZR7.mjs.map +1 -0
- package/dist/v-D5Z06FKN.mjs +2 -0
- package/dist/v-D5Z06FKN.mjs.map +1 -0
- package/dist/validation-Dk9Q_-C7.mjs +2 -0
- package/dist/validation-Dk9Q_-C7.mjs.map +1 -0
- package/dist/validation-PF9-_nKd.mjs +2 -0
- package/dist/{validation-tgjL_9n8.mjs.map → validation-PF9-_nKd.mjs.map} +1 -1
- package/dist/validation.d.mts +1 -1
- package/dist/validation.mjs +1 -1
- package/dist/validator-X9-bwtRo.mjs +2 -0
- package/dist/{validator-DMlEScV3.mjs.map → validator-X9-bwtRo.mjs.map} +1 -1
- package/dist/value-guards-CK9guf2Z.mjs +2 -0
- package/dist/value-guards-CK9guf2Z.mjs.map +1 -0
- package/dist/version-B4VuToLC.mjs +2 -0
- package/dist/{version-De1l_ZMF.mjs.map → version-B4VuToLC.mjs.map} +1 -1
- package/package.json +76 -33
- package/dist/base-vfur-DaU.mjs +0 -2
- package/dist/base-vfur-DaU.mjs.map +0 -1
- package/dist/batch-refs-Op1fx9Bo.mjs +0 -6
- package/dist/batch-refs-Op1fx9Bo.mjs.map +0 -1
- package/dist/bind-parameter-capacity-DzMcIB95.mjs +0 -2
- package/dist/builder-DkWfNHEV.mjs +0 -2
- package/dist/builder-DkWfNHEV.mjs.map +0 -1
- package/dist/chain-uIFlkkXS.mjs +0 -2
- package/dist/chain-uIFlkkXS.mjs.map +0 -1
- package/dist/client-C8gXvWIA.mjs +0 -2
- package/dist/client-C8gXvWIA.mjs.map +0 -1
- package/dist/client-z9mcpRtA.mjs +0 -435
- package/dist/client-z9mcpRtA.mjs.map +0 -1
- package/dist/controls-BhxRnPYS.mjs +0 -2
- package/dist/controls-BhxRnPYS.mjs.map +0 -1
- package/dist/datetime-physical-codec-BK93pJGW.mjs +0 -2
- package/dist/driver-CHclfK3q.mjs +0 -2
- package/dist/driver-CHclfK3q.mjs.map +0 -1
- package/dist/driver-ZIbkciaz.mjs +0 -2
- package/dist/driver-options-DVxWlZ0s.mjs +0 -2
- package/dist/driver-options-DVxWlZ0s.mjs.map +0 -1
- package/dist/error-mapping-LKqxnw-b.mjs +0 -2
- package/dist/error-mapping-LKqxnw-b.mjs.map +0 -1
- package/dist/fs-estate-3Bu_K9mk.d.mts +0 -7
- package/dist/fs-estate-BLqNdigQ.mjs +0 -2
- package/dist/fs-estate-BLqNdigQ.mjs.map +0 -1
- package/dist/geo-point-codec-DUTTtlav.mjs +0 -2
- package/dist/geo-point-codec-DUTTtlav.mjs.map +0 -1
- package/dist/key-DKaqPb8w.mjs +0 -2
- package/dist/key-DKaqPb8w.mjs.map +0 -1
- package/dist/migrations-BWZSBMZh.mjs.map +0 -1
- package/dist/mysql-adapter-DtZdwqzc.mjs +0 -2
- package/dist/mysql-adapter-DtZdwqzc.mjs.map +0 -1
- package/dist/observation-CLp8ylmL.mjs +0 -2
- package/dist/observation-CLp8ylmL.mjs.map +0 -1
- package/dist/physical-BkelResN.mjs +0 -2
- package/dist/pinned-session-CNANv7bv.mjs +0 -2
- package/dist/pinned-session-CNANv7bv.mjs.map +0 -1
- package/dist/postgres-adapter-ButxrmEa.mjs +0 -2
- package/dist/postgres-adapter-ButxrmEa.mjs.map +0 -1
- package/dist/registration-preflight-BrA3EWvq.mjs +0 -4
- package/dist/registration-preflight-BrA3EWvq.mjs.map +0 -1
- package/dist/result-shape-CKLOBSKl.mjs +0 -2
- package/dist/result-shape-CKLOBSKl.mjs.map +0 -1
- package/dist/scalar-BTktMqvO.mjs +0 -2
- package/dist/schema-BFNcMdO6.mjs +0 -2
- package/dist/schema-introspection-C7P7lwIs.mjs +0 -6
- package/dist/schema-introspection-C7P7lwIs.mjs.map +0 -1
- package/dist/select-assembly-BgqlrePH.mjs.map +0 -1
- package/dist/sqlite-adapter-1krz0OXw.mjs +0 -2
- package/dist/sqlite-adapter-1krz0OXw.mjs.map +0 -1
- package/dist/sqlite-utils-D26BFuJJ.mjs +0 -2
- package/dist/sqlite-utils-D26BFuJJ.mjs.map +0 -1
- package/dist/transaction-oskVwmsf.mjs.map +0 -1
- package/dist/transactions-gjmrWN5W.mjs +0 -2
- package/dist/transactions-gjmrWN5W.mjs.map +0 -1
- package/dist/utils-CRFUUfNn.mjs.map +0 -1
- package/dist/v-B2WwtcRz.mjs +0 -2
- package/dist/v-B2WwtcRz.mjs.map +0 -1
- package/dist/validation-Du6j0Q38.mjs +0 -2
- package/dist/validation-Du6j0Q38.mjs.map +0 -1
- package/dist/validation-tgjL_9n8.mjs +0 -2
- package/dist/validator-DMlEScV3.mjs +0 -2
- package/dist/version-De1l_ZMF.mjs +0 -2
- /package/dist/{contract-BHUOUAZ-.d.mts → contract-CIIqgFyb.d.mts} +0 -0
- /package/dist/{sql--yhoVvRM.d.mts → sql-BvfwUKIh.d.mts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as sqlTag, n as Sql } from "./sql
|
|
1
|
+
import { c as sqlTag, n as Sql } from "./sql-BvfwUKIh.mjs";
|
|
2
2
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
3
3
|
|
|
4
4
|
//#region src/schema/scalars/native-types.d.ts
|
|
@@ -765,6 +765,7 @@ declare enum VibORMErrorCode {
|
|
|
765
765
|
MIGRATION_AMBIGUOUS_COMMIT = "V11020",
|
|
766
766
|
MIGRATION_UNSUPPORTED_PROVIDER = "V11021",
|
|
767
767
|
MIGRATION_CORRUPTION = "V11022",
|
|
768
|
+
MIGRATION_INVALID_INDEX = "V11023",
|
|
768
769
|
OPERATION_ALREADY_EXECUTED = "V12001",
|
|
769
770
|
OPERATION_EXECUTION_CONFLICT = "V12002",
|
|
770
771
|
OPERATION_CLIENT_MISMATCH = "V12003",
|
|
@@ -812,6 +813,12 @@ interface VibORMErrorMeta {
|
|
|
812
813
|
/** Additional context */
|
|
813
814
|
[key: string]: unknown;
|
|
814
815
|
}
|
|
816
|
+
/** The options every VibORM error constructor forwards to {@link VibORMError}. */
|
|
817
|
+
interface VibORMErrorOptions {
|
|
818
|
+
cause?: Error | undefined;
|
|
819
|
+
diagnostics?: DiagnosticDisclosure | undefined;
|
|
820
|
+
meta?: VibORMErrorMeta | undefined;
|
|
821
|
+
}
|
|
815
822
|
/**
|
|
816
823
|
* Base error class for all VibORM errors
|
|
817
824
|
*/
|
|
@@ -826,10 +833,7 @@ declare class VibORMError extends Error {
|
|
|
826
833
|
readonly meta: VibORMErrorMeta;
|
|
827
834
|
/** Timestamp when error occurred */
|
|
828
835
|
readonly timestamp: Date;
|
|
829
|
-
constructor(message: string, code: VibORMErrorCode, options?: {
|
|
830
|
-
cause?: Error | undefined;
|
|
831
|
-
meta?: VibORMErrorMeta | undefined;
|
|
832
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
836
|
+
constructor(message: string, code: VibORMErrorCode, options?: VibORMErrorOptions & {
|
|
833
837
|
/** Internal validation boundary evidence, snapshotted with the error. */
|
|
834
838
|
validation?: {
|
|
835
839
|
source: unknown;
|
|
@@ -923,15 +927,7 @@ declare class UniqueConstraintError extends VibORMError {
|
|
|
923
927
|
static readonly diagnosticName = "UniqueConstraintError";
|
|
924
928
|
/** Literal discriminant: this class always carries `UNIQUE_CONSTRAINT`. */
|
|
925
929
|
readonly code: typeof VibORMErrorCode.UNIQUE_CONSTRAINT;
|
|
926
|
-
constructor(message: string, options?:
|
|
927
|
-
cause?: Error | undefined;
|
|
928
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
929
|
-
meta?: VibORMErrorMeta & {
|
|
930
|
-
constraint?: string;
|
|
931
|
-
table?: string;
|
|
932
|
-
columns?: string[];
|
|
933
|
-
};
|
|
934
|
-
});
|
|
930
|
+
constructor(message: string, options?: VibORMErrorOptions);
|
|
935
931
|
}
|
|
936
932
|
/**
|
|
937
933
|
* Foreign key constraint violation
|
|
@@ -940,13 +936,7 @@ declare class ForeignKeyError extends VibORMError {
|
|
|
940
936
|
static readonly diagnosticName = "ForeignKeyError";
|
|
941
937
|
/** Literal discriminant: this class always carries `FOREIGN_KEY_CONSTRAINT`. */
|
|
942
938
|
readonly code: typeof VibORMErrorCode.FOREIGN_KEY_CONSTRAINT;
|
|
943
|
-
constructor(message: string, options?:
|
|
944
|
-
cause?: Error | undefined;
|
|
945
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
946
|
-
meta?: VibORMErrorMeta & {
|
|
947
|
-
constraint?: string;
|
|
948
|
-
};
|
|
949
|
-
});
|
|
939
|
+
constructor(message: string, options?: VibORMErrorOptions);
|
|
950
940
|
}
|
|
951
941
|
/**
|
|
952
942
|
* Not-null constraint violation
|
|
@@ -955,14 +945,7 @@ declare class NotNullConstraintError extends VibORMError {
|
|
|
955
945
|
static readonly diagnosticName = "NotNullConstraintError";
|
|
956
946
|
/** Literal discriminant: this class always carries `NOT_NULL_CONSTRAINT`. */
|
|
957
947
|
readonly code: typeof VibORMErrorCode.NOT_NULL_CONSTRAINT;
|
|
958
|
-
constructor(message: string, options?:
|
|
959
|
-
cause?: Error | undefined;
|
|
960
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
961
|
-
meta?: VibORMErrorMeta & {
|
|
962
|
-
table?: string;
|
|
963
|
-
columns?: string[];
|
|
964
|
-
};
|
|
965
|
-
});
|
|
948
|
+
constructor(message: string, options?: VibORMErrorOptions);
|
|
966
949
|
}
|
|
967
950
|
/**
|
|
968
951
|
* Check constraint violation
|
|
@@ -971,13 +954,7 @@ declare class CheckConstraintError extends VibORMError {
|
|
|
971
954
|
static readonly diagnosticName = "CheckConstraintError";
|
|
972
955
|
/** Literal discriminant: this class always carries `CHECK_CONSTRAINT`. */
|
|
973
956
|
readonly code: typeof VibORMErrorCode.CHECK_CONSTRAINT;
|
|
974
|
-
constructor(message: string, options?:
|
|
975
|
-
cause?: Error | undefined;
|
|
976
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
977
|
-
meta?: VibORMErrorMeta & {
|
|
978
|
-
constraint?: string;
|
|
979
|
-
};
|
|
980
|
-
});
|
|
957
|
+
constructor(message: string, options?: VibORMErrorOptions);
|
|
981
958
|
}
|
|
982
959
|
/**
|
|
983
960
|
* Value too long for the column's declared type (Prisma P2000)
|
|
@@ -997,14 +974,7 @@ declare class ValueTooLongError extends VibORMError {
|
|
|
997
974
|
static readonly diagnosticName = "ValueTooLongError";
|
|
998
975
|
/** Literal discriminant: this class always carries `VALUE_TOO_LONG`. */
|
|
999
976
|
readonly code: typeof VibORMErrorCode.VALUE_TOO_LONG;
|
|
1000
|
-
constructor(message: string, options?:
|
|
1001
|
-
cause?: Error | undefined;
|
|
1002
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
1003
|
-
meta?: VibORMErrorMeta & {
|
|
1004
|
-
table?: string;
|
|
1005
|
-
columns?: string[];
|
|
1006
|
-
};
|
|
1007
|
-
});
|
|
977
|
+
constructor(message: string, options?: VibORMErrorOptions);
|
|
1008
978
|
}
|
|
1009
979
|
/**
|
|
1010
980
|
* Type guard for unique constraint errors
|
|
@@ -1050,6 +1020,13 @@ interface MigrationErrorMeta extends VibORMErrorMeta {
|
|
|
1050
1020
|
stateId?: string;
|
|
1051
1021
|
/** Push plan digest involved in the refusal */
|
|
1052
1022
|
planHash?: string;
|
|
1023
|
+
/** Origin state of the edge (absent for the empty root) */
|
|
1024
|
+
fromState?: string;
|
|
1025
|
+
/** Destination state of the edge */
|
|
1026
|
+
toState?: string;
|
|
1027
|
+
/** Operation and dispatch the failure names */
|
|
1028
|
+
operationId?: string;
|
|
1029
|
+
dispatchId?: string;
|
|
1053
1030
|
/** Honest effect classification after a non-transactional failure */
|
|
1054
1031
|
effectState?: "none" | "committed" | "partial" | "may-have-committed";
|
|
1055
1032
|
/** True when some provider work may already have committed */
|
|
@@ -1064,7 +1041,7 @@ interface MigrationErrorMeta extends VibORMErrorMeta {
|
|
|
1064
1041
|
* `DRIVER_NOT_SUPPORTED` (`drivers/index.ts`) and `INTERNAL_ERROR` (unreachable operation
|
|
1065
1042
|
* kinds). A code outside this union is a compile error at the construction site.
|
|
1066
1043
|
*/
|
|
1067
|
-
type MigrationErrorCode = typeof VibORMErrorCode.MIGRATION_FAILED | typeof VibORMErrorCode.MIGRATION_NOT_FOUND | typeof VibORMErrorCode.MIGRATION_CHECKSUM_MISMATCH | typeof VibORMErrorCode.MIGRATION_DIALECT_MISMATCH | typeof VibORMErrorCode.MIGRATION_LOCK_FAILED | typeof VibORMErrorCode.MIGRATION_ALREADY_APPLIED | typeof VibORMErrorCode.MIGRATION_OUT_OF_ORDER | typeof VibORMErrorCode.MIGRATION_FILE_NOT_FOUND | typeof VibORMErrorCode.MIGRATION_INVALID_STATE | typeof VibORMErrorCode.MIGRATION_DESTRUCTIVE_REJECTED | typeof VibORMErrorCode.MIGRATION_STORAGE_REQUIRED | typeof VibORMErrorCode.MIGRATION_INVALID_ESTATE | typeof VibORMErrorCode.MIGRATION_PATH_REQUIRED | typeof VibORMErrorCode.MIGRATION_DRIFT | typeof VibORMErrorCode.MIGRATION_MARKER_CONFLICT | typeof VibORMErrorCode.MIGRATION_UNFINISHED_ATTEMPT | typeof VibORMErrorCode.MIGRATION_CONSENT_REQUIRED | typeof VibORMErrorCode.MIGRATION_CONSENT_MISMATCH | typeof VibORMErrorCode.MIGRATION_PARTIAL_EFFECT | typeof VibORMErrorCode.MIGRATION_AMBIGUOUS_COMMIT | typeof VibORMErrorCode.MIGRATION_UNSUPPORTED_PROVIDER | typeof VibORMErrorCode.MIGRATION_CORRUPTION | typeof VibORMErrorCode.INVALID_INPUT | typeof VibORMErrorCode.FEATURE_NOT_SUPPORTED | typeof VibORMErrorCode.DRIVER_NOT_SUPPORTED | typeof VibORMErrorCode.INTERNAL_ERROR;
|
|
1044
|
+
type MigrationErrorCode = typeof VibORMErrorCode.MIGRATION_FAILED | typeof VibORMErrorCode.MIGRATION_NOT_FOUND | typeof VibORMErrorCode.MIGRATION_CHECKSUM_MISMATCH | typeof VibORMErrorCode.MIGRATION_DIALECT_MISMATCH | typeof VibORMErrorCode.MIGRATION_LOCK_FAILED | typeof VibORMErrorCode.MIGRATION_ALREADY_APPLIED | typeof VibORMErrorCode.MIGRATION_OUT_OF_ORDER | typeof VibORMErrorCode.MIGRATION_FILE_NOT_FOUND | typeof VibORMErrorCode.MIGRATION_INVALID_STATE | typeof VibORMErrorCode.MIGRATION_DESTRUCTIVE_REJECTED | typeof VibORMErrorCode.MIGRATION_STORAGE_REQUIRED | typeof VibORMErrorCode.MIGRATION_INVALID_ESTATE | typeof VibORMErrorCode.MIGRATION_PATH_REQUIRED | typeof VibORMErrorCode.MIGRATION_DRIFT | typeof VibORMErrorCode.MIGRATION_MARKER_CONFLICT | typeof VibORMErrorCode.MIGRATION_UNFINISHED_ATTEMPT | typeof VibORMErrorCode.MIGRATION_CONSENT_REQUIRED | typeof VibORMErrorCode.MIGRATION_CONSENT_MISMATCH | typeof VibORMErrorCode.MIGRATION_PARTIAL_EFFECT | typeof VibORMErrorCode.MIGRATION_AMBIGUOUS_COMMIT | typeof VibORMErrorCode.MIGRATION_UNSUPPORTED_PROVIDER | typeof VibORMErrorCode.MIGRATION_CORRUPTION | typeof VibORMErrorCode.MIGRATION_INVALID_INDEX | typeof VibORMErrorCode.INVALID_INPUT | typeof VibORMErrorCode.FEATURE_NOT_SUPPORTED | typeof VibORMErrorCode.DRIVER_NOT_SUPPORTED | typeof VibORMErrorCode.INTERNAL_ERROR;
|
|
1068
1045
|
/**
|
|
1069
1046
|
* Migration-related errors
|
|
1070
1047
|
*/
|
|
@@ -1095,10 +1072,7 @@ declare class ConnectionError extends VibORMError {
|
|
|
1095
1072
|
static readonly diagnosticName = "ConnectionError";
|
|
1096
1073
|
/** Discriminant: one of {@link ConnectionErrorCode}, never a code outside the family. */
|
|
1097
1074
|
readonly code: ConnectionErrorCode;
|
|
1098
|
-
constructor(message: string, options?: {
|
|
1099
|
-
cause?: Error | undefined;
|
|
1100
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
1101
|
-
meta?: VibORMErrorMeta | undefined;
|
|
1075
|
+
constructor(message: string, options?: VibORMErrorOptions & {
|
|
1102
1076
|
code?: ConnectionErrorCode | undefined;
|
|
1103
1077
|
});
|
|
1104
1078
|
}
|
|
@@ -1119,11 +1093,7 @@ declare class ClientInitializationError extends VibORMError {
|
|
|
1119
1093
|
static readonly diagnosticName = "ClientInitializationError";
|
|
1120
1094
|
/** Literal discriminant: this class always carries `CLIENT_INITIALIZATION`. */
|
|
1121
1095
|
readonly code: typeof VibORMErrorCode.CLIENT_INITIALIZATION;
|
|
1122
|
-
constructor(message: string, options?:
|
|
1123
|
-
cause?: Error | undefined;
|
|
1124
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
1125
|
-
meta?: VibORMErrorMeta | undefined;
|
|
1126
|
-
});
|
|
1096
|
+
constructor(message: string, options?: VibORMErrorOptions);
|
|
1127
1097
|
}
|
|
1128
1098
|
/**
|
|
1129
1099
|
* Type guard for client initialization errors
|
|
@@ -1146,10 +1116,7 @@ declare class QueryError extends VibORMError {
|
|
|
1146
1116
|
static readonly diagnosticName = "QueryError";
|
|
1147
1117
|
/** Discriminant: one of {@link QueryErrorCode}, never a code outside the family. */
|
|
1148
1118
|
readonly code: QueryErrorCode;
|
|
1149
|
-
constructor(message: string, options?: {
|
|
1150
|
-
cause?: Error | undefined;
|
|
1151
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
1152
|
-
meta?: VibORMErrorMeta | undefined;
|
|
1119
|
+
constructor(message: string, options?: VibORMErrorOptions & {
|
|
1153
1120
|
code?: QueryErrorCode | undefined;
|
|
1154
1121
|
});
|
|
1155
1122
|
}
|
|
@@ -1182,10 +1149,7 @@ declare class NestedWriteError extends VibORMError {
|
|
|
1182
1149
|
static readonly diagnosticName = "NestedWriteError";
|
|
1183
1150
|
/** Discriminant: one of {@link NestedWriteErrorCode}, never a code outside the family. */
|
|
1184
1151
|
readonly code: NestedWriteErrorCode;
|
|
1185
|
-
constructor(message: string, relation: string, options?: {
|
|
1186
|
-
cause?: Error | undefined;
|
|
1187
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
1188
|
-
meta?: VibORMErrorMeta | undefined;
|
|
1152
|
+
constructor(message: string, relation: string, options?: VibORMErrorOptions & {
|
|
1189
1153
|
code?: NestedWriteErrorCode | undefined;
|
|
1190
1154
|
});
|
|
1191
1155
|
}
|
|
@@ -1202,11 +1166,7 @@ declare class NestedWriteAssertionError extends VibORMError {
|
|
|
1202
1166
|
static readonly diagnosticName = "NestedWriteAssertionError";
|
|
1203
1167
|
/** Literal discriminant: this class always carries `NESTED_WRITE_ASSERTION_FAILED`. */
|
|
1204
1168
|
readonly code: typeof VibORMErrorCode.NESTED_WRITE_ASSERTION_FAILED;
|
|
1205
|
-
constructor(message: string, options?:
|
|
1206
|
-
cause?: Error | undefined;
|
|
1207
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
1208
|
-
meta?: VibORMErrorMeta | undefined;
|
|
1209
|
-
});
|
|
1169
|
+
constructor(message: string, options?: VibORMErrorOptions);
|
|
1210
1170
|
}
|
|
1211
1171
|
/**
|
|
1212
1172
|
* Feature not supported errors
|
|
@@ -1330,10 +1290,7 @@ declare class TransactionError extends VibORMError {
|
|
|
1330
1290
|
static readonly diagnosticName = "TransactionError";
|
|
1331
1291
|
/** Discriminant: one of {@link TransactionErrorCode}, never a code outside the family. */
|
|
1332
1292
|
readonly code: TransactionErrorCode;
|
|
1333
|
-
constructor(message: string, options?: {
|
|
1334
|
-
cause?: Error | undefined;
|
|
1335
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
1336
|
-
meta?: VibORMErrorMeta | undefined;
|
|
1293
|
+
constructor(message: string, options?: VibORMErrorOptions & {
|
|
1337
1294
|
code?: TransactionErrorCode | undefined;
|
|
1338
1295
|
});
|
|
1339
1296
|
}
|
|
@@ -1375,11 +1332,6 @@ type ValidationErrorSource = {
|
|
|
1375
1332
|
readonly target?: string | undefined;
|
|
1376
1333
|
readonly schemaType?: string | undefined;
|
|
1377
1334
|
};
|
|
1378
|
-
interface ValidationErrorOptions {
|
|
1379
|
-
cause?: Error | undefined;
|
|
1380
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
1381
|
-
meta?: VibORMErrorMeta | undefined;
|
|
1382
|
-
}
|
|
1383
1335
|
/**
|
|
1384
1336
|
* Input validation errors
|
|
1385
1337
|
*/
|
|
@@ -1397,7 +1349,7 @@ declare class ValidationError extends VibORMError {
|
|
|
1397
1349
|
* name the caller used (see {@link publicOperationName}).
|
|
1398
1350
|
*/
|
|
1399
1351
|
readonly operation?: Operation | undefined;
|
|
1400
|
-
constructor(sourceOrOperation: Operation | ValidationErrorSource, issues: ValidationIssue$1[], options?:
|
|
1352
|
+
constructor(sourceOrOperation: Operation | ValidationErrorSource, issues: ValidationIssue$1[], options?: VibORMErrorOptions);
|
|
1401
1353
|
}
|
|
1402
1354
|
/**
|
|
1403
1355
|
* Type guard for validation errors
|
|
@@ -1650,6 +1602,7 @@ interface JsonSchema$1 {
|
|
|
1650
1602
|
prefixItems?: JsonSchema$1[];
|
|
1651
1603
|
minItems?: number;
|
|
1652
1604
|
maxItems?: number;
|
|
1605
|
+
uniqueItems?: boolean;
|
|
1653
1606
|
anyOf?: JsonSchema$1[];
|
|
1654
1607
|
oneOf?: JsonSchema$1[];
|
|
1655
1608
|
allOf?: JsonSchema$1[];
|
|
@@ -2025,12 +1978,13 @@ interface ObjectOptions<T$1 = unknown, TKeys extends string = string> {
|
|
|
2025
1978
|
* So one hook: it runs after every member validated, over the validated
|
|
2026
1979
|
* output (a key spelled `undefined` is already absent there, which is the
|
|
2027
1980
|
* `{ f: undefined }` ≡ `{}` rule the whole surface follows), and returns the
|
|
2028
|
-
* refusal sentence
|
|
1981
|
+
* refusal sentence, an issue carrying the path of the key that is wrong, or
|
|
1982
|
+
* `undefined`. It is deliberately NOT part of the
|
|
2029
1983
|
* inferred input type: these are runtime completeness facts about a
|
|
2030
1984
|
* recursive filter surface, and distributing them into the type would turn
|
|
2031
1985
|
* every filter object into a union of one variant per operator.
|
|
2032
1986
|
*/
|
|
2033
|
-
refuse?: (value: Record<string, unknown>) => string | undefined;
|
|
1987
|
+
refuse?: (value: Record<string, unknown>) => string | ValidationIssue | undefined;
|
|
2034
1988
|
}
|
|
2035
1989
|
/**
|
|
2036
1990
|
* Omit specific keys from a type entirely.
|
|
@@ -2224,7 +2178,14 @@ declare function vector<const Opts extends ScalarOptions<number[], any> | undefi
|
|
|
2224
2178
|
};
|
|
2225
2179
|
//#endregion
|
|
2226
2180
|
//#region src/validation/index.d.ts
|
|
2227
|
-
|
|
2181
|
+
/**
|
|
2182
|
+
* Validate `value` against `schema`. `allIssues: true` reports every issue of
|
|
2183
|
+
* the value — each object member, each list item, every unknown or missing
|
|
2184
|
+
* key — instead of stopping at the first.
|
|
2185
|
+
*/
|
|
2186
|
+
declare function parse<const S$1 extends StandardSchemaV1>(schema: S$1, value: unknown, options?: {
|
|
2187
|
+
readonly allIssues?: boolean | undefined;
|
|
2188
|
+
}): ParseResult<S$1>;
|
|
2228
2189
|
//#endregion
|
|
2229
2190
|
//#region src/validation/primitives/transform.d.ts
|
|
2230
2191
|
/**
|
|
@@ -2521,7 +2482,8 @@ type FromObjectOptions<T$1 = unknown> = ObjectOptions<T$1>;
|
|
|
2521
2482
|
*/
|
|
2522
2483
|
type ComputeEntries<TObject extends Record<string, any>, TPath extends string> = { [K in keyof TObject]: SchemaAtPath<TObject, TPath, K> };
|
|
2523
2484
|
/**
|
|
2524
|
-
*
|
|
2485
|
+
* Project entries without constructing an object validator that a composer
|
|
2486
|
+
* would immediately discard. The public builder uses this same path boundary.
|
|
2525
2487
|
*/
|
|
2526
2488
|
|
|
2527
2489
|
/**
|
|
@@ -3015,6 +2977,14 @@ declare function createModelFieldRefs<TName extends string, M$1 extends Model$1<
|
|
|
3015
2977
|
*
|
|
3016
2978
|
* `sql` is the ordinary tagged template; interpolations inside a fragment ride
|
|
3017
2979
|
* along as bound parameters (see {@link file://../../sql/sql.ts}).
|
|
2980
|
+
*
|
|
2981
|
+
* PURITY IS THE CONTRACT for the callback handed this context. Validation may
|
|
2982
|
+
* run a payload's callbacks more than once — `upsert` re-parses its taken arm
|
|
2983
|
+
* (the C2 residue), so a callback under `upsert.update` can be invoked twice
|
|
2984
|
+
* for one call. A callback that counts its calls, mutates outer state, or
|
|
2985
|
+
* returns a different fragment each time gets exactly what it asks for; a pure
|
|
2986
|
+
* one is indistinguishable from a literal token, which is the whole point of
|
|
2987
|
+
* the sugar.
|
|
3018
2988
|
*/
|
|
3019
2989
|
interface OperandCtx<TModel> {
|
|
3020
2990
|
readonly fields: ModelFieldRefs<string, TModel>;
|
|
@@ -3287,6 +3257,14 @@ interface UnionSchema<TOptions extends readonly VibSchema<any, any>[], TInput =
|
|
|
3287
3257
|
* Create a union schema that validates against multiple options.
|
|
3288
3258
|
* Returns the result of the first matching schema.
|
|
3289
3259
|
*
|
|
3260
|
+
* A refusal names the member the value was written for. In a tagged union
|
|
3261
|
+
* (every member an object with its own literal at one key) that is the member
|
|
3262
|
+
* its tag names, and only that member runs. Otherwise it is the member whose
|
|
3263
|
+
* first issue reads DEEPEST into the value (`{ gt: "3" }` is refused at `gt`
|
|
3264
|
+
* by the operator object, not at the root by the shorthand). Members that
|
|
3265
|
+
* refused equally deep leave no such member, and the refusal lists what each
|
|
3266
|
+
* one said, once (one issue, path kept, when they all said the same).
|
|
3267
|
+
*
|
|
3290
3268
|
* @example
|
|
3291
3269
|
* const stringOrNumber = v.union([v.string(), v.number()]);
|
|
3292
3270
|
*/
|
|
@@ -3678,8 +3656,13 @@ type IsSingleKey<Union> = [Union] extends [never] ? false : [Union] extends [Uni
|
|
|
3678
3656
|
/** Only omission or one literal label is evidence for static pairing. */
|
|
3679
3657
|
type IsProvableRelationName<Name$1> = [Name$1] extends [undefined] ? true : [Name$1] extends [string] ? string extends Name$1 ? false : IsSingleKey<Name$1> : false;
|
|
3680
3658
|
type IsExactly<Union, Value> = [Union] extends [Value] ? [Value] extends [Union] ? true : false : false;
|
|
3681
|
-
/**
|
|
3682
|
-
|
|
3659
|
+
/**
|
|
3660
|
+
* Type IDENTITY, the strictest test TypeScript exposes to a conditional.
|
|
3661
|
+
* `NoInfer` keeps the signature comparison from inferring through both sides:
|
|
3662
|
+
* a client's relinked model state is a mapped type, so that inference would
|
|
3663
|
+
* walk its whole relation graph even when both sides are the same type.
|
|
3664
|
+
*/
|
|
3665
|
+
type Equal<Left, Right> = (<T$1>() => T$1 extends NoInfer<Left> ? 1 : 2) extends (<T$1>() => T$1 extends NoInfer<Right> ? 1 : 2) ? true : false;
|
|
3683
3666
|
type IsSameModel<Left, Right> = Equal<ModelStateOf$8<Left>, ModelStateOf$8<Right>>;
|
|
3684
3667
|
/**
|
|
3685
3668
|
* Does `R`'s target domain NAME `Source`? A model target names one getter; a
|
|
@@ -3711,8 +3694,12 @@ type VariantPointsAt<Entries$1, Source> = true extends { [Key in keyof Entries$1
|
|
|
3711
3694
|
* Steps 2-4. The keys of `Relations` that point at `Source`, carry the same
|
|
3712
3695
|
* relation-name claim as the asker (an unnamed slot pairs only with an unnamed
|
|
3713
3696
|
* candidate), and are not the excluded slot.
|
|
3697
|
+
*
|
|
3698
|
+
* The name test runs before the target test: comparing two literals rejects
|
|
3699
|
+
* nearly every slot of a hub model, while `PointsAt` must materialize each
|
|
3700
|
+
* slot's target model to compare identities.
|
|
3714
3701
|
*/
|
|
3715
|
-
type CandidateKeys<Relations, Source, AskingName, ExcludedKey> = { [Key in keyof Relations]: IsProvableRelationName<AskingName> extends true ? Key extends ExcludedKey ? never :
|
|
3702
|
+
type CandidateKeys<Relations, Source, AskingName, ExcludedKey> = { [Key in keyof Relations]: IsProvableRelationName<AskingName> extends true ? Key extends ExcludedKey ? never : IsProvableRelationName<RelationName$1<Relations[Key]>> extends true ? IsExactly<RelationName$1<Relations[Key]>, AskingName> extends true ? PointsAt<Relations[Key], Source> extends true ? Key : never : never : never : never }[keyof Relations];
|
|
3716
3703
|
type ForwardCandidates<SourceModel, FieldKey, R$1> = CandidateKeys<RelationsOf<TargetModelOf<R$1>>, SourceModel, RelationName$1<R$1>, IsSameModel<TargetModelOf<R$1>, SourceModel> extends true ? FieldKey : never>;
|
|
3717
3704
|
/**
|
|
3718
3705
|
* Step 5's reverse half, asked from the source model.
|
|
@@ -4037,25 +4024,73 @@ type ToManyCreateSchema<Source extends AnyModel, Key$1, S$1 extends RelationStat
|
|
|
4037
4024
|
interface NormalizedRecurrence {
|
|
4038
4025
|
readonly depth: number | false;
|
|
4039
4026
|
readonly cycles: "reject" | "prevent" | "allow";
|
|
4027
|
+
/** A projection's own output budget, when its caller set one. */
|
|
4028
|
+
readonly maxOccurrences?: number;
|
|
4040
4029
|
}
|
|
4041
4030
|
/**
|
|
4042
4031
|
* A foreign-key traversal has no cycle policy to choose: it rejects every
|
|
4043
4032
|
* cycle it reaches. `preventCycles` is therefore refused by the bag's own type,
|
|
4044
4033
|
* so no downstream guard has to know which topology a nested bag belongs to.
|
|
4045
4034
|
*/
|
|
4046
|
-
type
|
|
4035
|
+
type ForeignKeyFilterRecurse = true | {
|
|
4047
4036
|
readonly depth?: number | false;
|
|
4048
4037
|
readonly preventCycles?: undefined;
|
|
4049
4038
|
};
|
|
4050
|
-
type
|
|
4039
|
+
type GraphFilterRecurse = true | {
|
|
4051
4040
|
readonly depth?: number;
|
|
4052
4041
|
readonly preventCycles?: boolean;
|
|
4053
4042
|
} | {
|
|
4054
4043
|
readonly depth: false;
|
|
4055
4044
|
readonly preventCycles?: true;
|
|
4056
4045
|
};
|
|
4046
|
+
/**
|
|
4047
|
+
* A projection's bag adds the output budget. A `where` filter reads the
|
|
4048
|
+
* closure as a set and decodes no occurrence, so it has nothing to bound and
|
|
4049
|
+
* refuses the key by its own type.
|
|
4050
|
+
*/
|
|
4051
|
+
type OutputBudget = {
|
|
4052
|
+
readonly maxOccurrences?: number;
|
|
4053
|
+
};
|
|
4054
|
+
type ForeignKeyRecurse = true | (Exclude<ForeignKeyFilterRecurse, true> & OutputBudget);
|
|
4055
|
+
type GraphRecurse = true | (Exclude<GraphFilterRecurse, true> & OutputBudget);
|
|
4057
4056
|
type ForeignKeyRecurrenceSchema = V$1.Schema<ForeignKeyRecurse, NormalizedRecurrence>;
|
|
4058
4057
|
type GraphRecurrenceSchema = V$1.Schema<GraphRecurse, NormalizedRecurrence>;
|
|
4058
|
+
type ForeignKeyFilterRecurrenceSchema = V$1.Schema<ForeignKeyFilterRecurse, NormalizedRecurrence>;
|
|
4059
|
+
type GraphFilterRecurrenceSchema = V$1.Schema<GraphFilterRecurse, NormalizedRecurrence>;
|
|
4060
|
+
/**
|
|
4061
|
+
* The two placements of one recurrence language. A `select`/`include` node
|
|
4062
|
+
* bounds what it decodes; a `where` filter reads the closure as a set, decodes
|
|
4063
|
+
* no occurrence, and so takes no budget.
|
|
4064
|
+
*/
|
|
4065
|
+
interface RecurrenceLanguages {
|
|
4066
|
+
readonly projection: {
|
|
4067
|
+
readonly foreignKey: ForeignKeyRecurrenceSchema;
|
|
4068
|
+
readonly junction: GraphRecurrenceSchema;
|
|
4069
|
+
};
|
|
4070
|
+
readonly filter: {
|
|
4071
|
+
readonly foreignKey: ForeignKeyFilterRecurrenceSchema;
|
|
4072
|
+
readonly junction: GraphFilterRecurrenceSchema;
|
|
4073
|
+
};
|
|
4074
|
+
}
|
|
4075
|
+
/**
|
|
4076
|
+
* The runtime eligibility reader: the recurrence language a resolved slot
|
|
4077
|
+
* admits in its placement, or `undefined` when the slot cannot recurse.
|
|
4078
|
+
*
|
|
4079
|
+
* It reads three facts, each from its owner. The model's complete primary row
|
|
4080
|
+
* key comes from the key catalog. The edge kind comes from the resolved slot:
|
|
4081
|
+
* only an ordinary foreign-key or junction edge recurses, never a variant
|
|
4082
|
+
* carrier or an inverse bound to variant storage. Self-identity is the edge's
|
|
4083
|
+
* two endpoints sharing one model object, which is runtime identity rather
|
|
4084
|
+
* than structural agreement.
|
|
4085
|
+
*
|
|
4086
|
+
* The remaining conditions of the contract are already facts of a resolved
|
|
4087
|
+
* ordinary edge, so they are not asked again: only `s.toOne` declares a
|
|
4088
|
+
* foreign key, so a collection never owns one; the resolver publishes an
|
|
4089
|
+
* edge's `unique` exactly when both endpoints are singular, so a singular
|
|
4090
|
+
* inverse is always the proven one-to-one side; and a junction edge is
|
|
4091
|
+
* resolved only between two collections.
|
|
4092
|
+
*/
|
|
4093
|
+
|
|
4059
4094
|
declare const unavailableRecurrence: () => OptionalSchema<VibSchema<never, never>, undefined, undefined, undefined>;
|
|
4060
4095
|
type UnavailableRecurrenceSchema = ReturnType<typeof unavailableRecurrence>;
|
|
4061
4096
|
declare const unavailableRecursiveClause: (clause: string) => OptionalSchema<VibSchema<never, never>, undefined, undefined, undefined>;
|
|
@@ -4065,7 +4100,7 @@ type UnavailableRecursiveClauseSchema = ReturnType<typeof unavailableRecursiveCl
|
|
|
4065
4100
|
* `never` when it cannot recurse, so a recursive form whose `recurse` is
|
|
4066
4101
|
* required is uninhabitable there.
|
|
4067
4102
|
*/
|
|
4068
|
-
type RecurrenceFor<Source extends AnyModel, Key$1, S$1 extends RelationState> = StaticRecursiveMembership<Source, Key$1, S$1> extends StaticForeignKeyMembership ?
|
|
4103
|
+
type RecurrenceFor<Source extends AnyModel, Key$1, S$1 extends RelationState, Placement extends keyof RecurrenceLanguages = "projection"> = StaticRecursiveMembership<Source, Key$1, S$1> extends StaticForeignKeyMembership ? RecurrenceLanguages[Placement]["foreignKey"] : StaticRecursiveMembership<Source, Key$1, S$1> extends StaticJunctionMembership ? RecurrenceLanguages[Placement]["junction"] : never;
|
|
4069
4104
|
//#endregion
|
|
4070
4105
|
//#region src/validation/relations/filter.d.ts
|
|
4071
4106
|
/**
|
|
@@ -4125,15 +4160,15 @@ type Quantifiers<S$1 extends RelationState> = {
|
|
|
4125
4160
|
};
|
|
4126
4161
|
/**
|
|
4127
4162
|
* The recursive filter: a quantifier over the slot's transitive closure from
|
|
4128
|
-
* the filtered row, `self` adding that row itself. `recurse` is the
|
|
4129
|
-
*
|
|
4130
|
-
* normalization have one owner. Where the slot cannot
|
|
4131
|
-
* `recurse` is `never` and the form is uninhabitable;
|
|
4132
|
-
* the required key, as on the select side, so no
|
|
4133
|
-
* cyclic model graph eagerly.
|
|
4163
|
+
* the filtered row, `self` adding that row itself. `recurse` is the language
|
|
4164
|
+
* `select`/`include` admit on the slot without its output budget, so
|
|
4165
|
+
* eligibility, bounds and normalization have one owner. Where the slot cannot
|
|
4166
|
+
* recurse the required `recurse` is `never` and the form is uninhabitable;
|
|
4167
|
+
* eligibility stays inside the required key, as on the select side, so no
|
|
4168
|
+
* ordinary filter compares the cyclic model graph eagerly.
|
|
4134
4169
|
*/
|
|
4135
4170
|
type RecursiveFilterSchema<Source extends AnyModel, Key$1, S$1 extends RelationState> = V$1.Object<{
|
|
4136
|
-
recurse: RecurrenceFor<Source, Key$1, S$1>;
|
|
4171
|
+
recurse: RecurrenceFor<Source, Key$1, S$1, "filter">;
|
|
4137
4172
|
self: V$1.Boolean;
|
|
4138
4173
|
is: UnavailableRecursiveClauseSchema;
|
|
4139
4174
|
isNot: UnavailableRecursiveClauseSchema;
|
|
@@ -4171,22 +4206,6 @@ type ToOneFilterSchema<Source extends AnyModel, Key$1, S$1 extends RelationState
|
|
|
4171
4206
|
*/
|
|
4172
4207
|
type ToManyFilterSchema<Source extends AnyModel, Key$1, S$1 extends RelationState> = V$1.Union<readonly [V$1.Object<Quantifiers<S$1> & NoClosure>, RecursiveFilterSchema<Source, Key$1, S$1>]>;
|
|
4173
4208
|
//#endregion
|
|
4174
|
-
//#region src/drivers/shared/sqlite-utils.d.ts
|
|
4175
|
-
/**
|
|
4176
|
-
* Shared result parser for the SQLite drivers. It speaks about ROW VALUES only:
|
|
4177
|
-
* - Boolean integer parsing (0/1 -> false/true)
|
|
4178
|
-
* - `json` columns, which SQLite stores as TEXT
|
|
4179
|
-
*
|
|
4180
|
-
* It says nothing about a RESULT (Arnaud's D-35). A SQLite transport answers a
|
|
4181
|
-
* `count`/`exist` in the shape the engine's own projection asked for — the
|
|
4182
|
-
* engine aliases that column `_count` and reads `_count` back — so the meaning
|
|
4183
|
-
* of a count and an exists answer has one authority, the engine's decoder, and
|
|
4184
|
-
* this middleware has nothing to add at the result boundary. Recovering a count
|
|
4185
|
-
* from a provider that did NOT preserve the alias is a dialect fact, stated
|
|
4186
|
-
* once at the adapter seam by the provider that needs it (MySQL).
|
|
4187
|
-
*/
|
|
4188
|
-
declare const sqliteResultParser: DriverResultParser;
|
|
4189
|
-
//#endregion
|
|
4190
4209
|
//#region src/drivers/types.d.ts
|
|
4191
4210
|
/**
|
|
4192
4211
|
* Driver Types
|
|
@@ -4242,25 +4261,6 @@ interface BatchQuery {
|
|
|
4242
4261
|
/** Internal acknowledgement fired after a native batch commits, before decoding. */
|
|
4243
4262
|
type CommittedBatchNotification = () => Promise<void>;
|
|
4244
4263
|
//#endregion
|
|
4245
|
-
//#region src/extensions/official-facts.d.ts
|
|
4246
|
-
/** One native-batch member as the statement log attributes it. */
|
|
4247
|
-
interface StatementMember {
|
|
4248
|
-
readonly context: QueryExecutionContext;
|
|
4249
|
-
readonly params: unknown[];
|
|
4250
|
-
readonly sql: string;
|
|
4251
|
-
}
|
|
4252
|
-
/** What a statement's provider dispatch publishes, after transform and acquisition. */
|
|
4253
|
-
interface StatementExecution {
|
|
4254
|
-
readonly context: QueryExecutionContext;
|
|
4255
|
-
readonly sql: string;
|
|
4256
|
-
/** The one pre-dispatch parameter snapshot, or empty when nothing discloses it. */
|
|
4257
|
-
readonly params: unknown[];
|
|
4258
|
-
readonly forceErrorContext: boolean;
|
|
4259
|
-
/** Native batch: each member's own context, SQL and parameters. */
|
|
4260
|
-
readonly members?: readonly StatementMember[];
|
|
4261
|
-
}
|
|
4262
|
-
type LifecycleBoundary = "connect" | "disconnect" | "savepoint" | "transaction";
|
|
4263
|
-
//#endregion
|
|
4264
4264
|
//#region src/clock.d.ts
|
|
4265
4265
|
/**
|
|
4266
4266
|
* The time seam.
|
|
@@ -4298,6 +4298,115 @@ interface Clock {
|
|
|
4298
4298
|
setTimeout(callback: () => void, ms: number): ClockTimer;
|
|
4299
4299
|
}
|
|
4300
4300
|
//#endregion
|
|
4301
|
+
//#region src/drivers/shared/transaction-options.d.ts
|
|
4302
|
+
/** Prisma's isolation-level spellings, exactly. */
|
|
4303
|
+
declare const TRANSACTION_ISOLATION_LEVELS: readonly ["ReadUncommitted", "ReadCommitted", "RepeatableRead", "Serializable"];
|
|
4304
|
+
type TransactionIsolationLevel = (typeof TRANSACTION_ISOLATION_LEVELS)[number];
|
|
4305
|
+
/** Options accepted by the interactive (callback) `$transaction` form. */
|
|
4306
|
+
interface TransactionOptions {
|
|
4307
|
+
/** Isolation level for the transaction. */
|
|
4308
|
+
isolationLevel?: TransactionIsolationLevel;
|
|
4309
|
+
/** Milliseconds the callback body may run before rollback. */
|
|
4310
|
+
timeout?: number;
|
|
4311
|
+
/** Milliseconds to wait for a transaction slot before giving up. */
|
|
4312
|
+
maxWait?: number;
|
|
4313
|
+
}
|
|
4314
|
+
/**
|
|
4315
|
+
* Options accepted by the sequential (array) `$transaction` form. Prisma's
|
|
4316
|
+
* sequential API takes `isolationLevel` only: an array has no interactive
|
|
4317
|
+
* window for `timeout` to bound, so neither client offers it there.
|
|
4318
|
+
*/
|
|
4319
|
+
interface BatchTransactionOptions {
|
|
4320
|
+
isolationLevel?: TransactionIsolationLevel;
|
|
4321
|
+
}
|
|
4322
|
+
/** Where a driver must emit `SET TRANSACTION ISOLATION LEVEL`, if anywhere. */
|
|
4323
|
+
type IsolationLevelPlacement = /** PostgreSQL family: first statement *inside* the open transaction. */
|
|
4324
|
+
"provider" | "post-begin"
|
|
4325
|
+
/** MySQL family: on the transaction's own connection *before* BEGIN. */ | "pre-begin"
|
|
4326
|
+
/** SQLite family: serializable by construction; nothing to emit. */ | "serializable-only"
|
|
4327
|
+
/** No transaction is opened, so there is nothing to configure. */ | "unsupported";
|
|
4328
|
+
/** How a driver can bound the wait for a transaction slot. */
|
|
4329
|
+
type MaxWaitSupport = /** The driver serializes transactions through a queue we can bound. */
|
|
4330
|
+
"queue"
|
|
4331
|
+
/** The driver acquires a pooled connection it can abandon and release. */ | "acquisition"
|
|
4332
|
+
/** No wait we own, or no wait at all. */ | "unsupported";
|
|
4333
|
+
/**
|
|
4334
|
+
* A driver's honest answer for each option. Every advertised driver declares
|
|
4335
|
+
* one; `tests/drivers/transaction-portability.test.ts` pins every cell.
|
|
4336
|
+
*/
|
|
4337
|
+
interface TransactionOptionSupport {
|
|
4338
|
+
readonly isolationLevel: IsolationLevelPlacement;
|
|
4339
|
+
/**
|
|
4340
|
+
* Why this driver cannot honor the levels it refuses. Required whenever
|
|
4341
|
+
* `isolationLevel` is not `"post-begin"` or `"pre-begin"`, so a refusal
|
|
4342
|
+
* always names its reason instead of just saying "no".
|
|
4343
|
+
*/
|
|
4344
|
+
readonly isolationLevelReason?: string;
|
|
4345
|
+
/** Whether the callback body can be raced against a timer and rolled back. */
|
|
4346
|
+
readonly timeout: boolean;
|
|
4347
|
+
/** Why `timeout` cannot be honored. Required when `timeout` is false. */
|
|
4348
|
+
readonly timeoutReason?: string;
|
|
4349
|
+
readonly maxWait: MaxWaitSupport;
|
|
4350
|
+
/** Why `maxWait` cannot be honored. Required when `maxWait` is unsupported. */
|
|
4351
|
+
readonly maxWaitReason?: string;
|
|
4352
|
+
}
|
|
4353
|
+
/** The `$transaction` form the options were passed to. */
|
|
4354
|
+
type TransactionForm = "callback" | "batch";
|
|
4355
|
+
/** What the driver layer must act on. `timeout` never reaches a driver. */
|
|
4356
|
+
interface DriverTransactionOptions {
|
|
4357
|
+
/** Set only when the driver's placement is `"pre-begin"`. */
|
|
4358
|
+
readonly isolationLevel?: TransactionIsolationLevel;
|
|
4359
|
+
/** Set only when the driver's max-wait mode is `"acquisition"`. */
|
|
4360
|
+
readonly maxWaitMs?: number;
|
|
4361
|
+
}
|
|
4362
|
+
/** The honored shape of a validated, driver-accepted options object. */
|
|
4363
|
+
interface TransactionPlan {
|
|
4364
|
+
readonly isolationLevel?: TransactionIsolationLevel;
|
|
4365
|
+
/** `SET TRANSACTION ISOLATION LEVEL ...`, when the driver emits SQL. */
|
|
4366
|
+
readonly isolationStatement?: string;
|
|
4367
|
+
readonly isolationPlacement: IsolationLevelPlacement;
|
|
4368
|
+
readonly timeoutMs?: number;
|
|
4369
|
+
readonly maxWaitMs?: number;
|
|
4370
|
+
readonly maxWaitMode: MaxWaitSupport;
|
|
4371
|
+
/** The subset the driver's own `transaction()` must act on. */
|
|
4372
|
+
readonly driverOptions?: DriverTransactionOptions;
|
|
4373
|
+
}
|
|
4374
|
+
//#endregion
|
|
4375
|
+
//#region src/drivers/shared/sqlite-utils.d.ts
|
|
4376
|
+
/**
|
|
4377
|
+
* Shared result parser for the SQLite drivers. It speaks about ROW VALUES only:
|
|
4378
|
+
* - Boolean integer parsing (0/1 -> false/true)
|
|
4379
|
+
* - `json` columns, which SQLite stores as TEXT
|
|
4380
|
+
*
|
|
4381
|
+
* It says nothing about a RESULT (Arnaud's D-35). A SQLite transport answers a
|
|
4382
|
+
* `count`/`exist` in the shape the engine's own projection asked for — the
|
|
4383
|
+
* engine aliases that column `_count` and reads `_count` back — so the meaning
|
|
4384
|
+
* of a count and an exists answer has one authority, the engine's decoder, and
|
|
4385
|
+
* this middleware has nothing to add at the result boundary. Recovering a count
|
|
4386
|
+
* from a provider that did NOT preserve the alias is a dialect fact, stated
|
|
4387
|
+
* once at the adapter seam by the provider that needs it (MySQL).
|
|
4388
|
+
*/
|
|
4389
|
+
declare const sqliteResultParser: DriverResultParser;
|
|
4390
|
+
//#endregion
|
|
4391
|
+
//#region src/extensions/official-facts.d.ts
|
|
4392
|
+
/** One native-batch member as the statement log attributes it. */
|
|
4393
|
+
interface StatementMember {
|
|
4394
|
+
readonly context: QueryExecutionContext;
|
|
4395
|
+
readonly params: unknown[];
|
|
4396
|
+
readonly sql: string;
|
|
4397
|
+
}
|
|
4398
|
+
/** What a statement's provider dispatch publishes, after transform and acquisition. */
|
|
4399
|
+
interface StatementExecution {
|
|
4400
|
+
readonly context: QueryExecutionContext;
|
|
4401
|
+
readonly sql: string;
|
|
4402
|
+
/** The one pre-dispatch parameter snapshot, or empty when nothing discloses it. */
|
|
4403
|
+
readonly params: unknown[];
|
|
4404
|
+
readonly forceErrorContext: boolean;
|
|
4405
|
+
/** Native batch: each member's own context, SQL and parameters. */
|
|
4406
|
+
readonly members?: readonly StatementMember[];
|
|
4407
|
+
}
|
|
4408
|
+
type LifecycleBoundary = "connect" | "disconnect" | "savepoint" | "transaction";
|
|
4409
|
+
//#endregion
|
|
4301
4410
|
//#region src/cache/schema.d.ts
|
|
4302
4411
|
type CacheInvalidationSchemaEntries = {
|
|
4303
4412
|
invalidate: V$1.String<{
|
|
@@ -4639,7 +4748,7 @@ interface ExtensionResultConsumerState {
|
|
|
4639
4748
|
readonly [extensionResultConsumerState]: true;
|
|
4640
4749
|
}
|
|
4641
4750
|
/** The only static facts accumulated while extensions are chained. */
|
|
4642
|
-
interface ClientExtensionState<ClientMethods extends object = NoMethods, ModelMethods extends object = NoMethods, CacheState extends ExtensionCacheState | undefined = undefined, ResultConsumerState extends ExtensionResultConsumerState | undefined = undefined, Controls$1 extends object = NoControls, RowModels extends string = never, Data = never> {
|
|
4751
|
+
interface ClientExtensionState<ClientMethods extends object = NoMethods, ModelMethods extends object = NoMethods, CacheState extends ExtensionCacheState | undefined = undefined, ResultConsumerState extends ExtensionResultConsumerState | undefined = undefined, Controls$1 extends object = NoControls, RowModels extends string = never, Data$1 = never> {
|
|
4643
4752
|
readonly client: ClientMethods;
|
|
4644
4753
|
readonly models: ModelMethods;
|
|
4645
4754
|
readonly cache: CacheState;
|
|
@@ -4649,7 +4758,7 @@ interface ClientExtensionState<ClientMethods extends object = NoMethods, ModelMe
|
|
|
4649
4758
|
/** The models the chain's `rows` can hide from a relation read. */
|
|
4650
4759
|
readonly rows: RowModels;
|
|
4651
4760
|
/** The fields the chain's `data` writes, which a caller no longer writes. */
|
|
4652
|
-
readonly data: Data;
|
|
4761
|
+
readonly data: Data$1;
|
|
4653
4762
|
}
|
|
4654
4763
|
type EmptyClientExtensionState = ClientExtensionState;
|
|
4655
4764
|
/** Internal constraint for either the absent or enabled nominal cache bit. */
|
|
@@ -4735,14 +4844,14 @@ type ResultConsumerContextOf<Definition$1> = Definition$1 extends {
|
|
|
4735
4844
|
readonly query: infer Query;
|
|
4736
4845
|
} ? Query extends CallableFunction ? "result-independent" : "result-consuming" : "result-independent";
|
|
4737
4846
|
/** Incoming facts keep their nominal bit derivation inside this named state. */
|
|
4738
|
-
interface ExtensionContributionState<ClientMethods extends object, ModelMethods extends object, Controls$1 extends object, RowModels extends string, Data, ConsumerContext extends string> extends ExtensionStateConstraint {
|
|
4847
|
+
interface ExtensionContributionState<ClientMethods extends object, ModelMethods extends object, Controls$1 extends object, RowModels extends string, Data$1, ConsumerContext extends string> extends ExtensionStateConstraint {
|
|
4739
4848
|
readonly client: ClientMethods;
|
|
4740
4849
|
readonly models: ModelMethods;
|
|
4741
4850
|
readonly cache: undefined;
|
|
4742
4851
|
readonly resultConsumer: ConsumerContext extends "result-consuming" ? ExtensionResultConsumerState : undefined;
|
|
4743
4852
|
readonly controls: Controls$1;
|
|
4744
4853
|
readonly rows: RowModels;
|
|
4745
|
-
readonly data: Data;
|
|
4854
|
+
readonly data: Data$1;
|
|
4746
4855
|
}
|
|
4747
4856
|
/** Retain contribution facts, never the factory's contextual argument surface. */
|
|
4748
4857
|
type ExtensionStateContributionOf<Definition$1> = [Definition$1] extends [unknown] ? ExtensionContributionState<ClientMethodsOf<Definition$1>, ModelMethodsOf<Definition$1>, DefinitionControls<Definition$1>, RowsModels<Definition$1>, DefinitionData<Definition$1>, ResultConsumerContextOf<Definition$1>> : never;
|
|
@@ -5070,7 +5179,7 @@ type DefinitionData<Definition$1> = Definition$1 extends {
|
|
|
5070
5179
|
};
|
|
5071
5180
|
} ? string extends keyof Models ? never : { [Model in keyof Models]: CreateStamps<Model, Models[Model]> }[keyof Models] : never;
|
|
5072
5181
|
/** The fields a chain writes on every create of one model. */
|
|
5073
|
-
type StampedFieldNames<Data, ModelName$1> = Data extends StampedFields<infer Models, infer Fields extends PropertyKey> ? ModelName$1 extends Models ? Fields : never : never;
|
|
5182
|
+
type StampedFieldNames<Data$1, ModelName$1> = Data$1 extends StampedFields<infer Models, infer Fields extends PropertyKey> ? ModelName$1 extends Models ? Fields : never : never;
|
|
5074
5183
|
/**
|
|
5075
5184
|
* The controls one call admitted, by name. A `rows` control is resolved to its
|
|
5076
5185
|
* mode, so an absent one reads as its default; an absent plain control is not
|
|
@@ -5080,6 +5189,7 @@ type AdmittedControls = Readonly<Record<string, unknown>>;
|
|
|
5080
5189
|
//#endregion
|
|
5081
5190
|
//#region src/extensions/query.d.ts
|
|
5082
5191
|
type QueryInterceptionMode = "direct" | "transaction" | "array";
|
|
5192
|
+
type RawQueryKind = "queryRaw" | "executeRaw" | "queryRawUnsafe" | "executeRawUnsafe";
|
|
5083
5193
|
type WriteOutcome = Readonly<{
|
|
5084
5194
|
certainty: "committed" | "may-have-committed";
|
|
5085
5195
|
}>;
|
|
@@ -5097,23 +5207,11 @@ type GenericModelQueryContext<Result> = GenericQueryContextBase<Result> & {
|
|
|
5097
5207
|
/** The call's controls this handler's extension declares, and only those. */
|
|
5098
5208
|
readonly controls?: AdmittedControls;
|
|
5099
5209
|
};
|
|
5100
|
-
type GenericRawQueryContext<Result> = GenericQueryContextBase<Result> &
|
|
5101
|
-
readonly kind:
|
|
5102
|
-
readonly model: undefined;
|
|
5103
|
-
readonly operation: "$queryRaw";
|
|
5104
|
-
} | {
|
|
5105
|
-
readonly kind: "executeRaw";
|
|
5106
|
-
readonly model: undefined;
|
|
5107
|
-
readonly operation: "$executeRaw";
|
|
5108
|
-
} | {
|
|
5109
|
-
readonly kind: "queryRawUnsafe";
|
|
5210
|
+
type GenericRawQueryContext<Result> = GenericQueryContextBase<Result> & { [Kind in RawQueryKind]: {
|
|
5211
|
+
readonly kind: Kind;
|
|
5110
5212
|
readonly model: undefined;
|
|
5111
|
-
readonly operation:
|
|
5112
|
-
}
|
|
5113
|
-
readonly kind: "executeRawUnsafe";
|
|
5114
|
-
readonly model: undefined;
|
|
5115
|
-
readonly operation: "$executeRawUnsafe";
|
|
5116
|
-
});
|
|
5213
|
+
readonly operation: `$${Kind}`;
|
|
5214
|
+
} }[RawQueryKind];
|
|
5117
5215
|
type GenericQueryContext<Result> = GenericModelQueryContext<Result> | GenericRawQueryContext<Result>;
|
|
5118
5216
|
type GenericQueryHandlerCall = <Result>(context: GenericQueryContext<Result>) => Promise<Result>;
|
|
5119
5217
|
declare const officialQueryHandlerIdentity: unique symbol;
|
|
@@ -5169,80 +5267,6 @@ type OfficialCacheExtension = {
|
|
|
5169
5267
|
readonly controls: OfficialCacheControls;
|
|
5170
5268
|
};
|
|
5171
5269
|
//#endregion
|
|
5172
|
-
//#region src/drivers/shared/transaction-options.d.ts
|
|
5173
|
-
/** Prisma's isolation-level spellings, exactly. */
|
|
5174
|
-
declare const TRANSACTION_ISOLATION_LEVELS: readonly ["ReadUncommitted", "ReadCommitted", "RepeatableRead", "Serializable"];
|
|
5175
|
-
type TransactionIsolationLevel = (typeof TRANSACTION_ISOLATION_LEVELS)[number];
|
|
5176
|
-
/** Options accepted by the interactive (callback) `$transaction` form. */
|
|
5177
|
-
interface TransactionOptions {
|
|
5178
|
-
/** Isolation level for the transaction. */
|
|
5179
|
-
isolationLevel?: TransactionIsolationLevel;
|
|
5180
|
-
/** Milliseconds the callback body may run before rollback. */
|
|
5181
|
-
timeout?: number;
|
|
5182
|
-
/** Milliseconds to wait for a transaction slot before giving up. */
|
|
5183
|
-
maxWait?: number;
|
|
5184
|
-
}
|
|
5185
|
-
/**
|
|
5186
|
-
* Options accepted by the sequential (array) `$transaction` form. Prisma's
|
|
5187
|
-
* sequential API takes `isolationLevel` only: an array has no interactive
|
|
5188
|
-
* window for `timeout` to bound, so neither client offers it there.
|
|
5189
|
-
*/
|
|
5190
|
-
interface BatchTransactionOptions {
|
|
5191
|
-
isolationLevel?: TransactionIsolationLevel;
|
|
5192
|
-
}
|
|
5193
|
-
/** Where a driver must emit `SET TRANSACTION ISOLATION LEVEL`, if anywhere. */
|
|
5194
|
-
type IsolationLevelPlacement = /** PostgreSQL family: first statement *inside* the open transaction. */
|
|
5195
|
-
"provider" | "post-begin"
|
|
5196
|
-
/** MySQL family: on the transaction's own connection *before* BEGIN. */ | "pre-begin"
|
|
5197
|
-
/** SQLite family: serializable by construction; nothing to emit. */ | "serializable-only"
|
|
5198
|
-
/** No transaction is opened, so there is nothing to configure. */ | "unsupported";
|
|
5199
|
-
/** How a driver can bound the wait for a transaction slot. */
|
|
5200
|
-
type MaxWaitSupport = /** The driver serializes transactions through a queue we can bound. */
|
|
5201
|
-
"queue"
|
|
5202
|
-
/** The driver acquires a pooled connection it can abandon and release. */ | "acquisition"
|
|
5203
|
-
/** No wait we own, or no wait at all. */ | "unsupported";
|
|
5204
|
-
/**
|
|
5205
|
-
* A driver's honest answer for each option. Every advertised driver declares
|
|
5206
|
-
* one; `tests/drivers/transaction-portability.test.ts` pins every cell.
|
|
5207
|
-
*/
|
|
5208
|
-
interface TransactionOptionSupport {
|
|
5209
|
-
readonly isolationLevel: IsolationLevelPlacement;
|
|
5210
|
-
/**
|
|
5211
|
-
* Why this driver cannot honor the levels it refuses. Required whenever
|
|
5212
|
-
* `isolationLevel` is not `"post-begin"` or `"pre-begin"`, so a refusal
|
|
5213
|
-
* always names its reason instead of just saying "no".
|
|
5214
|
-
*/
|
|
5215
|
-
readonly isolationLevelReason?: string;
|
|
5216
|
-
/** Whether the callback body can be raced against a timer and rolled back. */
|
|
5217
|
-
readonly timeout: boolean;
|
|
5218
|
-
/** Why `timeout` cannot be honored. Required when `timeout` is false. */
|
|
5219
|
-
readonly timeoutReason?: string;
|
|
5220
|
-
readonly maxWait: MaxWaitSupport;
|
|
5221
|
-
/** Why `maxWait` cannot be honored. Required when `maxWait` is unsupported. */
|
|
5222
|
-
readonly maxWaitReason?: string;
|
|
5223
|
-
}
|
|
5224
|
-
/** The `$transaction` form the options were passed to. */
|
|
5225
|
-
type TransactionForm = "callback" | "batch";
|
|
5226
|
-
/** What the driver layer must act on. `timeout` never reaches a driver. */
|
|
5227
|
-
interface DriverTransactionOptions {
|
|
5228
|
-
/** Set only when the driver's placement is `"pre-begin"`. */
|
|
5229
|
-
readonly isolationLevel?: TransactionIsolationLevel;
|
|
5230
|
-
/** Set only when the driver's max-wait mode is `"acquisition"`. */
|
|
5231
|
-
readonly maxWaitMs?: number;
|
|
5232
|
-
}
|
|
5233
|
-
/** The honored shape of a validated, driver-accepted options object. */
|
|
5234
|
-
interface TransactionPlan {
|
|
5235
|
-
readonly isolationLevel?: TransactionIsolationLevel;
|
|
5236
|
-
/** `SET TRANSACTION ISOLATION LEVEL ...`, when the driver emits SQL. */
|
|
5237
|
-
readonly isolationStatement?: string;
|
|
5238
|
-
readonly isolationPlacement: IsolationLevelPlacement;
|
|
5239
|
-
readonly timeoutMs?: number;
|
|
5240
|
-
readonly maxWaitMs?: number;
|
|
5241
|
-
readonly maxWaitMode: MaxWaitSupport;
|
|
5242
|
-
/** The subset the driver's own `transaction()` must act on. */
|
|
5243
|
-
readonly driverOptions?: DriverTransactionOptions;
|
|
5244
|
-
}
|
|
5245
|
-
//#endregion
|
|
5246
5270
|
//#region src/client/omit.d.ts
|
|
5247
5271
|
/** Fields a client hides by default, per model key of the schema. */
|
|
5248
5272
|
type ClientOmitConfig<S$1 extends Record<string, AnyModel>> = { [K in keyof S$1]?: ClientModelOmit<S$1[K]> };
|
|
@@ -5371,11 +5395,13 @@ type NoExtraDriverConfigKeys<Given, Options$1, S$1 extends Schema$1> = Record<Ex
|
|
|
5371
5395
|
*/
|
|
5372
5396
|
type TransactionClient<C$1 extends VibORMConfig, X$1 extends ExtensionStateConstraint = EmptyClientExtensionState> = ExtensionModelClient<C$1, X$1> & RawSurface & {
|
|
5373
5397
|
readonly $schema: ClientSchema<C$1>;
|
|
5374
|
-
$transaction:
|
|
5375
|
-
<T$1>(fn: (tx: TransactionClient<C$1, X$1>) => PromiseLike<T$1>, options?: TransactionOptions): Promise<T$1>;
|
|
5376
|
-
<T$1 extends BatchTransactionOperation<unknown>[]>(operations: [...T$1], options?: BatchTransactionOptions): Promise<{ [K in keyof T$1]: Awaited<T$1[K]> }>;
|
|
5377
|
-
};
|
|
5398
|
+
$transaction: TransactionMethod<C$1, X$1>;
|
|
5378
5399
|
} & X$1["client"];
|
|
5400
|
+
/** `$transaction`'s two forms: an interactive callback, or a batch array. */
|
|
5401
|
+
type TransactionMethod<C$1 extends VibORMConfig, X$1 extends ExtensionStateConstraint> = {
|
|
5402
|
+
<T$1>(fn: (tx: TransactionClient<C$1, X$1>) => PromiseLike<T$1>, options?: TransactionOptions): Promise<T$1>;
|
|
5403
|
+
<T$1 extends BatchTransactionOperation<unknown>[]>(operations: [...T$1], options?: BatchTransactionOptions): Promise<{ [K in keyof T$1]: Awaited<T$1[K]> }>;
|
|
5404
|
+
};
|
|
5379
5405
|
/**
|
|
5380
5406
|
* Extended client type with utility methods
|
|
5381
5407
|
*/
|
|
@@ -5428,10 +5454,7 @@ interface VibORMClientMembers<C$1 extends VibORMConfig, X$1 extends ExtensionSta
|
|
|
5428
5454
|
* The array form takes `isolationLevel` only: a preplanned array has no
|
|
5429
5455
|
* interactive window for `timeout` or `maxWait` to bound.
|
|
5430
5456
|
*/
|
|
5431
|
-
$transaction:
|
|
5432
|
-
<T$1>(fn: (tx: TransactionClient<C$1, X$1>) => PromiseLike<T$1>, options?: TransactionOptions): Promise<T$1>;
|
|
5433
|
-
<T$1 extends BatchTransactionOperation<unknown>[]>(operations: [...T$1], options?: BatchTransactionOptions): Promise<{ [K in keyof T$1]: Awaited<T$1[K]> }>;
|
|
5434
|
-
};
|
|
5457
|
+
$transaction: TransactionMethod<C$1, X$1>;
|
|
5435
5458
|
/** Connect to the database */
|
|
5436
5459
|
$connect: () => Promise<void>;
|
|
5437
5460
|
/** Disconnect from the database */
|
|
@@ -6605,9 +6628,9 @@ type GenerationChoice<State$1 extends ScalarState<"string">, Given> = Given exte
|
|
|
6605
6628
|
generate: infer Choice extends boolean | undefined;
|
|
6606
6629
|
} ? Choice : undefined;
|
|
6607
6630
|
type HasCustomDefault<State$1 extends ScalarState<"string">> = State$1["default"] extends GeneratorDefaultBrand ? false : State$1["hasDefault"];
|
|
6608
|
-
type FormatState<State$1 extends ScalarState<"string">, Given, Kind extends IdentifierKind = IdentifierKind> = {
|
|
6631
|
+
type FormatState<State$1 extends ScalarState<"string">, Given, Kind$1 extends IdentifierKind = IdentifierKind> = {
|
|
6609
6632
|
autoGenerate: AutoGenerate & {
|
|
6610
|
-
kind: Kind;
|
|
6633
|
+
kind: Kind$1;
|
|
6611
6634
|
implicit?: undefined;
|
|
6612
6635
|
generate: GenerationChoice<State$1, Given>;
|
|
6613
6636
|
};
|
|
@@ -6931,15 +6954,15 @@ type VectorSortOrderSchema = typeof vectorSortOrderSchema;
|
|
|
6931
6954
|
type ModelStateOf$7<M$1 extends AnyModel> = M$1["~"]["state"];
|
|
6932
6955
|
type ModelScalars$2<M$1 extends AnyModel> = ModelStateOf$7<M$1>["scalars"];
|
|
6933
6956
|
type ModelScalarKey<M$1 extends AnyModel> = StringKeyOf<ModelScalars$2<M$1>>;
|
|
6934
|
-
type ScalarStateOf$
|
|
6957
|
+
type ScalarStateOf$3<F$1> = F$1 extends {
|
|
6935
6958
|
"~": {
|
|
6936
6959
|
state: infer S;
|
|
6937
6960
|
};
|
|
6938
6961
|
} ? S extends ScalarState ? S : never : never;
|
|
6939
6962
|
type ModelDecimalListScalarKeys<M$1 extends AnyModel> = Extract<DecimalListScalarKeys<ModelScalars$2<M$1>>, ModelScalarKey<M$1>>;
|
|
6940
6963
|
type OrderableScalarKeys<M$1 extends AnyModel> = Exclude<ModelScalarKey<M$1>, ModelDecimalListScalarKeys<M$1> | PointScalarKeys$2<M$1>>;
|
|
6941
|
-
type VectorScalarKeys$1<M$1 extends AnyModel> = { [K in keyof ModelScalars$2<M$1>]: ScalarStateOf$
|
|
6942
|
-
type PointScalarKeys$2<M$1 extends AnyModel> = { [K in keyof ModelScalars$2<M$1>]: ScalarStateOf$
|
|
6964
|
+
type VectorScalarKeys$1<M$1 extends AnyModel> = { [K in keyof ModelScalars$2<M$1>]: ScalarStateOf$3<ModelScalars$2<M$1>[K]>["type"] extends "vector" ? K extends string ? K : never : never }[keyof ModelScalars$2<M$1>];
|
|
6965
|
+
type PointScalarKeys$2<M$1 extends AnyModel> = { [K in keyof ModelScalars$2<M$1>]: ScalarStateOf$3<ModelScalars$2<M$1>[K]>["type"] extends "point" ? K extends string ? K : never : never }[keyof ModelScalars$2<M$1>];
|
|
6943
6966
|
type NonVectorScalarKeys<M$1 extends AnyModel> = Exclude<OrderableScalarKeys<M$1>, VectorScalarKeys$1<M$1>>;
|
|
6944
6967
|
/** A decimal list has equality semantics, but no portable numeric ordering. */
|
|
6945
6968
|
|
|
@@ -6958,12 +6981,12 @@ type OrderBySchema<M$1 extends AnyModel, F$1 extends ScalarSchemas<M$1>> = V$1.O
|
|
|
6958
6981
|
type ModelStateOf$6<M$1 extends AnyModel> = M$1["~"]["state"];
|
|
6959
6982
|
type ModelScalars$1<M$1 extends AnyModel> = ModelStateOf$6<M$1>["scalars"];
|
|
6960
6983
|
type ModelDecimalListScalarKey<M$1 extends AnyModel> = DecimalListScalarKeys<ModelScalars$1<M$1>>;
|
|
6961
|
-
type ScalarStateOf$
|
|
6984
|
+
type ScalarStateOf$2<F$1> = F$1 extends {
|
|
6962
6985
|
"~": {
|
|
6963
6986
|
state: infer S;
|
|
6964
6987
|
};
|
|
6965
6988
|
} ? S extends ScalarState ? S : never : never;
|
|
6966
|
-
type VectorScalarKey<M$1 extends AnyModel> = { [K in keyof ModelScalars$1<M$1>]: ScalarStateOf$
|
|
6989
|
+
type VectorScalarKey<M$1 extends AnyModel> = { [K in keyof ModelScalars$1<M$1>]: ScalarStateOf$2<ModelScalars$1<M$1>[K]>["type"] extends "vector" ? K extends string ? K : never : never }[keyof ModelScalars$1<M$1>];
|
|
6967
6990
|
type NonVectorScalarKey<M$1 extends AnyModel> = Exclude<OrderableScalarKeys<M$1>, VectorScalarKey<M$1>>;
|
|
6968
6991
|
type ModelScalarOrderByEntries<M$1 extends AnyModel> = V$1.FromKeys<NonVectorScalarKey<M$1>[], SortOrderSchema>["entries"] & V$1.FromKeys<VectorScalarKey<M$1>[], VectorSortOrderSchema>["entries"] & V$1.FromKeys<ModelDecimalListScalarKey<M$1>[], DecimalListOrderByRefusalSchema>["entries"];
|
|
6969
6992
|
/**
|
|
@@ -8355,9 +8378,16 @@ type JsonUpdateSchema<F$1 extends ScalarState<"json">, S$1 extends V$1.Schema> =
|
|
|
8355
8378
|
}>, V$1.Coerce<JsonWriteOperand<F$1, S$1>, {
|
|
8356
8379
|
set: JsonWriteOperand<F$1, S$1>[" vibInferred"]["1"];
|
|
8357
8380
|
}>]>;
|
|
8381
|
+
/**
|
|
8382
|
+
* The create schema reads the same envelope (see {@link isSetEnvelope}), so it
|
|
8383
|
+
* takes what an update takes and yields the value it stores.
|
|
8384
|
+
*/
|
|
8385
|
+
type JsonCreateSchema<F$1 extends ScalarState<"json">, S$1 extends V$1.Schema> = VibSchema<V$1.Input<JsonWriteOperand<F$1, S$1>> | {
|
|
8386
|
+
set: Exclude<V$1.Input<JsonWriteOperand<F$1, S$1>>, undefined>;
|
|
8387
|
+
}, V$1.Output<JsonWriteOperand<F$1, S$1>>>;
|
|
8358
8388
|
interface JsonSchemas<F$1 extends ScalarState<"json">> {
|
|
8359
8389
|
base: F$1["base"];
|
|
8360
|
-
create:
|
|
8390
|
+
create: JsonCreateSchema<F$1, V$1.Json<F$1>>;
|
|
8361
8391
|
update: JsonUpdateSchema<F$1, F$1["base"]>;
|
|
8362
8392
|
filter: JsonFilterSchema<V$1.Json>;
|
|
8363
8393
|
}
|
|
@@ -8711,13 +8741,13 @@ type ProjectableScalarKeys<M$1 extends AnyModel> = Exclude<StringKeyOf<ModelStat
|
|
|
8711
8741
|
*/
|
|
8712
8742
|
type ModelStateOf$2<M$1 extends AnyModel> = M$1["~"]["state"];
|
|
8713
8743
|
type ModelScalars<M$1 extends AnyModel> = ModelStateOf$2<M$1>["scalars"];
|
|
8714
|
-
type ScalarStateOf<F$1> = F$1 extends {
|
|
8744
|
+
type ScalarStateOf$1<F$1> = F$1 extends {
|
|
8715
8745
|
"~": {
|
|
8716
8746
|
state: infer S;
|
|
8717
8747
|
};
|
|
8718
8748
|
} ? S extends ScalarState ? S : never : never;
|
|
8719
|
-
type AnyVectorScalarKeys<M$1 extends AnyModel> = { [K in keyof ModelScalars<M$1>]: ScalarStateOf<ModelScalars<M$1>[K]>["type"] extends "vector" ? K extends string ? K : never : never }[keyof ModelScalars<M$1>];
|
|
8720
|
-
type AnyPointScalarKeys<M$1 extends AnyModel> = { [K in keyof ModelScalars<M$1>]: ScalarStateOf<ModelScalars<M$1>[K]>["type"] extends "point" ? K extends string ? K : never : never }[keyof ModelScalars<M$1>];
|
|
8749
|
+
type AnyVectorScalarKeys<M$1 extends AnyModel> = { [K in keyof ModelScalars<M$1>]: ScalarStateOf$1<ModelScalars<M$1>[K]>["type"] extends "vector" ? K extends string ? K : never : never }[keyof ModelScalars<M$1>];
|
|
8750
|
+
type AnyPointScalarKeys<M$1 extends AnyModel> = { [K in keyof ModelScalars<M$1>]: ScalarStateOf$1<ModelScalars<M$1>[K]>["type"] extends "point" ? K extends string ? K : never : never }[keyof ModelScalars<M$1>];
|
|
8721
8751
|
/**
|
|
8722
8752
|
* Both halves of the select schema are keyed on {@link ProjectableScalarKeys},
|
|
8723
8753
|
* so a model-level `.omit()`-ed scalar has no `select` entry at all: naming it
|
|
@@ -8878,9 +8908,20 @@ declare const pointScalarSelectSchema: UnionSchema<readonly [BooleanSchema<boole
|
|
|
8878
8908
|
}>>;
|
|
8879
8909
|
}>>;
|
|
8880
8910
|
type PointScalarSelectSchema = typeof pointScalarSelectSchema;
|
|
8911
|
+
/**
|
|
8912
|
+
* A written `select` names what the row carries, so one that names nothing
|
|
8913
|
+
* (`{}`, only `false`, or a `_count` that counts no relation, as `_count: true`
|
|
8914
|
+
* does on a model with no to-many relation) is a caller mistake, refused at its
|
|
8915
|
+
* own path. Leaving `select` out is how a caller asks for the default row.
|
|
8916
|
+
*/
|
|
8917
|
+
declare const requireSelectedField: (select: Record<string, unknown>) => string | undefined;
|
|
8918
|
+
/** The refusal every written `select` carries ({@link requireSelectedField}). */
|
|
8919
|
+
type SelectRefusal = {
|
|
8920
|
+
readonly refuse: typeof requireSelectedField;
|
|
8921
|
+
};
|
|
8881
8922
|
type SelectSchema<M$1 extends AnyModel, F$1 extends ScalarSchemas<M$1>> = V$1.Object<V$1.FromKeys<PlainScalarKeys<M$1>[], typeof scalarSelectSchema>["entries"] & V$1.FromKeys<VectorScalarKeys<M$1>[], VectorScalarSelectSchema>["entries"] & V$1.FromKeys<PointScalarKeys$1<M$1>[], PointScalarSelectSchema>["entries"] & V$1.FromObject<F$1["relations"], "select">["entries"] & V$1.FromObject<F$1["polymorphic"], "select">["entries"] & {
|
|
8882
8923
|
_count: CountSchema<F$1>;
|
|
8883
|
-
}>;
|
|
8924
|
+
}, SelectRefusal>;
|
|
8884
8925
|
/**
|
|
8885
8926
|
* The SCALAR-ONLY projection: {@link SelectSchema} without relation keys and
|
|
8886
8927
|
* without `_count`.
|
|
@@ -8902,7 +8943,7 @@ type SelectSchema<M$1 extends AnyModel, F$1 extends ScalarSchemas<M$1>> = V$1.Ob
|
|
|
8902
8943
|
* `<Model>SelectCreateManyAndReturn` / `<Model>IncludeCreateManyAndReturn` types
|
|
8903
8944
|
* (prisma 6.8.2, `prisma-client/generator-build`, `Model.argsTypes`).
|
|
8904
8945
|
*/
|
|
8905
|
-
type ScalarSelectSchema<M$1 extends AnyModel> = V$1.Object<V$1.FromKeys<PlainScalarKeys<M$1>[], typeof scalarSelectSchema>["entries"] & V$1.FromKeys<VectorScalarKeys<M$1>[], VectorScalarSelectSchema>["entries"] & V$1.FromKeys<PointScalarKeys$1<M$1>[], PointScalarSelectSchema>["entries"]>;
|
|
8946
|
+
type ScalarSelectSchema<M$1 extends AnyModel> = V$1.Object<V$1.FromKeys<PlainScalarKeys<M$1>[], typeof scalarSelectSchema>["entries"] & V$1.FromKeys<VectorScalarKeys<M$1>[], VectorScalarSelectSchema>["entries"] & V$1.FromKeys<PointScalarKeys$1<M$1>[], PointScalarSelectSchema>["entries"], SelectRefusal>;
|
|
8906
8947
|
/**
|
|
8907
8948
|
* Build include schema - nested include for each relation
|
|
8908
8949
|
*/
|
|
@@ -9986,7 +10027,8 @@ type SingularFieldTree<M$1> = M$1 extends {
|
|
|
9986
10027
|
} ? { [V in keyof Entries]: Entries[V] extends {
|
|
9987
10028
|
readonly getter: () => infer Next;
|
|
9988
10029
|
} ? SingularFieldTree<Next> : never } : never : true } : never;
|
|
9989
|
-
type
|
|
10030
|
+
type TreeEntries<S$1> = { [J in keyof S$1]-?: [SingularFieldTree<S$1[J]>, J] }[keyof S$1];
|
|
10031
|
+
type SchemaKeyOf<S$1, T$1> = Extract<TreeEntries<S$1>, [SingularFieldTree<T$1>, unknown]> extends infer Hit ? Hit extends [infer Tree, infer J extends keyof S$1] ? [SingularFieldTree<T$1>] extends [Tree] ? IsIdentical<S$1[J], T$1> extends true ? J : never : never : never : never;
|
|
9990
10032
|
type TargetLinks<S$1, Target$1> = Target$1 extends {
|
|
9991
10033
|
readonly kind: "model";
|
|
9992
10034
|
readonly getter: infer G;
|
|
@@ -9997,29 +10039,43 @@ type TargetLinks<S$1, Target$1> = Target$1 extends {
|
|
|
9997
10039
|
readonly getter: infer G;
|
|
9998
10040
|
} ? G extends (() => infer M) ? SchemaKeyOf<S$1, M> : never : never } : never;
|
|
9999
10041
|
/** Resolve while the producer still owns the exact getter types. */
|
|
10000
|
-
type RelationLinks<S$1 extends Schema$1> = { [K in keyof S$1]: { [R in keyof S$1[K]["~"]["state"]["relations"]]: TargetLinks<S$1, S$1[K]["~"]["state"]["relations"][R]["~"]["state"]["target"]> } }
|
|
10042
|
+
type RelationLinks<S$1 extends Schema$1> = { [K in keyof S$1]: { [R in keyof S$1[K]["~"]["state"]["relations"]]: TargetLinks<S$1, S$1[K]["~"]["state"]["relations"][R]["~"]["state"]["target"]> } };
|
|
10001
10043
|
type LinkAt<L$1, K$1, R$1> = K$1 extends keyof L$1 ? R$1 extends keyof L$1[K$1] ? L$1[K$1][R$1] : never : never;
|
|
10002
10044
|
type VariantLink<T$1, V$2> = V$2 extends keyof T$1 ? T$1[V$2] : never;
|
|
10003
10045
|
/** Clone every state fact inline; no alias retains the original recursive shape. */
|
|
10004
|
-
type FlatSchema<S$1 extends Schema$1, L$1> = { [K in keyof S$1]: S$1[K] extends Model$1<infer State> ? Model$1<{ [P in keyof State]: P extends "shape" | "relations" ? { [F in keyof State[P]]: State[P][F] extends AnyRelation ? State[P][F]["~"]["state"] extends infer RS extends RelationState ? RS extends ModelToOneState ? ModelToOneRelation<{ [Q in keyof RS]: Q extends "target" ? [LinkAt<L$1, K, F>] extends [never] ? RS[Q]
|
|
10046
|
+
type FlatSchema<S$1 extends Schema$1, L$1> = { [K in keyof S$1]: S$1[K] extends Model$1<infer State> ? Model$1<{ [P in keyof State]: P extends "shape" | "relations" ? { [F in keyof State[P]]: State[P][F] extends AnyRelation ? State[P][F]["~"]["state"] extends infer RS extends RelationState ? RS extends ModelToOneState ? ModelToOneRelation<{ [Q in keyof RS]: Q extends "target" ? { [T in keyof RS[Q]]: T extends "getter" ? [LinkAt<L$1, K, F>] extends [never] ? RS[Q][T] : unknown : RS[Q][T] } : RS[Q] }> : RS extends ModelToManyState ? ModelToManyRelation<{ [Q in keyof RS]: Q extends "target" ? { [T in keyof RS[Q]]: T extends "getter" ? [LinkAt<L$1, K, F>] extends [never] ? RS[Q][T] : unknown : RS[Q][T] } : RS[Q] }> : RS extends VariantToOneState ? VariantToOneRelation<{ [Q in keyof RS]: Q extends "target" ? RS[Q] extends {
|
|
10005
10047
|
readonly entries: infer Entries;
|
|
10006
10048
|
} ? { [T in keyof RS[Q]]: T extends "entries" ? { [V in keyof Entries]: { [E in keyof Entries[V]]: E extends "getter" ? [VariantLink<LinkAt<L$1, K, F>, V>] extends [never] ? Entries[V][E] : unknown : Entries[V][E] } } : RS[Q][T] } : RS[Q] : RS[Q] }> : RS extends VariantToManyState ? VariantToManyRelation<{ [Q in keyof RS]: Q extends "target" ? RS[Q] extends {
|
|
10007
10049
|
readonly entries: infer Entries;
|
|
10008
10050
|
} ? { [T in keyof RS[Q]]: T extends "entries" ? { [V in keyof Entries]: { [E in keyof Entries[V]]: E extends "getter" ? [VariantLink<LinkAt<L$1, K, F>, V>] extends [never] ? Entries[V][E] : unknown : Entries[V][E] } } : RS[Q][T] } : RS[Q] : RS[Q] }> : State[P][F] : State[P][F] : State[P][F] } : P extends "scalars" | "uniques" ? { [F in keyof State[P]]: State[P][F] } : P extends "compoundId" | "compoundUniques" ? State[P] extends infer Constraints extends State[P] ? Constraints extends object ? { [F in keyof Constraints]: Constraints[F] extends ObjectSchema<infer Entries, infer Options, infer Input, infer Output> ? ObjectSchema<{ [E in keyof Entries]: Entries[E] }, Options, Input extends object ? { [E in keyof Input]: Input[E] } : Input, Output extends object ? { [E in keyof Output]: Output[E] } : Output> : Constraints[F] } : Constraints : never : State[P] }> : never };
|
|
10009
|
-
|
|
10051
|
+
/** One linked target; a union of twin keys answers a union of targets. */
|
|
10052
|
+
type LinkedTarget<S$1 extends Schema$1, L$1, J$1> = J$1 extends keyof S$1 ? Linked<S$1, L$1, J$1> : never;
|
|
10053
|
+
type RepointTarget<Target$1, S$1 extends Schema$1, L$1, K$1, F$1> = Target$1 extends {
|
|
10010
10054
|
readonly kind: "model";
|
|
10011
|
-
} ? [
|
|
10055
|
+
} ? { [P in keyof Target$1]: P extends "getter" ? Target$1[P] extends (() => unknown) ? Target$1[P] : () => LinkedTarget<S$1, L$1, LinkAt<L$1, K$1, F$1>> : Target$1[P] } : Target$1 extends {
|
|
10012
10056
|
readonly kind: "variants";
|
|
10013
10057
|
readonly entries: infer Entries;
|
|
10014
|
-
} ?
|
|
10015
|
-
type
|
|
10016
|
-
type
|
|
10017
|
-
|
|
10018
|
-
|
|
10058
|
+
} ? RepointVariants<Target$1, Entries, LinkAt<L$1, K$1, F$1>, S$1, L$1> : Target$1;
|
|
10059
|
+
type RepointVariants<Target$1, Entries$1, Link, S$1 extends Schema$1, L$1> = { [P in keyof Target$1]: P extends "entries" ? { [V in keyof Entries$1]: { [E in keyof Entries$1[V]]: E extends "getter" ? VariantLink<Link, V> extends infer J ? [J] extends [never] ? Entries$1[V][E] : J extends keyof S$1 ? () => Linked<S$1, L$1, J> : Entries$1[V][E] : Entries$1[V][E] : Entries$1[V][E] } } : Target$1[P] };
|
|
10060
|
+
type RepointState<State$1, S$1 extends Schema$1, L$1, K$1, F$1> = { [P in keyof State$1]: P extends "target" ? RepointTarget<State$1[P], S$1, L$1, K$1, F$1> : State$1[P] };
|
|
10061
|
+
type LinkedRelation<R$1, S$1 extends Schema$1, L$1, K$1, F$1> = R$1 extends {
|
|
10062
|
+
readonly "~": {
|
|
10063
|
+
readonly state: infer State;
|
|
10064
|
+
};
|
|
10065
|
+
} ? State extends SlotKind<"one", "model"> ? ModelToOneRelation<RepointState<State, S$1, L$1, K$1, F$1>> : State extends SlotKind<"many", "model"> ? ModelToManyRelation<RepointState<State, S$1, L$1, K$1, F$1>> : State extends SlotKind<"one", "variants"> ? VariantToOneRelation<RepointState<State, S$1, L$1, K$1, F$1>> : State extends SlotKind<"many", "variants"> ? VariantToManyRelation<RepointState<State, S$1, L$1, K$1, F$1>> : R$1 : R$1;
|
|
10066
|
+
type SlotKind<Cardinality$1, Kind$1> = {
|
|
10067
|
+
readonly kind: "relation";
|
|
10068
|
+
readonly cardinality: Cardinality$1;
|
|
10069
|
+
readonly target: {
|
|
10070
|
+
readonly kind: Kind$1;
|
|
10071
|
+
};
|
|
10072
|
+
};
|
|
10073
|
+
/** Relinking operates only on the already-flat schema and its literal links. */
|
|
10074
|
+
type LinkedState<S$1 extends Schema$1, L$1, K$1 extends keyof S$1> = S$1[K$1] extends Model$1<infer State> ? { [P in keyof State]: P extends "shape" | "relations" ? { [F in keyof State[P]]: LinkedRelation<State[P][F], S$1, L$1, K$1, F> } : State[P] } : never;
|
|
10019
10075
|
type Linked<S$1 extends Schema$1, L$1, K$1 extends keyof S$1> = Model$1<LinkedState<S$1, L$1, K$1>>;
|
|
10020
10076
|
type SchemaRelationKeys<S$1 extends Schema$1> = { [K in keyof S$1]: keyof S$1[K]["~"]["state"]["relations"] }[keyof S$1];
|
|
10021
10077
|
/** Only a finite schema with relations has getter facts to carry. */
|
|
10022
|
-
type SchemaLinks<S$1 extends Schema$1> = string extends keyof S$1 ? never : [SchemaRelationKeys<S$1>] extends [never] ? never : RelationLinks<S$1
|
|
10078
|
+
type SchemaLinks<S$1 extends Schema$1> = string extends keyof S$1 ? never : [SchemaRelationKeys<S$1>] extends [never] ? never : RelationLinks<S$1> extends infer U ? { [K in keyof U]: U[K] } : never;
|
|
10023
10079
|
type SchemaSnapshot<S$1 extends Schema$1, L$1> = { [K in keyof S$1]: [L$1] extends [never] ? S$1[K] : FlatSchema<S$1, L$1>[K] };
|
|
10024
10080
|
type SchemaModel<S$1 extends Schema$1, L$1, K$1 extends keyof S$1> = [L$1] extends [undefined] ? S$1[K$1] : Linked<S$1, L$1, K$1>;
|
|
10025
10081
|
/** Raw aliases and carried configs share the same schema-only model view. */
|
|
@@ -10653,6 +10709,9 @@ declare const defaultOperationResultArgs: unique symbol;
|
|
|
10653
10709
|
type DefaultOperationResultArgs = typeof defaultOperationResultArgs;
|
|
10654
10710
|
type ResolvedOperationResultArgs<Args, Merged> = Merged extends DefaultOperationResultArgs ? Args : Merged;
|
|
10655
10711
|
type ResolvedOperationResultOmit<Args, DefaultOmit, Merged> = Merged extends DefaultOperationResultArgs ? MergeClientOmit<DefaultOmit, NodeOmit<Args>> : NodeOmit<Merged>;
|
|
10712
|
+
/** The verbs whose result is the selected row, wrapped by cardinality. */
|
|
10713
|
+
type RowOperation = "findFirst" | "findUnique" | "findFirstOrThrow" | "findUniqueOrThrow" | "findMany" | "create" | "update" | "delete" | "upsert";
|
|
10714
|
+
type RowCardinality<O$1, Row> = O$1 extends "findFirst" | "findUnique" ? Row | null : O$1 extends "findMany" ? Row[] : Row;
|
|
10656
10715
|
/**
|
|
10657
10716
|
* Operation result type - infers result shape based on select/include args
|
|
10658
10717
|
* This provides full type safety for ORM operation results
|
|
@@ -10665,7 +10724,7 @@ type ResolvedOperationResultOmit<Args, DefaultOmit, Merged> = Merged extends Def
|
|
|
10665
10724
|
* The private merged-args marker distinguishes ordinary public arguments from
|
|
10666
10725
|
* the effective argument shape carried by one concrete client.
|
|
10667
10726
|
*/
|
|
10668
|
-
type OperationResultWithClientDefaults<O$1 extends Operations, M$1 extends Model$1<any>, Args, DefaultOmit, ClientDefaults, Merged = DefaultOperationResultArgs, ResultArgs = ResolvedOperationResultArgs<Args, Merged>, UnselectedOmit = ResolvedOperationResultOmit<Args, DefaultOmit, Merged>> = M$1 extends Model$1<infer S> ? O$1 extends
|
|
10727
|
+
type OperationResultWithClientDefaults<O$1 extends Operations, M$1 extends Model$1<any>, Args, DefaultOmit, ClientDefaults, Merged = DefaultOperationResultArgs, ResultArgs = ResolvedOperationResultArgs<Args, Merged>, UnselectedOmit = ResolvedOperationResultOmit<Args, DefaultOmit, Merged>> = M$1 extends Model$1<infer S> ? O$1 extends RowOperation ? RowCardinality<O$1, Prettify<InferSelectInclude<S, ResultArgs, NodeSelect<ResultArgs>, UnselectedOmit, ClientDefaults>>> : O$1 extends "createMany" | "updateMany" | "deleteMany" ? BulkWriteResult<S, Args, DefaultOmit> : O$1 extends "count" ? CountResultType<Args> : O$1 extends "exist" ? boolean : O$1 extends "aggregate" ? AggregateResultType<ExtractFields<M$1>, Args> : O$1 extends "groupBy" ? GroupByResultType<ExtractFields<M$1>, Args>[] : never : never;
|
|
10669
10728
|
/**
|
|
10670
10729
|
* Public operation result helper for one operation and its declared args.
|
|
10671
10730
|
* Schema-only: on a client whose extensions declare `rows`, a to-one relation
|
|
@@ -10696,7 +10755,7 @@ type StampedOperation = "create" | "createMany" | "update" | "updateMany" | "ups
|
|
|
10696
10755
|
* out, and a caller who writes one keeps its value (owner rulings, plan v4
|
|
10697
10756
|
* §7.5 and §7.1).
|
|
10698
10757
|
*/
|
|
10699
|
-
type StampedOperations<C$1 extends VibORMConfig, ClientDefaults, Controls$1, Data, K$1 extends keyof ClientSchema<C$1>> = { [O in StampedOperation]: Operation$1<O, ClientSchema<C$1>[K$1], ClientDefaultOmit<C$1, K$1>, ClientDefaults, PlacedOperationControls<Controls$1, K$1, O>, StampedPayload<O, OperationPayload<O, ClientSchema<C$1>[K$1]>, ClientSchema<C$1>[K$1], StampedFieldNames<Data, K$1>, Stamps<Data, ClientSchema<C$1>>>> };
|
|
10758
|
+
type StampedOperations<C$1 extends VibORMConfig, ClientDefaults, Controls$1, Data$1, K$1 extends keyof ClientSchema<C$1>> = { [O in StampedOperation]: Operation$1<O, ClientSchema<C$1>[K$1], ClientDefaultOmit<C$1, K$1>, ClientDefaults, PlacedOperationControls<Controls$1, K$1, O>, StampedPayload<O, OperationPayload<O, ClientSchema<C$1>[K$1]>, ClientSchema<C$1>[K$1], StampedFieldNames<Data$1, K$1>, Stamps<Data$1, ClientSchema<C$1>>>> };
|
|
10700
10759
|
/**
|
|
10701
10760
|
* The call's own clauses, rebuilt: a create's rows, and an update's for the
|
|
10702
10761
|
* creates they nest.
|
|
@@ -10705,8 +10764,8 @@ type StampedPayload<O$1, Payload, M$1, Fields$1 extends PropertyKey, Context> =
|
|
|
10705
10764
|
type CreateClause<O$1> = O$1 extends "upsert" ? "create" : O$1 extends "create" | "createMany" ? "data" : never;
|
|
10706
10765
|
type UpdateClause<O$1> = O$1 extends "upsert" ? "update" : O$1 extends "update" | "updateMany" ? "data" : never;
|
|
10707
10766
|
/** What a nested write needs to find the fields its target's stamps write. */
|
|
10708
|
-
interface Stamps<Data, S$1> {
|
|
10709
|
-
readonly data: Data;
|
|
10767
|
+
interface Stamps<Data$1, S$1> {
|
|
10768
|
+
readonly data: Data$1;
|
|
10710
10769
|
readonly schema: S$1;
|
|
10711
10770
|
}
|
|
10712
10771
|
/**
|
|
@@ -10767,7 +10826,7 @@ type SpelledClauseKeys<Given> = Given extends object ? Given extends readonly un
|
|
|
10767
10826
|
* The keys spelled inside an ARRAY clause that no element of the payload
|
|
10768
10827
|
* accepts — the array spelling's equivalent of the `Exclude` below.
|
|
10769
10828
|
*/
|
|
10770
|
-
type UnknownArrayClauseKeys<Given extends readonly unknown[], Allowed> = Exclude<SpelledClauseKeys<Given[number]>, ClauseKeys<NonNullable<Allowed>>>;
|
|
10829
|
+
type UnknownArrayClauseKeys<Given extends readonly unknown[], Allowed, Always extends PropertyKey> = Exclude<Exclude<SpelledClauseKeys<Given[number]>, Always>, ClauseKeys<NonNullable<Allowed>>>;
|
|
10771
10830
|
/**
|
|
10772
10831
|
* What the ARRAY spelling of a clause is refused WITH. The key cannot be
|
|
10773
10832
|
* reported on itself there (see `NoExtraClauseKeys`), so the clause as a whole
|
|
@@ -10805,7 +10864,7 @@ type UnknownClauseKey<K$1> = {
|
|
|
10805
10864
|
*
|
|
10806
10865
|
* `Given` arrives with `undefined`/`null` already stripped (see `ClauseGuard`).
|
|
10807
10866
|
*/
|
|
10808
|
-
type NoExtraClauseKeys<Given, Allowed> = Given extends readonly unknown[] ? [UnknownArrayClauseKeys<Given, Allowed>] extends [never] ? unknown : UnknownClauseKey<UnknownArrayClauseKeys<Given, Allowed>> : string extends keyof Given ? unknown : Given extends object ? Record<Exclude<keyof Given, ClauseKeys<NonNullable<Allowed>>>, never> : unknown;
|
|
10867
|
+
type NoExtraClauseKeys<Given, Allowed, Always extends PropertyKey = never> = Given extends readonly unknown[] ? [UnknownArrayClauseKeys<Given, Allowed, Always>] extends [never] ? unknown : UnknownClauseKey<UnknownArrayClauseKeys<Given, Allowed, Always>> : string extends keyof Given ? unknown : Given extends object ? Record<Exclude<Exclude<keyof Given, Always>, ClauseKeys<NonNullable<Allowed>>>, never> : unknown;
|
|
10809
10868
|
/**
|
|
10810
10869
|
* The typo'd keys of an operation's args, at the operation's OWN level and at
|
|
10811
10870
|
* each clause inside it.
|
|
@@ -10847,29 +10906,43 @@ type NoExtraClauseKeys<Given, Allowed> = Given extends readonly unknown[] ? [Unk
|
|
|
10847
10906
|
* Estate type-check 34s → 45s when the guard landed; adding the other two
|
|
10848
10907
|
* spellings cost nothing measurable (same tree, back-to-back runs: 83.3s vs
|
|
10849
10908
|
* 78.1s user, the difference inside the noise of a loaded machine).
|
|
10850
|
-
* - `data` / `create` / `update` —
|
|
10851
|
-
* payload is the recursive nested-write union, and reaching for its
|
|
10852
|
-
* expands it: six estate sites turn `TS2589: Type instantiation is
|
|
10853
|
-
* excessively deep`, and the type-check goes to 172s.
|
|
10854
|
-
*
|
|
10855
|
-
*
|
|
10909
|
+
* - `data` / `create` / `update` — not keyed against the payload. A write
|
|
10910
|
+
* clause's payload is the recursive nested-write union, and reaching for its
|
|
10911
|
+
* keys expands it: six estate sites turn `TS2589: Type instantiation is
|
|
10912
|
+
* excessively deep`, and the type-check goes to 172s. Direct write names
|
|
10913
|
+
* are keyed from the model state instead (`DirectWriteKeysGuard`), nested
|
|
10914
|
+
* write data by walking the caller's literal (`NestedClauseGuard`).
|
|
10856
10915
|
* - `cursor` / `having` / `cache` — NOT guarded. Three more TS2589 sites, on
|
|
10857
10916
|
* compound-unique and aggregate payloads.
|
|
10858
10917
|
*
|
|
10859
|
-
*
|
|
10860
|
-
* `
|
|
10861
|
-
*
|
|
10862
|
-
*
|
|
10863
|
-
*
|
|
10864
|
-
*
|
|
10865
|
-
*
|
|
10866
|
-
*
|
|
10867
|
-
*
|
|
10868
|
-
*
|
|
10869
|
-
|
|
10870
|
-
|
|
10871
|
-
|
|
10872
|
-
|
|
10918
|
+
* Below the root, every check walks the literal the caller wrote, never the
|
|
10919
|
+
* payload: `NestedClauseGuard` (WHERE model field names, nested write data),
|
|
10920
|
+
* `OperatorBagGuard` (root WHERE operator bags) and
|
|
10921
|
+
* `RecursiveProjectionRootGuard` (nested `select` / `include` / `where`,
|
|
10922
|
+
* `recurse` bags). A guard that inspects a value cannot key a type parameter,
|
|
10923
|
+
* so the projection and operator guards keep each leaf's own arm in a union,
|
|
10924
|
+
* which is what keeps a generic leaf assignable. What stays unguarded —
|
|
10925
|
+
* operator bags below the root WHERE, selectors, variant arms — is pinned as a
|
|
10926
|
+
* compiling misspelling in `tests/types/client/contextual-typing-gate.core.types.ts`
|
|
10927
|
+
* and listed on the quick start.
|
|
10928
|
+
*/
|
|
10929
|
+
/**
|
|
10930
|
+
* The root-reported walks (WHERE model keys, nested write data) follow the
|
|
10931
|
+
* LITERAL the caller wrote, key each spelled object against a key set read
|
|
10932
|
+
* from the model's state, and report what is left as ONE `UnknownClauseKey` on
|
|
10933
|
+
* the root clause. Both descend only REQUIRED keys (`RequiredSpelledKeys`),
|
|
10934
|
+
* never a payload's own optional ones, which is what expands the recursive
|
|
10935
|
+
* payloads (see above): a held value typed as the payload spells none, and
|
|
10936
|
+
* following its optional relation keys enumerated every path through the
|
|
10937
|
+
* model graph (TS2589 in 1.2.0). Cycle detection uses the exact
|
|
10938
|
+
* spelled-value/model pair, never a numeric depth cap, so a value whose type
|
|
10939
|
+
* requires a recursive key stops at its first repeat. `NoInfer` keeps that
|
|
10940
|
+
* comparison from inferring through a relinked model (a mapped type), which
|
|
10941
|
+
* would walk its whole relation graph.
|
|
10942
|
+
*/
|
|
10943
|
+
type SameValue<A, B$1> = (<T$1>() => T$1 extends NoInfer<A> ? 1 : 2) extends (<T$1>() => T$1 extends NoInfer<B$1> ? 1 : 2) ? true : false;
|
|
10944
|
+
type SeenValue<Given, M$1, Seen> = true extends (Seen extends unknown ? SameValue<readonly [Given, M$1], Seen> : never) ? true : false;
|
|
10945
|
+
type ElementOf<Value> = Value extends readonly (infer Element)[] ? Element : Value;
|
|
10873
10946
|
type WhereLogicalKey = "AND" | "OR" | "NOT";
|
|
10874
10947
|
type WhereLogicalKeys<M$1 extends Model$1<any>> = Exclude<WhereLogicalKey, keyof M$1["~"]["state"]["shape"]>;
|
|
10875
10948
|
type WhereModelKeys<M$1 extends Model$1<any>> = keyof M$1["~"]["state"]["shape"] | WhereLogicalKey;
|
|
@@ -10881,10 +10954,71 @@ type QuantifiedWhereUnknownKeys<Given, R$1 extends AnyRelation, Seen, Q$1 extend
|
|
|
10881
10954
|
* is sealed exactly as on the select side.
|
|
10882
10955
|
*/
|
|
10883
10956
|
type RelationWhereUnknownKeys<Given, R$1 extends AnyRelation, Seen> = TargetKind<R$1> extends "model" ? "recurse" extends SpelledClauseKeys<Given> ? QuantifiedWhereUnknownKeys<Given, R$1, Seen, "some" | "every" | "none"> | MisspelledRecurrenceKeys<ValueAt<Given, "recurse">> : Cardinality<R$1> extends "one" ? [Extract<SpelledClauseKeys<Given>, "is" | "isNot">] extends [never] ? WhereUnknownKeys<Given, GetTargetModel<R$1>, Seen> : QuantifiedWhereUnknownKeys<Given, R$1, Seen, "is" | "isNot"> : QuantifiedWhereUnknownKeys<Given, R$1, Seen, "some" | "every" | "none"> : never;
|
|
10884
|
-
type WhereUnknownKeys<Given, M$1 extends Model$1<any>, Seen = never, Allowed extends PropertyKey = WhereModelKeys<M$1>> = Given extends readonly unknown[] ? WhereUnknownKeys<Given[number], M$1, Seen, Allowed> : Given extends object ? string extends keyof Given ? never : Exclude<keyof Given, Allowed> | (
|
|
10885
|
-
|
|
10886
|
-
|
|
10957
|
+
type WhereUnknownKeys<Given, M$1 extends Model$1<any>, Seen = never, Allowed extends PropertyKey = WhereModelKeys<M$1>> = Given extends readonly unknown[] ? WhereUnknownKeys<Given[number], M$1, Seen, Allowed> : Given extends object ? string extends keyof Given ? never : Exclude<keyof Given, Allowed> | (SeenValue<Given, M$1, Seen> extends true ? never : { [K in Extract<RequiredSpelledKeys<Given>, WhereLogicalKeys<M$1> | keyof M$1["~"]["state"]["relations"]>]: K extends WhereLogicalKeys<M$1> ? WhereUnknownKeys<NonNullable<Given[K]>, M$1, Seen | readonly [Given, M$1]> : K extends keyof M$1["~"]["state"]["relations"] ? RelationWhereUnknownKeys<NonNullable<Given[K]>, M$1["~"]["state"]["relations"][K], Seen | readonly [Given, M$1]> : never }[Extract<RequiredSpelledKeys<Given>, WhereLogicalKeys<M$1> | keyof M$1["~"]["state"]["relations"]>]) : never;
|
|
10958
|
+
/**
|
|
10959
|
+
* The data objects one relation's write verbs carry: `create`,
|
|
10960
|
+
* `createMany.data`, `connectOrCreate.create`, `upsert.create` / `.update`,
|
|
10961
|
+
* and the `data` of `update` / `updateMany`. A to-one `update` is read as the
|
|
10962
|
+
* parse boundary reads it (`to-one-update-form.ts`): the `{ where?, data }`
|
|
10963
|
+
* envelope when `where` is spelled or the target owns no `data` field, the
|
|
10964
|
+
* bare data otherwise.
|
|
10965
|
+
*/
|
|
10966
|
+
type NestedWriteData<Verbs, TargetKeys> = ElementOf<ValueAt<Verbs, "create">> | ElementOf<ValueAt<ValueAt<Verbs, "createMany">, "data">> | ValueAt<ElementOf<ValueAt<Verbs, "connectOrCreate" | "upsert">>, "create"> | ValueAt<ElementOf<ValueAt<Verbs, "upsert">>, "update"> | ValueAt<ElementOf<ValueAt<Verbs, "updateMany">>, "data"> | UpdateFormData<ElementOf<ValueAt<Verbs, "update">>, TargetKeys>;
|
|
10967
|
+
type UpdateFormData<Update, TargetKeys> = Update extends {
|
|
10968
|
+
data: infer Data;
|
|
10969
|
+
} ? "where" extends keyof Update ? Data : "data" extends TargetKeys ? Update : Data : Update;
|
|
10970
|
+
/**
|
|
10971
|
+
* The keys an object SPELLED: its required ones. A union of literals (a
|
|
10972
|
+
* ternary between two payload forms) carries each arm's missing keys as
|
|
10973
|
+
* optional `?: undefined` members nobody wrote, and a held value typed as the
|
|
10974
|
+
* payload carries every key as optional and has nothing misspelled. Written
|
|
10975
|
+
* as a key-remapped `keyof` so a generic node resolves through its
|
|
10976
|
+
* constraint: the indexed `{ … }[keyof Given]` form leaves `{ posts }` with
|
|
10977
|
+
* `N extends { select?: { title?: true } }` unprovable.
|
|
10978
|
+
*/
|
|
10979
|
+
type RequiredSpelledKeys<Given> = Given extends object ? keyof { [K in keyof Given as Record<never, never> extends Pick<Given, K> ? never : K]: 0 } : never;
|
|
10980
|
+
/**
|
|
10981
|
+
* The keys nested write data spells that its model does not declare, at
|
|
10982
|
+
* every depth below the root data (whose own keys `DirectWriteKeysGuard`
|
|
10983
|
+
* reports on the key itself). Only spelled keys are read, so a payload-typed
|
|
10984
|
+
* value's recursive schema is never expanded, which also bounds the walk.
|
|
10985
|
+
* Selectors (`where`, `connect`, …) stay unkeyed, as
|
|
10986
|
+
* `contextual-typing-gate.core.types.ts` pins.
|
|
10987
|
+
*/
|
|
10988
|
+
type NestedWriteUnknownKeys<Data$1, M$1 extends Model$1<any>> = Data$1 extends readonly unknown[] ? NestedWriteUnknownKeys<Data$1[number], M$1> : { [K in Extract<RequiredSpelledKeys<Data$1>, keyof M$1["~"]["state"]["relations"]>]: TargetKind<M$1["~"]["state"]["relations"][K]> extends "model" ? TargetWriteUnknownKeys<NonNullable<ValueAt<Data$1, K>>, GetTargetModel<M$1["~"]["state"]["relations"][K]>> : never }[Extract<RequiredSpelledKeys<Data$1>, keyof M$1["~"]["state"]["relations"]>];
|
|
10989
|
+
type TargetWriteUnknownKeys<Verbs, T$1 extends Model$1<any>, Keys$1 extends PropertyKey = keyof T$1["~"]["state"]["shape"]> = NestedWriteData<Verbs, Keys$1> extends infer Data ? Data extends object ? Exclude<RequiredSpelledKeys<Data>, Keys$1> | NestedWriteUnknownKeys<Data, T$1> : never : never;
|
|
10990
|
+
/**
|
|
10991
|
+
* Whether the argument SPELLED `Clause`. A literal's keys are required; a
|
|
10992
|
+
* payload type's are optional — an omitted or generically forwarded argument
|
|
10993
|
+
* — and walking one would expand its recursive schema as though every
|
|
10994
|
+
* optional key was spelled.
|
|
10995
|
+
*/
|
|
10996
|
+
type SpelledClause<Arg, Clause extends PropertyKey> = [Arg] extends [{ [Key in Clause]: unknown }] ? true : false;
|
|
10997
|
+
/**
|
|
10998
|
+
* One spelled root clause, refused as a whole with the keys its walk finds:
|
|
10999
|
+
* `where` walks model field names through relation and logical filters,
|
|
11000
|
+
* `data` / `create` / `update` walk nested write data. A clause spelling no
|
|
11001
|
+
* relation or logical group has nothing below its root to walk. A `where`
|
|
11002
|
+
* that IS the payload type is not walked either. `Parameters<…>` instantiates
|
|
11003
|
+
* this guard with the payload as the argument, where a unique `where` is
|
|
11004
|
+
* required and is a union of arms that each require their key; walking them
|
|
11005
|
+
* costs one `Parameters<…>` read of a `findUnique` about 12k instantiations at
|
|
11006
|
+
* 50 models (measured for 1.2.1).
|
|
11007
|
+
*/
|
|
11008
|
+
type NestedClauseGuard<Arg, Payload, M$1 extends Model$1<any>, Clause extends "where" | "data" | "create" | "update"> = Clause extends keyof Arg ? SpelledClause<Arg, Clause> extends true ? Clause extends keyof Payload ? [Extract<SpelledClauseKeys<ElementOf<NonNullable<Arg[Clause]>>>, WhereLogicalKeys<M$1> | keyof M$1["~"]["state"]["relations"]>] extends [never] ? unknown : (Clause extends "where" ? SameValue<NonNullable<Arg[Clause]>, NonNullable<Payload[Clause]>> extends true ? never : WhereUnknownKeys<NonNullable<Arg[Clause]>, M$1, never, ClauseKeys<NonNullable<Payload[Clause]>>> : NestedWriteUnknownKeys<NonNullable<Arg[Clause]>, M$1>) extends infer Extra ? [Extra] extends [never] ? unknown : { [Key in Clause]?: UnknownClauseKey<Extra> } : unknown : unknown : unknown : unknown;
|
|
11009
|
+
/**
|
|
11010
|
+
* A root WHERE operator bag, sealed at the bag: an object spelled for a
|
|
11011
|
+
* scalar is keyed against every key the field's object arms declare, so
|
|
11012
|
+
* `{ contains: "x", mdoe: "insensitive" }` is refused on `mdoe`. The value's
|
|
11013
|
+
* own primitive, list and `Date` arms stay in the union, which is what keeps
|
|
11014
|
+
* a generic leaf (`title: t`, `T extends string`) assignable: TypeScript
|
|
11015
|
+
* cannot key a type parameter, so a guard that inspected one would refuse it.
|
|
11016
|
+
* Bags inside relation filters and logical groups are not sealed.
|
|
11017
|
+
*/
|
|
11018
|
+
type OperatorBagGuard<Arg, Payload, M$1 extends Model$1<any>> = "where" extends keyof Arg ? SpelledClause<Arg, "where"> extends true ? "where" extends keyof Payload ? {
|
|
11019
|
+
where?: { [K in Extract<SpelledClauseKeys<NonNullable<Arg["where"]>>, keyof M$1["~"]["state"]["scalars"]>]?: OperatorBagSeal<ValueAt<NonNullable<Arg["where"]>, K>, ValueAt<NonNullable<Payload["where"]>, K>> };
|
|
10887
11020
|
} : unknown : unknown : unknown;
|
|
11021
|
+
type OperatorBagSeal<Given, Input$1> = Exclude<Input$1, object> | Extract<Input$1, readonly unknown[] | Date> | Record<Exclude<SpelledClauseKeys<NonNullable<Given>>, ClauseKeys<Extract<NonNullable<Input$1>, object>>>, never>;
|
|
10888
11022
|
type ClauseGuard<Arg, Payload, K$1 extends string> = K$1 extends keyof Arg ? K$1 extends keyof Payload ? { [P in K$1]?: NoExtraClauseKeys<NonNullable<Arg[K$1]>, Payload[K$1]> } : unknown : unknown;
|
|
10889
11023
|
type ValueAt<Container, Key$1 extends PropertyKey> = Container extends unknown ? Key$1 extends keyof Container ? Container[Key$1] : never : never;
|
|
10890
11024
|
type PolymorphicVariantKeys<Relation> = keyof VariantEntries<Relation>;
|
|
@@ -10950,26 +11084,37 @@ type RecurrenceBagGuard<Bag> = [MisspelledRecurrenceKeys<Bag>] extends [never] ?
|
|
|
10950
11084
|
*/
|
|
10951
11085
|
type RelationNodeClauseKey = "where" | "orderBy" | "take" | "skip" | "cursor" | "distinct" | "select" | "include" | "omit" | "recurse" | "only" | "variants";
|
|
10952
11086
|
/**
|
|
10953
|
-
* The
|
|
10954
|
-
* spelled. The walk follows the LITERAL — a node's `select`,
|
|
10955
|
-
* collection `variants` and to-one variant arms —
|
|
10956
|
-
*
|
|
10957
|
-
*
|
|
11087
|
+
* The relation nodes of an operation's projection, sealed at every depth the
|
|
11088
|
+
* caller spelled. The walk follows the LITERAL — a node's `select`,
|
|
11089
|
+
* `include`, `where`, collection `variants` and to-one variant arms — and
|
|
11090
|
+
* reads a target model only for a relation key the caller spelled, so it
|
|
11091
|
+
* costs what the argument contains. On a model-target node it keys `select`
|
|
11092
|
+
* against the target's fields, `include` against its relations (both beside
|
|
11093
|
+
* `_count`), walks `where` as the root WHERE is walked, and seals `recurse`
|
|
11094
|
+
* option bags; variant arms and `variants` are sealed by
|
|
11095
|
+
* `DirectPolymorphicProjectionGuard`, not keyed here. An `any` argument (what
|
|
11096
|
+
* an erased signature passes, as `Parameters<…>` reads it) is not walked.
|
|
11097
|
+
*/
|
|
11098
|
+
type RecursiveProjectionRootGuard<Arg, M$1 extends Model$1<any>> = 0 extends 1 & Arg ? unknown : RecursiveRootClause<Arg, M$1, "select"> & RecursiveRootClause<Arg, M$1, "include">;
|
|
11099
|
+
/**
|
|
11100
|
+
* A clause the argument spelled — a REQUIRED key of the argument. The guard
|
|
11101
|
+
* names no key the caller did not, and an optional clause belongs to a payload
|
|
11102
|
+
* type (an erased signature's, as `Parameters<…>` reads it), never walked.
|
|
10958
11103
|
*/
|
|
10959
|
-
type
|
|
10960
|
-
/** A clause the argument spelled; the guard names no key the caller did not. */
|
|
10961
|
-
type RecursiveRootClause<Arg, Clause extends "select" | "include"> = Clause extends keyof Arg ? { [Key in Clause]?: RecursiveRootMembers<Arg[Key]> } : unknown;
|
|
11104
|
+
type RecursiveRootClause<Arg, M$1 extends Model$1<any>, Clause extends "select" | "include"> = Clause extends keyof Arg ? SpelledClause<Arg, Clause> extends true ? { [Key in Clause]?: RecursiveRootMembers<Arg[Key], M$1> } : unknown : unknown;
|
|
10962
11105
|
/**
|
|
10963
11106
|
* The operation's own projection. Its members meet the node guard directly,
|
|
10964
11107
|
* so a misspelling one relation deep is reported on the key itself.
|
|
10965
11108
|
*/
|
|
10966
|
-
type RecursiveRootMembers<Clause> = { [Key in SpelledClauseKeys<NonNullable<Clause>>]?: RecursiveNodeGuard<ValueAt<NonNullable<Clause>, Key>> };
|
|
11109
|
+
type RecursiveRootMembers<Clause, M$1> = { [Key in SpelledClauseKeys<NonNullable<Clause>>]?: RecursiveNodeGuard<ValueAt<NonNullable<Clause>, Key>, RelationTarget<M$1, Key>> };
|
|
11110
|
+
/** The model a relation key targets; `never` (nothing to key) otherwise. */
|
|
11111
|
+
type RelationTarget<M$1, Key$1> = M$1 extends Model$1<any> ? Key$1 extends keyof M$1["~"]["state"]["relations"] ? TargetKind<M$1["~"]["state"]["relations"][Key$1]> extends "model" ? GetTargetModel<M$1["~"]["state"]["relations"][Key$1]> : never : never : never;
|
|
10967
11112
|
/**
|
|
10968
11113
|
* Only an object is a node to walk. A leaf, or a payload type wide enough to
|
|
10969
11114
|
* admit one, states nothing: the guard is for what a caller spelled, and TS
|
|
10970
11115
|
* falls back to the payload type itself when an argument fails it.
|
|
10971
11116
|
*/
|
|
10972
|
-
type RecursiveNodeGuard<Node> = [Exclude<Node, null | undefined>] extends [object] ? RecursiveNodeObjectGuard<Exclude<Node, null | undefined
|
|
11117
|
+
type RecursiveNodeGuard<Node, T$1> = [Exclude<Node, null | undefined>] extends [object] ? RecursiveNodeObjectGuard<Exclude<Node, null | undefined>, T$1> : unknown;
|
|
10973
11118
|
type ExclusiveSelection<Node> = Node extends {
|
|
10974
11119
|
select: object;
|
|
10975
11120
|
include: object;
|
|
@@ -10978,27 +11123,42 @@ type ExclusiveSelection<Node> = Node extends {
|
|
|
10978
11123
|
} | {
|
|
10979
11124
|
include?: undefined;
|
|
10980
11125
|
} : unknown;
|
|
10981
|
-
type RecursiveNodeObjectGuard<Node> = ExclusiveSelection<Node> & ("recurse" extends keyof Node ? {
|
|
11126
|
+
type RecursiveNodeObjectGuard<Node, T$1> = ExclusiveSelection<Node> & ("recurse" extends keyof Node ? {
|
|
10982
11127
|
recurse?: RecurrenceBagGuard<Node["recurse"]>;
|
|
10983
11128
|
} : unknown) & ("select" extends keyof Node ? {
|
|
10984
|
-
select?: RecursiveProjectionGuard<Node["select"]>;
|
|
11129
|
+
select?: RecursiveProjectionGuard<Node["select"], T$1> & ProjectionKeySeal<Node["select"], T$1, "select">;
|
|
10985
11130
|
} : unknown) & ("include" extends keyof Node ? {
|
|
10986
|
-
include?: RecursiveProjectionGuard<Node["include"]>;
|
|
11131
|
+
include?: RecursiveProjectionGuard<Node["include"], T$1> & ProjectionKeySeal<Node["include"], T$1, "include">;
|
|
11132
|
+
} : unknown) & ([Node] extends [{
|
|
11133
|
+
where: unknown;
|
|
11134
|
+
}] ? {
|
|
11135
|
+
where?: NodeWhereSeal<Node["where"], T$1>;
|
|
10987
11136
|
} : unknown) & ("variants" extends keyof Node ? {
|
|
10988
|
-
variants?: RecursiveProjectionGuard<Node["variants"]>;
|
|
10989
|
-
} : unknown) & RecursiveProjectionGuard<Node, RelationNodeClauseKey>;
|
|
11137
|
+
variants?: RecursiveProjectionGuard<Node["variants"], never>;
|
|
11138
|
+
} : unknown) & RecursiveProjectionGuard<Node, never, RelationNodeClauseKey>;
|
|
10990
11139
|
/**
|
|
10991
11140
|
* A nested projection map. Its members are boolean leaves or nodes; naming
|
|
10992
|
-
* the leaf keeps a generic
|
|
10993
|
-
*
|
|
10994
|
-
|
|
10995
|
-
|
|
10996
|
-
type
|
|
11141
|
+
* the leaf keeps a generic leaf assignable, because TypeScript cannot resolve
|
|
11142
|
+
* the walk through a type parameter. A generic NODE whose constraint spells
|
|
11143
|
+
* `select`, `include` or `where` is refused: those keys cannot be proven.
|
|
11144
|
+
*/
|
|
11145
|
+
type RecursiveProjectionGuard<Clause, T$1, Skipped extends PropertyKey = never> = { [Key in Exclude<SpelledClauseKeys<NonNullable<Clause>>, Skipped>]?: boolean | RecursiveNodeGuard<ValueAt<NonNullable<Clause>, Key>, RelationTarget<T$1, Key>> };
|
|
11146
|
+
/**
|
|
11147
|
+
* A model-target node's `select` / `include` keys, beside `_count`. Only the
|
|
11148
|
+
* keys the value requires are spelled: a held node (typed as the payload, as
|
|
11149
|
+
* `Parameters<…>` reads it) is a union of the ordinary and the recursive
|
|
11150
|
+
* node, and the recursive arm's projection carries the asking key as an
|
|
11151
|
+
* optional refused member nobody wrote.
|
|
11152
|
+
*/
|
|
11153
|
+
type ProjectionKeySeal<Clause, T$1, Kind$1 extends "select" | "include"> = [T$1] extends [never] ? unknown : T$1 extends Model$1<any> ? Record<Exclude<RequiredSpelledKeys<NonNullable<Clause>>, "_count" | keyof T$1["~"]["state"][Kind$1 extends "select" ? "shape" : "relations"]>, never> : unknown;
|
|
11154
|
+
/** A model-target node's `where`, walked as the root WHERE is. */
|
|
11155
|
+
type NodeWhereSeal<Where, T$1> = [T$1] extends [never] ? unknown : T$1 extends Model$1<any> ? WhereUnknownKeys<NonNullable<Where>, T$1> extends infer Extra ? [Extra] extends [never] ? unknown : UnknownClauseKey<Extra> : unknown : unknown;
|
|
11156
|
+
type ScalarStateOf<Field, Kind$1 extends ScalarType> = Field extends {
|
|
10997
11157
|
readonly "~": {
|
|
10998
|
-
readonly state: infer State extends ScalarState<
|
|
11158
|
+
readonly state: infer State extends ScalarState<Kind$1>;
|
|
10999
11159
|
};
|
|
11000
11160
|
} ? State : never;
|
|
11001
|
-
type
|
|
11161
|
+
type ScalarKeysOf<State$1 extends ModelState, Kind$1 extends ScalarType> = { [Key in keyof State$1["scalars"]]: [ScalarStateOf<State$1["scalars"][Key], Kind$1>] extends [never] ? never : Key }[keyof State$1["scalars"]];
|
|
11002
11162
|
/**
|
|
11003
11163
|
* Refuse only keys the caller spelled BESIDE a real decimal operation.
|
|
11004
11164
|
*
|
|
@@ -11012,17 +11172,11 @@ type DirectDecimalScalarKeys<State$1 extends ModelState> = { [Key in keyof State
|
|
|
11012
11172
|
*/
|
|
11013
11173
|
type SpelledDecimalUpdateObjectKeys<Given, OperationKeys extends PropertyKey> = Given extends readonly unknown[] ? never : Given extends object ? string extends keyof Given ? never : [Extract<keyof Given, OperationKeys>] extends [never] ? never : keyof Given : never;
|
|
11014
11174
|
type NoExtraDecimalUpdateLeafKeys<Given, State$1 extends ScalarState<"decimal">, OperationKeys extends PropertyKey = DecimalUpdateOperationKeys<State$1>> = Record<Exclude<SpelledDecimalUpdateObjectKeys<Given, OperationKeys>, OperationKeys>, never>;
|
|
11015
|
-
type UsedDirectDecimalFields<Given, State$1 extends ModelState> = Extract<SpelledClauseKeys<Given>,
|
|
11175
|
+
type UsedDirectDecimalFields<Given, State$1 extends ModelState> = Extract<SpelledClauseKeys<Given>, ScalarKeysOf<State$1, "decimal">>;
|
|
11016
11176
|
/** One direct-field map after union branches have contributed their keys. */
|
|
11017
|
-
type DirectDecimalUpdateObjectGuard<Given, M$1 extends Model$1<any>> = M$1 extends Model$1<infer State> ? { [Key in UsedDirectDecimalFields<Given, State>]?: NoExtraDecimalUpdateLeafKeys<ValueAt<Given, Key>,
|
|
11177
|
+
type DirectDecimalUpdateObjectGuard<Given, M$1 extends Model$1<any>> = M$1 extends Model$1<infer State> ? { [Key in UsedDirectDecimalFields<Given, State>]?: NoExtraDecimalUpdateLeafKeys<ValueAt<Given, Key>, ScalarStateOf<State["scalars"][Key], "decimal">> } : unknown;
|
|
11018
11178
|
type DirectDecimalUpdateClauseGuard<Arg, M$1 extends Model$1<any>, Clause extends "data" | "update"> = Clause extends keyof Arg ? { [Key in Clause]?: DirectDecimalUpdateObjectGuard<NonNullable<Arg[Key]>, M$1> } : unknown;
|
|
11019
11179
|
type DirectDecimalUpdateGuard<O$1 extends Operations, Arg, M$1 extends Model$1<any>> = O$1 extends "update" | "updateMany" ? DirectDecimalUpdateClauseGuard<Arg, M$1, "data"> : O$1 extends "upsert" ? DirectDecimalUpdateClauseGuard<Arg, M$1, "update"> : unknown;
|
|
11020
|
-
type GeoPointStateOf<Field> = Field extends {
|
|
11021
|
-
readonly "~": {
|
|
11022
|
-
readonly state: infer State extends ScalarState<"point">;
|
|
11023
|
-
};
|
|
11024
|
-
} ? State : never;
|
|
11025
|
-
type DirectGeoPointScalarKeys<State$1 extends ModelState> = { [Key in keyof State$1["scalars"]]: [GeoPointStateOf<State$1["scalars"][Key]>] extends [never] ? never : Key }[keyof State$1["scalars"]];
|
|
11026
11180
|
type NoExtraRecognizedKeys<Given, Allowed extends PropertyKey, Recognized extends PropertyKey = Allowed> = Given extends readonly unknown[] ? unknown : Given extends object ? string extends keyof Given ? unknown : [Extract<keyof Given, Recognized>] extends [never] ? unknown : Record<Exclude<keyof Given, Allowed>, never> : unknown;
|
|
11027
11181
|
type GeoPointValueGuard<Given> = NoExtraRecognizedKeys<Given, "longitude" | "latitude">;
|
|
11028
11182
|
type GeoBoundsValueGuard<Given> = NoExtraRecognizedKeys<Given, "south" | "west" | "north" | "east">;
|
|
@@ -11056,7 +11210,7 @@ type GeoPointWriteValueGuard<Given> = Given extends object ? "set" extends keyof
|
|
|
11056
11210
|
type UsedGeoPointKeys<Row, PointKeys extends PropertyKey> = Extract<SpelledClauseKeys<Row>, PointKeys>;
|
|
11057
11211
|
type GeoPointRowGuard<Given, PointKeys extends PropertyKey, Mode extends "filter" | "write", Row = (Given extends readonly (infer Member)[] ? Member : Given)> = [UsedGeoPointKeys<Row, PointKeys>] extends [never] ? unknown : Row extends object ? { [Key in UsedGeoPointKeys<Row, PointKeys>]?: Mode extends "filter" ? GeoPointFilterValueGuard<ValueAt<Row, Key>> : GeoPointWriteValueGuard<ValueAt<Row, Key>> } : unknown;
|
|
11058
11212
|
type DirectGeoPointClauseGuard<Arg, Clause extends PropertyKey, PointKeys extends PropertyKey, Mode extends "filter" | "write"> = Clause extends keyof Arg ? { [Key in Clause]?: GeoPointRowGuard<NonNullable<Arg[Key]>, PointKeys, Mode> } : unknown;
|
|
11059
|
-
type DirectGeoPointGuard<O$1 extends Operations, Arg, M$1 extends Model$1<any>, PointKeys extends PropertyKey = (M$1 extends Model$1<infer State> ?
|
|
11213
|
+
type DirectGeoPointGuard<O$1 extends Operations, Arg, M$1 extends Model$1<any>, PointKeys extends PropertyKey = (M$1 extends Model$1<infer State> ? ScalarKeysOf<State, "point"> : never)> = [PointKeys] extends [never] ? unknown : DirectGeoPointClauseGuard<Arg, "where", PointKeys, "filter"> & (O$1 extends "create" | "createMany" | "update" | "updateMany" ? DirectGeoPointClauseGuard<Arg, "data", PointKeys, "write"> : O$1 extends "upsert" ? DirectGeoPointClauseGuard<Arg, "create", PointKeys, "write"> & DirectGeoPointClauseGuard<Arg, "update", PointKeys, "write"> : unknown);
|
|
11060
11214
|
/** Direct write names come from State, never the recursive write payload. */
|
|
11061
11215
|
type DirectWriteKeysGuard<O$1 extends Operations, Arg, M$1 extends Model$1<any>, Keys$1 extends PropertyKey = keyof M$1["~"]["state"]["shape"]> = O$1 extends "create" | "createMany" | "update" | "updateMany" ? ClauseGuard<Arg, {
|
|
11062
11216
|
data: Record<Keys$1, unknown>;
|
|
@@ -11065,18 +11219,27 @@ type DirectWriteKeysGuard<O$1 extends Operations, Arg, M$1 extends Model$1<any>,
|
|
|
11065
11219
|
}, "create"> & ClauseGuard<Arg, {
|
|
11066
11220
|
update: Record<Keys$1, unknown>;
|
|
11067
11221
|
}, "update"> : unknown;
|
|
11068
|
-
type NoExtraOperationKeys<O$1 extends Operations, Arg, Payload, M$1 extends Model$1<any>, Controls$1 = NoControls> = Arg & ExclusiveSelection<Arg> & Record<Exclude<keyof Arg, keyof Payload | keyof Controls$1>, never> & ClauseGuard<Arg, Payload, "where"> & NestedWhereClauseGuard<Arg, Payload, M$1> & ClauseGuard<Arg, Payload, "select"> & ClauseGuard<Arg, Payload, "include"> & ClauseGuard<Arg, Payload, "orderBy"> & ClauseGuard<Arg, Payload, "omit"> & ClauseGuard<Arg, Controls$1, "cache"> & DirectPolymorphicProjectionGuard<Arg, M$1, "select"> & DirectPolymorphicProjectionGuard<Arg, M$1, "include"> & RecursiveProjectionRootGuard<Arg> & DirectWriteKeysGuard<O$1, Arg, M$1> & DirectDecimalUpdateGuard<O$1, Arg, M$1> & DirectGeoPointGuard<O$1, Arg, M$1>;
|
|
11069
11222
|
/**
|
|
11070
|
-
*
|
|
11071
|
-
*
|
|
11072
|
-
*
|
|
11073
|
-
*
|
|
11223
|
+
* groupBy `orderBy` names an aggregate or a field the literal `by` grouped.
|
|
11224
|
+
* Aggregates are admitted before `by` is read, so a `by` list that is a type
|
|
11225
|
+
* parameter still orders by aggregates, while a field beside it is refused:
|
|
11226
|
+
* no grouped key can be proven. An empty `by` stays a runtime refusal (V4001)
|
|
11227
|
+
* because refusing `[]` here would refuse every generic `by` list too.
|
|
11074
11228
|
*/
|
|
11075
|
-
type
|
|
11229
|
+
type GroupByOrderGuard<O$1 extends Operations, Arg, Payload, M$1 extends Model$1<any>> = O$1 extends "groupBy" ? "orderBy" extends keyof Arg ? {
|
|
11230
|
+
orderBy?: NoExtraClauseKeys<NonNullable<Arg["orderBy"]>, Record<Extract<ElementOf<NonNullable<ValueAt<Arg, "by">>>, PropertyKey>, unknown>, Exclude<ClauseKeys<ElementOf<NonNullable<ValueAt<Payload, "orderBy">>>>, keyof M$1["~"]["state"]["scalars"]>>;
|
|
11231
|
+
} : unknown : unknown;
|
|
11232
|
+
type NoExtraOperationKeys<O$1 extends Operations, Arg, Payload, M$1 extends Model$1<any>, Controls$1 = NoControls> = Arg & ExclusiveSelection<Arg> & Record<Exclude<keyof Arg, keyof Payload | keyof Controls$1>, never> & ClauseGuard<Arg, Payload, "where"> & NestedClauseGuard<Arg, Payload, M$1, "where"> & OperatorBagGuard<Arg, Payload, M$1> & ClauseGuard<Arg, Payload, "select"> & ClauseGuard<Arg, Payload, "include"> & ClauseGuard<Arg, Payload, "orderBy"> & ClauseGuard<Arg, Payload, "omit"> & ClauseGuard<Arg, Controls$1, "cache"> & DirectPolymorphicProjectionGuard<Arg, M$1, "select"> & DirectPolymorphicProjectionGuard<Arg, M$1, "include"> & RecursiveProjectionRootGuard<Arg, M$1> & DirectWriteKeysGuard<O$1, Arg, M$1> & NestedClauseGuard<Arg, Payload, M$1, "data"> & NestedClauseGuard<Arg, Payload, M$1, "create"> & NestedClauseGuard<Arg, Payload, M$1, "update"> & GroupByOrderGuard<O$1, Arg, Payload, M$1> & DirectDecimalUpdateGuard<O$1, Arg, M$1> & DirectGeoPointGuard<O$1, Arg, M$1>;
|
|
11076
11233
|
/**
|
|
11077
|
-
*
|
|
11234
|
+
* One client method signature. `Pending` picks its carrier: a PendingOperation
|
|
11235
|
+
* (PromiseLike, so it can be awaited directly or batched in
|
|
11236
|
+
* `$transaction([op1, op2])`), or a plain Promise for a cached read, which is
|
|
11237
|
+
* not batchable.
|
|
11078
11238
|
*/
|
|
11079
|
-
type
|
|
11239
|
+
type OperationMethod<O$1 extends Operations, M$1 extends Model$1<any>, DefaultOmit, ClientDefaults, Controls$1, Payload, Pending extends boolean> = undefined extends Payload ? <Arg extends Payload>(args?: WithControlArgs<NoExtraOperationKeys<O$1, Exclude<Arg, undefined>, Exclude<Payload, undefined>, M$1, Controls$1>, Controls$1>) => OperationCarrier<OperationResultWithClientDefaults<O$1, M$1, Arg, DefaultOmit, ClientDefaults>, Pending> : <Arg extends Payload>(args: WithControlArgs<NoExtraOperationKeys<O$1, Arg, Payload, M$1, Controls$1>, Controls$1>) => OperationCarrier<OperationResultWithClientDefaults<O$1, M$1, Arg, DefaultOmit, ClientDefaults>, Pending>;
|
|
11240
|
+
type OperationCarrier<Result, Pending extends boolean> = Pending extends true ? PendingOperation<Result> : Promise<Result>;
|
|
11241
|
+
type Operation$1<O$1 extends Operations, M$1 extends Model$1<any>, DefaultOmit = undefined, ClientDefaults = never, Controls$1 = NoControls, Payload = OperationPayload<O$1, M$1>> = OperationMethod<O$1, M$1, DefaultOmit, ClientDefaults, Controls$1, Payload, true>;
|
|
11242
|
+
type CachedOperation<O$1 extends Operations, M$1 extends Model$1<any>, DefaultOmit = undefined, ClientDefaults = never, Controls$1 = NoControls> = OperationMethod<O$1, M$1, DefaultOmit, ClientDefaults, Controls$1, OperationPayload<O$1, M$1>, false>;
|
|
11080
11243
|
/**
|
|
11081
11244
|
* Cached client type - provides typed access to only cacheable (read) operations
|
|
11082
11245
|
* Returns Promises directly (not PendingOperation) - cache operations are not batchable
|
|
@@ -11208,21 +11371,6 @@ declare class SavepointQueue {
|
|
|
11208
11371
|
}
|
|
11209
11372
|
//#endregion
|
|
11210
11373
|
//#region src/drivers/shared/driver-options.d.ts
|
|
11211
|
-
/**
|
|
11212
|
-
* The driver-option boundary.
|
|
11213
|
-
*
|
|
11214
|
-
* Every public `namespace` and MySQL2's `migrationNamespaceAttestation` reach
|
|
11215
|
-
* VibORM through a caller-owned object, which may be a proxy or carry an
|
|
11216
|
-
* accessor. This module is the one place those properties are read: exactly
|
|
11217
|
-
* once, with a thrown accessor turned into the client-construction failure the
|
|
11218
|
-
* rest of the surface already raises. A second read is what would let a value
|
|
11219
|
-
* that passed validation be swapped for one that did not before it is used.
|
|
11220
|
-
*
|
|
11221
|
-
* Convenience wrappers read the caller's configuration here and hand their
|
|
11222
|
-
* driver a plain primitive; direct driver construction reads its own options
|
|
11223
|
-
* object here. Both entries reach this owner, and neither reaches a provider
|
|
11224
|
-
* before it answers.
|
|
11225
|
-
*/
|
|
11226
11374
|
/**
|
|
11227
11375
|
* MySQL2's transport assertion. It selects nothing: it states that qualified
|
|
11228
11376
|
* `database.table` references and the pinned migration session's `USE` cannot
|
|
@@ -11561,6 +11709,15 @@ declare abstract class DriverTransactionBase<TClient, TTransaction> extends Driv
|
|
|
11561
11709
|
interface PinnedSessionReservation<TSession> {
|
|
11562
11710
|
/** The reserved producer. Every statement of the session runs on it. */
|
|
11563
11711
|
readonly session: TSession;
|
|
11712
|
+
/**
|
|
11713
|
+
* The failure the provider itself saw end this session's connection, or
|
|
11714
|
+
* `undefined` while it has seen none.
|
|
11715
|
+
*
|
|
11716
|
+
* Only a provider that observes its connection has one (`pg`, through the
|
|
11717
|
+
* client's `error` event). Elsewhere a lost connection is recognized by the
|
|
11718
|
+
* failure that reported it.
|
|
11719
|
+
*/
|
|
11720
|
+
readonly lost?: () => unknown;
|
|
11564
11721
|
/**
|
|
11565
11722
|
* Returns the producer to the provider.
|
|
11566
11723
|
*
|
|
@@ -11570,11 +11727,42 @@ interface PinnedSessionReservation<TSession> {
|
|
|
11570
11727
|
* pool. A provider whose session can never be made clean again (MySQL2, which
|
|
11571
11728
|
* has executed `USE` and possibly author-owned statements) destroys
|
|
11572
11729
|
* unconditionally and ignores the flag.
|
|
11730
|
+
*
|
|
11731
|
+
* `lost` is true when the connection itself is gone or stopped answering:
|
|
11732
|
+
* the provider must send nothing more on it — not even the reset a discard
|
|
11733
|
+
* otherwise runs — and abandon or destroy it.
|
|
11573
11734
|
*/
|
|
11574
|
-
release(discard: boolean): Promise<void>;
|
|
11735
|
+
release(discard: boolean, lost?: boolean): Promise<void>;
|
|
11575
11736
|
}
|
|
11576
11737
|
//#endregion
|
|
11577
11738
|
//#region src/drivers/driver.d.ts
|
|
11739
|
+
/** A PostgreSQL driver's transport assertion for migration sessions. */
|
|
11740
|
+
type MigrationSessionAttestation = "dedicated-session";
|
|
11741
|
+
/**
|
|
11742
|
+
* What a SQLite driver states to run effectful migration work. Each member is a
|
|
11743
|
+
* safety claim with one admitted value; a driver that cannot make all of them
|
|
11744
|
+
* does not declare the capability. Whether it runs callback transactions stays
|
|
11745
|
+
* the driver's own `supportsTransactions` declaration, read beside this one.
|
|
11746
|
+
*/
|
|
11747
|
+
interface SqliteMigrationCapability {
|
|
11748
|
+
/**
|
|
11749
|
+
* `PRAGMA foreign_keys` run between transactions on the migration's
|
|
11750
|
+
* connection takes effect there and reads back.
|
|
11751
|
+
*/
|
|
11752
|
+
readonly foreignKeys: "pragma";
|
|
11753
|
+
/**
|
|
11754
|
+
* The platform reserves no table names: every table outside `sqlite_*` is
|
|
11755
|
+
* the caller's. Cloudflare's `_cf_*` tables are why D1 cannot declare it.
|
|
11756
|
+
*/
|
|
11757
|
+
readonly reservedTablePrefixes: "none";
|
|
11758
|
+
/**
|
|
11759
|
+
* Every transaction this driver opens holds SQLite's database write lock
|
|
11760
|
+
* from its BEGIN (`BEGIN IMMEDIATE`), so no other writer interleaves with a
|
|
11761
|
+
* migration transaction before it commits or rolls back.
|
|
11762
|
+
*/
|
|
11763
|
+
readonly exclusion: "database-write-lock";
|
|
11764
|
+
}
|
|
11765
|
+
declare const SQLITE_MIGRATION_CAPABILITY: SqliteMigrationCapability;
|
|
11578
11766
|
declare abstract class Driver<TClient, TTransaction> extends DriverTransactionBase<TClient, TTransaction> {
|
|
11579
11767
|
protected createTransactionBoundDriver(tx: TTransaction, context: QueryExecutionContext): TransactionBoundDriver<TClient, TTransaction>;
|
|
11580
11768
|
/**
|
|
@@ -11614,6 +11802,40 @@ declare abstract class Driver<TClient, TTransaction> extends DriverTransactionBa
|
|
|
11614
11802
|
* client a caller may hand to several drivers.
|
|
11615
11803
|
*/
|
|
11616
11804
|
protected physicalPinnedSession?(): Promise<object>;
|
|
11805
|
+
/**
|
|
11806
|
+
* Every endpoint this PostgreSQL driver's configuration names for its
|
|
11807
|
+
* sessions — host names and connection URLs, as configured; entries that are
|
|
11808
|
+
* not strings name nothing — read when a migration command is admitted.
|
|
11809
|
+
* Absent on a driver that names none (PGlite, a custom driver). Migration
|
|
11810
|
+
* admission is its one consumer: it refuses effectful commands when one of
|
|
11811
|
+
* them is a transaction-pooling host it knows (Cloudflare Hyperdrive, a Neon
|
|
11812
|
+
* `-pooler` endpoint), because a session lock taken there is held by
|
|
11813
|
+
* whichever server session served that statement.
|
|
11814
|
+
*/
|
|
11815
|
+
protected migrationSessionEndpoints?(): readonly unknown[];
|
|
11816
|
+
/**
|
|
11817
|
+
* The caller's claim, at their risk, that every connection this PostgreSQL
|
|
11818
|
+
* driver opens is one server session for its whole life. It lifts only the
|
|
11819
|
+
* pooler-host refusal; a driver with no pinned-session hook stays refused.
|
|
11820
|
+
* Installed like `migrationNamespaceAttestation`: only the exact literal.
|
|
11821
|
+
*/
|
|
11822
|
+
readonly migrationSessionAttestation: MigrationSessionAttestation | undefined;
|
|
11823
|
+
/**
|
|
11824
|
+
* This SQLite driver's migration capability, or absent. Its presence binds a
|
|
11825
|
+
* custom SQLite driver to VibORM's SQLite migration implementation, and
|
|
11826
|
+
* effectful migration work is admitted only on a driver that declares it.
|
|
11827
|
+
* Only the exact {@link SQLITE_MIGRATION_CAPABILITY} values count.
|
|
11828
|
+
*/
|
|
11829
|
+
readonly sqliteMigrationCapability: SqliteMigrationCapability | undefined;
|
|
11830
|
+
/**
|
|
11831
|
+
* Runs on the migration's connection immediately before a SQLite table
|
|
11832
|
+
* recreation's `PRAGMA foreign_keys = OFF`, outside any transaction, or is
|
|
11833
|
+
* absent. SQLite ignores that pragma while a write is pending, so a driver
|
|
11834
|
+
* whose platform can hold one open settles it here: a Durable Object driver
|
|
11835
|
+
* calls `await ctx.storage.sync()`. The pragma is read back afterwards
|
|
11836
|
+
* either way, and the recreation is refused when it still reads 1.
|
|
11837
|
+
*/
|
|
11838
|
+
protected beforeForeignKeysOff?(): Promise<void>;
|
|
11617
11839
|
disconnect(): Promise<void>;
|
|
11618
11840
|
}
|
|
11619
11841
|
/**
|
|
@@ -11709,7 +11931,8 @@ declare class TransactionBoundDriver<TClient, TTransaction> extends Driver<TClie
|
|
|
11709
11931
|
* substrate (result shape, program lowering, identity helpers); the client never
|
|
11710
11932
|
* spells them, and they share their family's arg schema.
|
|
11711
11933
|
*/
|
|
11712
|
-
|
|
11934
|
+
declare const OPERATIONS: readonly ["findFirst", "findMany", "findUnique", "create", "createMany", "createManyAndReturn", "update", "updateMany", "updateManyAndReturn", "delete", "deleteMany", "deleteManyAndReturn", "upsert", "count", "aggregate", "groupBy", "exist"];
|
|
11935
|
+
type Operation = (typeof OPERATIONS)[number];
|
|
11713
11936
|
//#endregion
|
|
11714
11937
|
//#region src/adapters/adapter-result-parser.d.ts
|
|
11715
11938
|
interface AdapterResultParser {
|
|
@@ -11971,7 +12194,11 @@ interface DatabaseAdapter {
|
|
|
11971
12194
|
true: () => Sql;
|
|
11972
12195
|
/** FALSE literal (database-specific: FALSE vs 0) */
|
|
11973
12196
|
false: () => Sql;
|
|
11974
|
-
/**
|
|
12197
|
+
/**
|
|
12198
|
+
* Returns the dialect's membership operand, valid only as `operators.in` /
|
|
12199
|
+
* `notIn` input: a parenthesized list, a PostgreSQL array parameter, or,
|
|
12200
|
+
* past 25 members, a SQLite `json_each` subquery.
|
|
12201
|
+
*/
|
|
11975
12202
|
list: (values: Sql[]) => Sql;
|
|
11976
12203
|
/** JSON value (PG: native, MySQL/SQLite: JSON.stringify) */
|
|
11977
12204
|
json: (v: unknown) => Sql;
|
|
@@ -12164,7 +12391,8 @@ interface DatabaseAdapter {
|
|
|
12164
12391
|
* would bind the hex text's own bytes, so the binary arm decodes it
|
|
12165
12392
|
* (`decode(…, 'hex')`, `UNHEX`, `unhex`). SQLite's `unhex()` arrived in
|
|
12166
12393
|
* 3.41, above this adapter's 3.35 floor: a compact identifier on SQLite
|
|
12167
|
-
* needs 3.41, and
|
|
12394
|
+
* needs 3.41, and so does a bytes list longer than `literals.list` keeps
|
|
12395
|
+
* parenthesized; nothing else here does.
|
|
12168
12396
|
*/
|
|
12169
12397
|
idCast: (expr: Sql, representation: IdRepresentation) => Sql;
|
|
12170
12398
|
coalesce: (...exprs: Sql[]) => Sql;
|
|
@@ -12188,6 +12416,33 @@ interface DatabaseAdapter {
|
|
|
12188
12416
|
count: (expr?: Sql) => Sql;
|
|
12189
12417
|
countDistinct: (expr: Sql) => Sql;
|
|
12190
12418
|
sum: (expr: Sql) => Sql;
|
|
12419
|
+
/**
|
|
12420
|
+
* A double column's sum as two `SUM`s no row count can overflow: its
|
|
12421
|
+
* members of magnitude at least 1e-288 divided by 2^64, and the smaller
|
|
12422
|
+
* ones as they are. Dividing such a double by 2^64 is exact, so the first
|
|
12423
|
+
* part is the plain sum scaled exactly, and the reader's
|
|
12424
|
+
* `high * 2^64 + low` is that sum — `±Infinity` past the double range,
|
|
12425
|
+
* where PostgreSQL's own `SUM` raises and MySQL's answers 0 (engine-10).
|
|
12426
|
+
*
|
|
12427
|
+
* `having` compares `value` and a grouped `orderBy` sorts by `order`, so
|
|
12428
|
+
* a group is kept and placed by the sum the projection publishes.
|
|
12429
|
+
*/
|
|
12430
|
+
numberSum: (expr: Sql) => {
|
|
12431
|
+
readonly parts: readonly [high: Sql, low: Sql];
|
|
12432
|
+
/** The joined sum as one comparable expression. */
|
|
12433
|
+
readonly value: Sql;
|
|
12434
|
+
/** Sort keys, most significant first, ordering by the joined sum. */
|
|
12435
|
+
readonly order: readonly Sql[];
|
|
12436
|
+
};
|
|
12437
|
+
/**
|
|
12438
|
+
* Stated only where an integer `SUM` is int64 and raises past it
|
|
12439
|
+
* (SQLite): an int64 column's sum as two `SUM`s no realistic row count
|
|
12440
|
+
* can overflow — each member's high 32 bits and the rest — read back
|
|
12441
|
+
* exactly as `high * 2^32 + low` (engine-10), compared and sorted as
|
|
12442
|
+
* `numberSum` states. PostgreSQL and MySQL already sum integers as exact
|
|
12443
|
+
* numerics.
|
|
12444
|
+
*/
|
|
12445
|
+
integerSum?: DatabaseAdapter["aggregates"]["numberSum"];
|
|
12191
12446
|
avg: (expr: Sql) => Sql;
|
|
12192
12447
|
min: (expr: Sql, boolean?: boolean) => Sql;
|
|
12193
12448
|
max: (expr: Sql, boolean?: boolean) => Sql;
|
|
@@ -12712,6 +12967,12 @@ declare class MySQLAdapter implements DatabaseAdapter {
|
|
|
12712
12967
|
count: (expr?: Sql) => Sql;
|
|
12713
12968
|
countDistinct: (expr: Sql) => Sql;
|
|
12714
12969
|
sum: (expr: Sql) => Sql;
|
|
12970
|
+
numberSum: (expr: Sql) => {
|
|
12971
|
+
readonly parts: readonly [high: Sql, low: Sql];
|
|
12972
|
+
readonly value: Sql;
|
|
12973
|
+
readonly order: readonly Sql[];
|
|
12974
|
+
};
|
|
12975
|
+
integerSum?: DatabaseAdapter["aggregates"]["numberSum"] | undefined;
|
|
12715
12976
|
avg: (expr: Sql) => Sql;
|
|
12716
12977
|
min: (expr: Sql, boolean?: boolean) => Sql;
|
|
12717
12978
|
max: (expr: Sql, boolean?: boolean) => Sql;
|
|
@@ -12725,7 +12986,7 @@ declare class MySQLAdapter implements DatabaseAdapter {
|
|
|
12725
12986
|
array: (items: Sql[]) => Sql;
|
|
12726
12987
|
emptyArray: () => Sql;
|
|
12727
12988
|
agg: (expr: Sql) => Sql;
|
|
12728
|
-
objectFromColumns: (
|
|
12989
|
+
objectFromColumns: (pairs: [string, Sql][]) => Sql;
|
|
12729
12990
|
extract: (column: Sql, path: string[]) => Sql;
|
|
12730
12991
|
extractText: (column: Sql, path: string[]) => Sql;
|
|
12731
12992
|
numberAtPath: (column: Sql, path: string[]) => Sql;
|
|
@@ -12852,6 +13113,7 @@ declare class MySQLAdapter implements DatabaseAdapter {
|
|
|
12852
13113
|
}
|
|
12853
13114
|
//#endregion
|
|
12854
13115
|
//#region src/adapters/databases/postgres/postgres-adapter.d.ts
|
|
13116
|
+
declare function postgresAsciiCaseFold(expr: Sql): Sql;
|
|
12855
13117
|
declare function postgresJsonObject(pairs: [string, Sql][]): Sql;
|
|
12856
13118
|
declare class PostgresAdapter implements DatabaseAdapter {
|
|
12857
13119
|
#private;
|
|
@@ -12872,9 +13134,9 @@ declare class PostgresAdapter implements DatabaseAdapter {
|
|
|
12872
13134
|
json: (v: unknown) => Sql;
|
|
12873
13135
|
decimal: (canonical: string, descriptor: DecimalDescriptor) => Sql;
|
|
12874
13136
|
id: (physical: string | Uint8Array, representation: IdRepresentation) => Sql;
|
|
13137
|
+
list: (values: Sql[]) => Sql;
|
|
12875
13138
|
value: (v: unknown) => Sql;
|
|
12876
13139
|
null: () => Sql;
|
|
12877
|
-
list: (values: Sql[]) => Sql;
|
|
12878
13140
|
};
|
|
12879
13141
|
operators: {
|
|
12880
13142
|
exists: (subquery: Sql) => Sql;
|
|
@@ -12886,8 +13148,6 @@ declare class PostgresAdapter implements DatabaseAdapter {
|
|
|
12886
13148
|
notBetween: (column: Sql, min: Sql, max: Sql) => Sql;
|
|
12887
13149
|
isNull: (expr: Sql) => Sql;
|
|
12888
13150
|
isNotNull: (expr: Sql) => Sql;
|
|
12889
|
-
in: (column: Sql, values: Sql) => Sql;
|
|
12890
|
-
notIn: (column: Sql, values: Sql) => Sql;
|
|
12891
13151
|
like: (column: Sql, pattern: Sql) => Sql;
|
|
12892
13152
|
notLike: (column: Sql, pattern: Sql) => Sql;
|
|
12893
13153
|
ilike: (column: Sql, pattern: Sql) => Sql;
|
|
@@ -12898,6 +13158,8 @@ declare class PostgresAdapter implements DatabaseAdapter {
|
|
|
12898
13158
|
startsWithPrefix: (column: Sql, value: string, nativeType?: NativeTypeDeclaration) => Sql;
|
|
12899
13159
|
exactTextEq: (column: Sql, value: Sql, nativeType?: NativeTypeDeclaration) => Sql;
|
|
12900
13160
|
exactTextIn: (column: Sql, values: Sql, nativeType?: NativeTypeDeclaration) => Sql;
|
|
13161
|
+
in: (column: Sql, values: Sql) => Sql;
|
|
13162
|
+
notIn: (column: Sql, values: Sql) => Sql;
|
|
12901
13163
|
eq: (left: Sql, right: Sql) => Sql;
|
|
12902
13164
|
neq: (left: Sql, right: Sql) => Sql;
|
|
12903
13165
|
lt: (left: Sql, right: Sql) => Sql;
|
|
@@ -12907,7 +13169,7 @@ declare class PostgresAdapter implements DatabaseAdapter {
|
|
|
12907
13169
|
};
|
|
12908
13170
|
expressions: {
|
|
12909
13171
|
caseSensitiveText: (expr: Sql, nativeType?: NativeTypeDeclaration, textOperation?: boolean) => Sql;
|
|
12910
|
-
asciiCaseFold:
|
|
13172
|
+
asciiCaseFold: typeof postgresAsciiCaseFold;
|
|
12911
13173
|
concat: (...parts: Sql[]) => Sql;
|
|
12912
13174
|
greatest: (...exprs: Sql[]) => Sql;
|
|
12913
13175
|
least: (...exprs: Sql[]) => Sql;
|
|
@@ -12936,6 +13198,12 @@ declare class PostgresAdapter implements DatabaseAdapter {
|
|
|
12936
13198
|
count: (expr?: Sql) => Sql;
|
|
12937
13199
|
countDistinct: (expr: Sql) => Sql;
|
|
12938
13200
|
sum: (expr: Sql) => Sql;
|
|
13201
|
+
numberSum: (expr: Sql) => {
|
|
13202
|
+
readonly parts: readonly [high: Sql, low: Sql];
|
|
13203
|
+
readonly value: Sql;
|
|
13204
|
+
readonly order: readonly Sql[];
|
|
13205
|
+
};
|
|
13206
|
+
integerSum?: DatabaseAdapter["aggregates"]["numberSum"] | undefined;
|
|
12939
13207
|
avg: (expr: Sql) => Sql;
|
|
12940
13208
|
};
|
|
12941
13209
|
json: {
|
|
@@ -13074,6 +13342,15 @@ declare class PostgresAdapter implements DatabaseAdapter {
|
|
|
13074
13342
|
//#region src/adapters/databases/sqlite/sqlite-adapter.d.ts
|
|
13075
13343
|
/** Admit the exact TEXT-to-INTEGER cast domain, including its 19-digit edges. */
|
|
13076
13344
|
declare function sqliteIntegerPrecision(coefficient: string): number | undefined;
|
|
13345
|
+
/**
|
|
13346
|
+
* engine-09: a list longer than {@link PLANNED_LIST} whose members are each one
|
|
13347
|
+
* parameter under one spelling — bare, or a decimal's coefficient cast — as
|
|
13348
|
+
* ONE parameter, a JSON array `json_each` reads back and spells per element as
|
|
13349
|
+
* each member was, so `IN` and `NOT IN` keep their answers, NULLs included.
|
|
13350
|
+
* Blobs travel as hex, read through `unhex` (SQLite 3.41). Any other list
|
|
13351
|
+
* keeps a parameter per member.
|
|
13352
|
+
*/
|
|
13353
|
+
declare function sqliteList(members: Sql[]): Sql;
|
|
13077
13354
|
/** Facts a SQLite driver states about its transport. */
|
|
13078
13355
|
interface SQLiteAdapterOptions {
|
|
13079
13356
|
/**
|
|
@@ -13105,8 +13382,8 @@ declare class SQLiteAdapter implements DatabaseAdapter {
|
|
|
13105
13382
|
dateTime: (iso: string, nativeType?: NativeTypeDeclaration) => Sql;
|
|
13106
13383
|
decimal: (canonical: string, descriptor: DecimalDescriptor) => Sql;
|
|
13107
13384
|
id: (physical: string | Uint8Array, _representation: IdRepresentation) => Sql;
|
|
13385
|
+
list: typeof sqliteList;
|
|
13108
13386
|
null: () => Sql;
|
|
13109
|
-
list: (values: Sql[]) => Sql;
|
|
13110
13387
|
};
|
|
13111
13388
|
operators: {
|
|
13112
13389
|
exists: (subquery: Sql) => Sql;
|
|
@@ -13163,9 +13440,19 @@ declare class SQLiteAdapter implements DatabaseAdapter {
|
|
|
13163
13440
|
aggregates: {
|
|
13164
13441
|
decimalAvg: (column: Sql, _descriptor: DecimalDescriptor) => Sql;
|
|
13165
13442
|
decimalSumOperandPrecision: typeof sqliteIntegerPrecision;
|
|
13443
|
+
integerSum: (column: Sql) => {
|
|
13444
|
+
parts: readonly [Sql, Sql];
|
|
13445
|
+
value: Sql;
|
|
13446
|
+
order: Sql[];
|
|
13447
|
+
};
|
|
13166
13448
|
count: (expr?: Sql) => Sql;
|
|
13167
13449
|
countDistinct: (expr: Sql) => Sql;
|
|
13168
13450
|
sum: (expr: Sql) => Sql;
|
|
13451
|
+
numberSum: (expr: Sql) => {
|
|
13452
|
+
readonly parts: readonly [high: Sql, low: Sql];
|
|
13453
|
+
readonly value: Sql;
|
|
13454
|
+
readonly order: readonly Sql[];
|
|
13455
|
+
};
|
|
13169
13456
|
avg: (expr: Sql) => Sql;
|
|
13170
13457
|
min: (expr: Sql, boolean?: boolean) => Sql;
|
|
13171
13458
|
max: (expr: Sql, boolean?: boolean) => Sql;
|
|
@@ -13179,7 +13466,7 @@ declare class SQLiteAdapter implements DatabaseAdapter {
|
|
|
13179
13466
|
array: (items: Sql[]) => Sql;
|
|
13180
13467
|
emptyArray: () => Sql;
|
|
13181
13468
|
agg: (expr: Sql) => Sql;
|
|
13182
|
-
objectFromColumns: (
|
|
13469
|
+
objectFromColumns: (pairs: [string, Sql][]) => Sql;
|
|
13183
13470
|
extract: (column: Sql, path: string[]) => Sql;
|
|
13184
13471
|
extractText: (column: Sql, path: string[]) => Sql;
|
|
13185
13472
|
numberAtPath: (column: Sql, path: string[]) => Sql;
|
|
@@ -13310,4 +13597,4 @@ declare const mysqlAdapter: MySQLAdapter;
|
|
|
13310
13597
|
declare const postgresAdapter: PostgresAdapter;
|
|
13311
13598
|
declare const sqliteAdapter: SQLiteAdapter;
|
|
13312
13599
|
//#endregion
|
|
13313
|
-
export {
|
|
13600
|
+
export { SchemaRegistryOperation as $, GeneratorDefaultBrand as $n, InvalidTransactionInputError as $r, EmptyClientExtensionState as $t, Schema$1 as A, CacheOperationNotCacheableError as Ai, Dialect as An, BaseBigIntSchema as Ar, getOperationPayloadSchema as At, LinkedClientConfig as B, GeoBounds as Bi, isFieldRef as Bn, JsonNullSentinel as Br, VibORMConfig as Bt, Client as C, isForeignKeyError as Ci, WithCacheOptions as Cn, IsoTimestampSchema as Cr, BooleanScalar as Ct, OperationPayloadSchema as D, CacheConfigurationError as Di, TransactionOptionSupport as Dn, BooleanSchema as Dr, ModelToManyRelation as Dt, OperationPayload as E, isValueTooLongError as Ei, DriverTransactionOptions as En, BaseBooleanSchema as Er, ReferencesStage as Et, GroupByResultType as F, isVibORMError as Fi, StringSchema as Fn, AnyJsonNullSentinel as Fr, ExtendedClient as Ft, VariantToOneRelation as G, MYSQL as Gi, InitialModelState as Gn, Getter as Gr, NoControls as Gt, RelationLinks as H, GeoPolygon as Hi, IndexDefinition as Hn, JsonSchema$1 as Hr, defaultOmit as Ht, InferSelectInclude as I, toPrismaErrorCode as Ii, AnyFieldRef as In, AnyNull as Ir, ExtendedOperationResult as It, InferInput as J, PG as Ji, ModelState as Jn, RelationCardinality as Jr, defineExtension as Jt, Scalar as K, NativeType as Ki, Model$1 as Kn, JunctionReferentialAction as Kr, PlacedControl as Kt, ClientSchema as L, wrapError as Li, FieldRef as Ln, DbNull as Lr, ExtensionState as Lt, AggregateResultType as M, VibORMError as Mi, QueryResult as Mn, createJsonSchemaConverter as Mr, renderSchemaType as Mt, BatchPayload as N, VibORMErrorCode as Ni, V$1 as Nn, toJsonSchema as Nr, validateOperationPayload as Nt, OperationResult as O, CacheInvalidKeyError as Oi, BatchQuery as On, BaseBlobSchema as Or, s as Ot, CountResultType as P, isRetryableError as Pi, v as Pn, createSchemaRegistry as Pr, DriverConfig as Pt, SchemaRegistryLookup as Q, AutoGenerateType as Qn, isValidationError as Qr, ClientExtensionState as Qt, FlatSchema as R, DiagnosticDisclosure as Ri, ModelFieldRefs as Rn, JsonNull as Rr, NoExtraDriverConfigKeys as Rt, CachedClient as S, isCheckConstraintError as Si, CacheInvalidationOptions as Sn, IsoTimeSchema as Sr, DateScalar as St, MutationOperations as T, isUniqueConstraintError as Ti, BatchTransactionOptions as Tn, EnumSchema as Tr, ModelToOneRelation as Tt, ModelShape as U, DecimalDescriptor as Ui, IndexOptions as Un, inferred as Ur, OfficialCacheExtension as Ut, type Links as V, GeoPoint as Vi, AnyModel as Vn, isJsonNullSentinel as Vr, createClient as Vt, VariantToManyRelation as W, Decimal as Wi, IndexType as Wn, AnyRelation as Wr, DefinitionControls as Wt, ParseResult as X, DecimalSchema as Xn, ValidationError as Xr, StatementHandler as Xt, InferOutput as Y, SQLITE as Yi, UpdateState as Yn, RelationSlot as Yr, StatementContext as Yt, Prettify as Z, AutoGenerate as Zn, ValidationErrorSource as Zr, AccumulatedExtensionState as Zt, ObservationCompletion as _, CheckConstraintError as _i, isPendingOperation as _n, JsonValue as _r, IntScalar as _t, PostgresAdapter as a, NestedWriteError as ai, validateSchema as an, BaseVectorSchema as ar, ModelRelationNestedInput as at, OFFICIAL_INSTRUMENTATION_NAME as b, UniqueConstraintError as bi, CacheSetOptions as bn, BaseIsoTimestampSchema as br, TimeScalar as bt, Operation as c, QueryEngineError as ci, isSchemaValidationError as cn, PointSchema as cr, ScalarSchemas as ct, MigrationSessionAttestation as d, isClientInitializationError as di, ValidationResult$1 as dn, BaseNumberSchema as dr, NumericScalar as dt, TransactionError as ei, ExtensionCacheState as en, InitialScalarState as er, VibSchema as et, SQLITE_MIGRATION_CAPABILITY as f, isNotFoundError as fi, DateTimePhysicalForm as fn, IntegerSchema as fr, VectorScalar as ft, MigrationNamespaceAttestation as g, isMigrationError as gi, UnwrapPendingOperations as gn, JsonSchema as gr, JsonScalar as gt, DriverResultParser as h, MigrationError as hi, UnwrapPendingOperation as hn, InputJsonValue as hr, NumberScalar as ht, SQLiteAdapter as i, NestedWriteAssertionError as ii, RawOperation as in, parse as ir, ModelOperationInput as it, ValidatedOperationPayload as j, PrismaErrorCode as ji, QueryExecutionContext as jn, BigIntSchema as jr, renderOperationResultType as jt, Operations as k, CacheInvalidTTLError as ki, CommittedBatchNotification as kn, BlobSchema as kr, getSchemas as kt, AnyDriver as l, QueryError as li, SchemaValidationIssue as ln, ObjectSchema as lr, ArgsSchemas as lt, PinnedSessionReservation as m, isUnsupportedOperationError as mi, PendingOperation as mn, BaseJsonSchema as mr, PointScalar as mt, postgresAdapter as n, ConnectionError as ni, ExtensionResultConsumerState as nn, ScalarType as nr, ModelCoreInput as nt, MySQLAdapter as o, NotFoundError as oi, validateSchemaOrThrow as on, VectorSchema as or, ModelSchemas as ot, SqliteMigrationCapability as p, isPendingOperationError as pi, Schema$3 as pn, NumberSchema as pr, StringScalar as pt, BigIntScalar as q, NativeTypeMap as qi, ModelInternal as qn, ReferentialAction as qr, ClientExtension as qt, sqliteAdapter as r, FeatureNotSupportedError as ri, MergeExtensionState as rn, UpdateState$1 as rr, ModelCoreSchemas as rt, DatabaseAdapter as s, PendingOperationError as si, SchemaValidationError as sn, BasePointSchema as sr, ModelStateSchemas as st, mysqlAdapter as t, ClientInitializationError as ti, ExtensionContributionState as tn, ScalarState as tr, ModelArgsSchemas as tt, Driver as u, UnsupportedOperationError as ui, Severity as un, BaseIntegerSchema as ur, CoreSchemas as ut, ObservationUnit as v, ForeignKeyError as vi, CacheDriver as vn, BaseIsoDateSchema as vr, EnumScalar as vt, InferDatabase as w, isNotNullConstraintError as wi, sqliteResultParser as wn, BaseEnumSchema as wr, BlobScalar as wt, CacheableOperations as x, ValueTooLongError as xi, WaitUntilFn as xn, IsoDateSchema as xr, DateTimeScalar as xt, ObserveHandler as y, NotNullConstraintError as yi, CacheEntry as yn, BaseIsoTimeSchema as yr, DecimalScalar as yt, Linked as z, GeoArea as zi, createModelFieldRefs as zn, JsonNullKind as zr, VibORMClient as zt };
|