@hot-updater/server 0.33.2 → 0.35.0
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/_virtual/_rolldown/runtime.cjs +0 -2
- package/dist/adapters/drizzle.cjs +195 -2
- package/dist/adapters/drizzle.d.cts +7 -4
- package/dist/adapters/drizzle.d.mts +7 -4
- package/dist/adapters/drizzle.mjs +194 -2
- package/dist/adapters/drizzleLazyDB.cjs +53 -0
- package/dist/adapters/drizzleLazyDB.mjs +53 -0
- package/dist/adapters/kysely.cjs +154 -3
- package/dist/adapters/kysely.d.cts +18 -10
- package/dist/adapters/kysely.d.mts +18 -10
- package/dist/adapters/kysely.mjs +153 -3
- package/dist/adapters/mongodb.cjs +183 -2
- package/dist/adapters/mongodb.d.cts +5 -4
- package/dist/adapters/mongodb.d.mts +5 -4
- package/dist/adapters/mongodb.mjs +183 -2
- package/dist/adapters/prisma.cjs +200 -2
- package/dist/adapters/prisma.d.cts +9 -4
- package/dist/adapters/prisma.d.mts +9 -4
- package/dist/adapters/prisma.mjs +199 -2
- package/dist/{runtime.cjs → createHotUpdaterCore.cjs} +34 -12
- package/dist/createHotUpdaterCore.d.cts +25 -0
- package/dist/createHotUpdaterCore.d.mts +25 -0
- package/dist/{runtime.mjs → createHotUpdaterCore.mjs} +34 -10
- package/dist/db/bundleRows.cjs +82 -0
- package/dist/db/bundleRows.d.cts +33 -0
- package/dist/db/bundleRows.d.mts +33 -0
- package/dist/db/bundleRows.mjs +79 -0
- package/dist/db/createBundleDiff.cjs +1 -1
- package/dist/db/createBundleDiff.mjs +1 -1
- package/dist/db/fixedMigrator.cjs +136 -0
- package/dist/db/fixedMigrator.mjs +135 -0
- package/dist/db/index.cjs +24 -42
- package/dist/db/index.d.cts +7 -26
- package/dist/db/index.d.mts +7 -26
- package/dist/db/index.mjs +19 -41
- package/dist/db/pluginCore.cjs +13 -5
- package/dist/db/pluginCore.mjs +13 -5
- package/dist/db/schema/mongodb.cjs +17 -0
- package/dist/db/schema/mongodb.mjs +17 -0
- package/dist/db/schema/registry.cjs +23 -0
- package/dist/db/schema/registry.mjs +18 -0
- package/dist/db/schema/sql.cjs +84 -0
- package/dist/db/schema/sql.mjs +78 -0
- package/dist/db/schema/sqlMigrations.cjs +74 -0
- package/dist/db/schema/sqlMigrations.mjs +73 -0
- package/dist/db/schema/sqlOperations.cjs +27 -0
- package/dist/db/schema/sqlOperations.mjs +26 -0
- package/dist/db/schemaEnhancements.cjs +1 -152
- package/dist/db/schemaEnhancements.mjs +1 -149
- package/dist/db/schemaGenerators.cjs +222 -0
- package/dist/db/schemaGenerators.mjs +220 -0
- package/dist/db/schemaReadiness.cjs +23 -0
- package/dist/db/schemaReadiness.d.cts +8 -0
- package/dist/db/schemaReadiness.d.mts +8 -0
- package/dist/db/schemaReadiness.mjs +22 -0
- package/dist/db/types.cjs +10 -2
- package/dist/db/types.d.cts +58 -14
- package/dist/db/types.d.mts +58 -14
- package/dist/db/types.mjs +9 -1
- package/dist/index.cjs +2 -6
- package/dist/index.d.cts +3 -5
- package/dist/index.d.mts +3 -5
- package/dist/index.mjs +2 -4
- package/dist/node.cjs +2 -0
- package/dist/node.d.cts +7 -3
- package/dist/node.d.mts +7 -3
- package/dist/node.mjs +2 -1
- package/dist/{packages/server/package.cjs → package.cjs} +1 -1
- package/dist/{packages/server/package.mjs → package.mjs} +1 -1
- package/dist/schema/dsl.cjs +86 -0
- package/dist/schema/dsl.mjs +73 -0
- package/dist/schema/index.cjs +13 -0
- package/dist/schema/index.mjs +13 -0
- package/dist/schema/settings.cjs +9 -0
- package/dist/schema/settings.mjs +9 -0
- package/dist/schema/types.cjs +6 -0
- package/dist/schema/types.mjs +5 -0
- package/dist/schema/v0_21_0.cjs +33 -18
- package/dist/schema/v0_21_0.mjs +32 -18
- package/dist/schema/v0_29_0.cjs +40 -20
- package/dist/schema/v0_29_0.mjs +39 -20
- package/dist/schema/v0_31_0.cjs +77 -43
- package/dist/schema/v0_31_0.mjs +75 -43
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +34 -20
- package/src/adapters/drizzle.spec.ts +76 -0
- package/src/adapters/drizzle.ts +328 -12
- package/src/adapters/drizzleLazyDB.ts +151 -0
- package/src/adapters/kysely.spec.ts +107 -0
- package/src/adapters/kysely.ts +349 -14
- package/src/adapters/mongodb.ts +298 -15
- package/src/adapters/prisma.ts +337 -12
- package/src/createHotUpdaterCore.ts +168 -0
- package/src/db/bundleRows.ts +140 -0
- package/src/db/fixedMigrator.spec.ts +89 -0
- package/src/db/fixedMigrator.ts +288 -0
- package/src/db/hotUpdaterSchema.ts +6 -0
- package/src/db/index.spec.ts +983 -19
- package/src/db/index.ts +37 -108
- package/src/db/pluginCore.spec.ts +17 -11
- package/src/db/pluginCore.ts +15 -6
- package/src/db/schema/definitions.ts +1 -0
- package/src/db/schema/mongodb.ts +26 -0
- package/src/db/schema/registry.ts +55 -0
- package/src/db/schema/sql.ts +200 -0
- package/src/db/schema/sqlMigrations.ts +219 -0
- package/src/db/schema/sqlOperations.ts +62 -0
- package/src/db/schema/types.ts +1 -0
- package/src/db/schemaEnhancements.ts +0 -405
- package/src/db/schemaGenerators.ts +382 -0
- package/src/db/schemaReadiness.ts +33 -0
- package/src/db/types.ts +69 -25
- package/src/handler-standalone.integration.spec.ts +3 -2
- package/src/index.ts +9 -3
- package/src/node.spec.ts +50 -0
- package/src/node.ts +7 -3
- package/src/runtime.spec.ts +132 -1
- package/src/schema/dsl-all-versions.spec.ts +26 -0
- package/src/schema/dsl.ts +148 -0
- package/src/schema/index.ts +16 -0
- package/src/schema/settings.ts +15 -0
- package/src/schema/types.ts +73 -0
- package/src/schema/v0_21_0.ts +48 -18
- package/src/schema/v0_29_0.ts +58 -22
- package/src/schema/v0_31_0.spec.ts +73 -0
- package/src/schema/v0_31_0.ts +116 -54
- package/src/types/index.ts +1 -1
- package/dist/_virtual/_rolldown/runtime.mjs +0 -6
- package/dist/calculatePagination.cjs +0 -25
- package/dist/calculatePagination.mjs +0 -25
- package/dist/db/ormCore.cjs +0 -577
- package/dist/db/ormCore.d.cts +0 -110
- package/dist/db/ormCore.d.mts +0 -110
- package/dist/db/ormCore.mjs +0 -575
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/_u64.cjs +0 -112
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/_u64.mjs +0 -108
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/cryptoNode.cjs +0 -22
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/cryptoNode.mjs +0 -18
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/sha3.cjs +0 -219
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/sha3.mjs +0 -214
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/utils.cjs +0 -275
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/utils.mjs +0 -270
- package/dist/node_modules/.pnpm/@paralleldrive_cuid2@2.3.1/node_modules/@paralleldrive/cuid2/index.cjs +0 -17
- package/dist/node_modules/.pnpm/@paralleldrive_cuid2@2.3.1/node_modules/@paralleldrive/cuid2/index.mjs +0 -13
- package/dist/node_modules/.pnpm/@paralleldrive_cuid2@2.3.1/node_modules/@paralleldrive/cuid2/src/index.cjs +0 -69
- package/dist/node_modules/.pnpm/@paralleldrive_cuid2@2.3.1/node_modules/@paralleldrive/cuid2/src/index.mjs +0 -65
- package/dist/node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare_workers-types@4.20260611.1_@electric-sql_pglite@0.4.1_@l_601a3995dfc55b0b7fac93cbe1e76579/node_modules/drizzle-orm/column.cjs +0 -52
- package/dist/node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare_workers-types@4.20260611.1_@electric-sql_pglite@0.4.1_@l_601a3995dfc55b0b7fac93cbe1e76579/node_modules/drizzle-orm/column.mjs +0 -52
- package/dist/node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare_workers-types@4.20260611.1_@electric-sql_pglite@0.4.1_@l_601a3995dfc55b0b7fac93cbe1e76579/node_modules/drizzle-orm/entity.cjs +0 -16
- package/dist/node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare_workers-types@4.20260611.1_@electric-sql_pglite@0.4.1_@l_601a3995dfc55b0b7fac93cbe1e76579/node_modules/drizzle-orm/entity.mjs +0 -15
- package/dist/node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare_workers-types@4.20260611.1_@electric-sql_pglite@0.4.1_@l_601a3995dfc55b0b7fac93cbe1e76579/node_modules/drizzle-orm/pg-core/columns/enum.cjs +0 -7
- package/dist/node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare_workers-types@4.20260611.1_@electric-sql_pglite@0.4.1_@l_601a3995dfc55b0b7fac93cbe1e76579/node_modules/drizzle-orm/pg-core/columns/enum.mjs +0 -7
- package/dist/node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare_workers-types@4.20260611.1_@electric-sql_pglite@0.4.1_@l_601a3995dfc55b0b7fac93cbe1e76579/node_modules/drizzle-orm/sql/expressions/conditions.cjs +0 -92
- package/dist/node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare_workers-types@4.20260611.1_@electric-sql_pglite@0.4.1_@l_601a3995dfc55b0b7fac93cbe1e76579/node_modules/drizzle-orm/sql/expressions/conditions.mjs +0 -78
- package/dist/node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare_workers-types@4.20260611.1_@electric-sql_pglite@0.4.1_@l_601a3995dfc55b0b7fac93cbe1e76579/node_modules/drizzle-orm/sql/expressions/select.cjs +0 -11
- package/dist/node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare_workers-types@4.20260611.1_@electric-sql_pglite@0.4.1_@l_601a3995dfc55b0b7fac93cbe1e76579/node_modules/drizzle-orm/sql/expressions/select.mjs +0 -10
- package/dist/node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare_workers-types@4.20260611.1_@electric-sql_pglite@0.4.1_@l_601a3995dfc55b0b7fac93cbe1e76579/node_modules/drizzle-orm/sql/sql.cjs +0 -383
- package/dist/node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare_workers-types@4.20260611.1_@electric-sql_pglite@0.4.1_@l_601a3995dfc55b0b7fac93cbe1e76579/node_modules/drizzle-orm/sql/sql.mjs +0 -366
- package/dist/node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare_workers-types@4.20260611.1_@electric-sql_pglite@0.4.1_@l_601a3995dfc55b0b7fac93cbe1e76579/node_modules/drizzle-orm/subquery.cjs +0 -17
- package/dist/node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare_workers-types@4.20260611.1_@electric-sql_pglite@0.4.1_@l_601a3995dfc55b0b7fac93cbe1e76579/node_modules/drizzle-orm/subquery.mjs +0 -17
- package/dist/node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare_workers-types@4.20260611.1_@electric-sql_pglite@0.4.1_@l_601a3995dfc55b0b7fac93cbe1e76579/node_modules/drizzle-orm/table.cjs +0 -60
- package/dist/node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare_workers-types@4.20260611.1_@electric-sql_pglite@0.4.1_@l_601a3995dfc55b0b7fac93cbe1e76579/node_modules/drizzle-orm/table.mjs +0 -59
- package/dist/node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare_workers-types@4.20260611.1_@electric-sql_pglite@0.4.1_@l_601a3995dfc55b0b7fac93cbe1e76579/node_modules/drizzle-orm/table.utils.cjs +0 -4
- package/dist/node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare_workers-types@4.20260611.1_@electric-sql_pglite@0.4.1_@l_601a3995dfc55b0b7fac93cbe1e76579/node_modules/drizzle-orm/table.utils.mjs +0 -4
- package/dist/node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare_workers-types@4.20260611.1_@electric-sql_pglite@0.4.1_@l_601a3995dfc55b0b7fac93cbe1e76579/node_modules/drizzle-orm/tracing.cjs +0 -6
- package/dist/node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare_workers-types@4.20260611.1_@electric-sql_pglite@0.4.1_@l_601a3995dfc55b0b7fac93cbe1e76579/node_modules/drizzle-orm/tracing.mjs +0 -6
- package/dist/node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare_workers-types@4.20260611.1_@electric-sql_pglite@0.4.1_@l_601a3995dfc55b0b7fac93cbe1e76579/node_modules/drizzle-orm/view-common.cjs +0 -4
- package/dist/node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare_workers-types@4.20260611.1_@electric-sql_pglite@0.4.1_@l_601a3995dfc55b0b7fac93cbe1e76579/node_modules/drizzle-orm/view-common.mjs +0 -4
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/adapters/drizzle/index.cjs +0 -383
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/adapters/drizzle/index.d.cts +0 -12
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/adapters/drizzle/index.d.mts +0 -12
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/adapters/drizzle/index.mjs +0 -383
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/adapters/kysely/index.cjs +0 -4
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/adapters/kysely/index.mjs +0 -5
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/adapters/prisma/index.cjs +0 -339
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/adapters/prisma/index.d.cts +0 -70
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/adapters/prisma/index.d.mts +0 -70
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/adapters/prisma/index.mjs +0 -339
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/chunk-7PZK4ONR.cjs +0 -57
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/chunk-7PZK4ONR.mjs +0 -56
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/chunk-C6OTUURW.cjs +0 -330
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/chunk-C6OTUURW.mjs +0 -326
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/chunk-CHTIKPQU.cjs +0 -166
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/chunk-CHTIKPQU.mjs +0 -163
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/chunk-GUE4GMNC.cjs +0 -14
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/chunk-GUE4GMNC.mjs +0 -13
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/chunk-LHHP6UVP.cjs +0 -24
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/chunk-LHHP6UVP.mjs +0 -24
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/chunk-LVCPMTAT.cjs +0 -1190
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/chunk-LVCPMTAT.mjs +0 -1189
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/chunk-PK2W2SQ7.cjs +0 -197
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/chunk-PK2W2SQ7.mjs +0 -197
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/chunk-ZEQMAIFI.cjs +0 -410
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/chunk-ZEQMAIFI.mjs +0 -400
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/chunk-ZOCGSAWS.cjs +0 -213
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/chunk-ZOCGSAWS.mjs +0 -212
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/create-tg0451Y_.d.cts +0 -285
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/create-tg0451Y_.d.mts +0 -285
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/index-CMqePMTF.d.cts +0 -45
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/index-CMqePMTF.d.mts +0 -45
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/index.cjs +0 -69
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/index.d.cts +0 -49
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/index.d.mts +0 -49
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/index.mjs +0 -67
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/query/index.d.cts +0 -156
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/query/index.d.mts +0 -156
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/schema/index.cjs +0 -1
- package/dist/node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk_credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/schema/index.mjs +0 -2
- package/dist/runtime.d.cts +0 -22
- package/dist/runtime.d.mts +0 -22
- package/src/db/ormCore.ts +0 -1059
- package/src/db/ormUpdateCheck.bench.ts +0 -262
- package/src/runtime.ts +0 -106
|
@@ -1,410 +0,0 @@
|
|
|
1
|
-
require("../../../../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
-
const require_index = require("../../../../@paralleldrive_cuid2@2.3.1/node_modules/@paralleldrive/cuid2/index.cjs");
|
|
3
|
-
let semver = require("semver");
|
|
4
|
-
//#region ../../node_modules/.pnpm/fumadb@0.2.2_mongodb@6.20.0_@aws-sdk+credential-providers@3.1066.0_socks@2.8.9__prisma@_ee79457f0e32f18f0beb5c2db02e4f73/node_modules/fumadb/dist/chunk-ZEQMAIFI.js
|
|
5
|
-
var import_cuid2 = require_index.default;
|
|
6
|
-
function deepEqual(a, b) {
|
|
7
|
-
if (a === b) return true;
|
|
8
|
-
if (typeof a !== typeof b) return false;
|
|
9
|
-
if (Array.isArray(a) && Array.isArray(b)) {
|
|
10
|
-
if (a.length !== b.length) return false;
|
|
11
|
-
for (let i = 0; i < a.length; i++) if (!deepEqual(a[i], b[i])) return false;
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
if (typeof a === "object" && typeof b === "object") {
|
|
15
|
-
const aKeys = Object.keys(a);
|
|
16
|
-
const bKeys = Object.keys(b);
|
|
17
|
-
if (aKeys.length !== bKeys.length) return false;
|
|
18
|
-
for (const key of aKeys) {
|
|
19
|
-
if (!(key in b)) return false;
|
|
20
|
-
if (!Object.hasOwn(b, key) || !deepEqual(a[key], b[key])) return false;
|
|
21
|
-
}
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
function validateSchema(schema2) {
|
|
27
|
-
if (!(0, semver.valid)(schema2.version)) throw new Error(`the version ${schema2.version} is invalid.`);
|
|
28
|
-
const tables = Object.values(schema2.tables);
|
|
29
|
-
function validateForeignKey(key) {
|
|
30
|
-
if (key.table === key.referencedTable && (key.onUpdate !== "RESTRICT" || key.onDelete !== "RESTRICT")) throw new Error(`[${key.name}] Due to the limitations of MSSQL & Prisma MongoDB, you cannot specify other foreign key actions than "RESTRICT" for self-referencing foreign keys.`);
|
|
31
|
-
for (const col of key.columns) if (!col.isNullable && (key.onUpdate === "SET NULL" || key.onDelete === "SET NULL")) throw new Error(`[${key.name}] You are using "SET NULL" as foreign key action, but some columns are non-nullable.`);
|
|
32
|
-
}
|
|
33
|
-
function isCompositeColumnsUnique(table2, columns) {
|
|
34
|
-
if (columns.length === 1 && columns[0] instanceof IdColumn) return true;
|
|
35
|
-
const columnNames = columns.map((col) => col.ormName);
|
|
36
|
-
for (const con of table2.getUniqueConstraints()) if (deepEqual(con.columns.map((col) => col.ormName), columnNames)) return true;
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
function validateRelation(relation) {
|
|
40
|
-
if (!relation.implied && !relation.foreignKey) throw new Error(`[${relation.name}] You must define foreign key for explicit relations due the limitations of Prisma.`);
|
|
41
|
-
if (relation.implied) return;
|
|
42
|
-
if (relation.implying?.type === "one" && !isCompositeColumnsUnique(relation.referencer, relation.on.map(([left]) => relation.referencer.columns[left]))) throw new Error(`[${relation.name}] one-to-one relations require both sides to be unique or primary key.`);
|
|
43
|
-
if (!isCompositeColumnsUnique(relation.table, relation.on.map(([, right]) => relation.table.columns[right]))) throw new Error(`[${relation.name}] For any explicit relations, the referenced columns must be unique or primary key.`);
|
|
44
|
-
}
|
|
45
|
-
for (const table2 of tables) {
|
|
46
|
-
for (const foreignKey of table2.foreignKeys) validateForeignKey(foreignKey);
|
|
47
|
-
for (const relation of Object.values(table2.relations)) validateRelation(relation);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
var RelationInit = class {
|
|
51
|
-
type;
|
|
52
|
-
referencedTable;
|
|
53
|
-
referencer;
|
|
54
|
-
constructor(type, referencedTable, referencer) {
|
|
55
|
-
this.type = type;
|
|
56
|
-
this.referencedTable = referencedTable;
|
|
57
|
-
this.referencer = referencer;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
var ImplicitRelationInit = class extends RelationInit {
|
|
61
|
-
init(ormName, impliedBy) {
|
|
62
|
-
const output = {
|
|
63
|
-
id: impliedBy.id,
|
|
64
|
-
on: impliedBy.on.map(([left, right]) => [right, left]),
|
|
65
|
-
type: this.type,
|
|
66
|
-
table: this.referencedTable,
|
|
67
|
-
implied: true,
|
|
68
|
-
impliedBy,
|
|
69
|
-
name: ormName,
|
|
70
|
-
referencer: this.referencer
|
|
71
|
-
};
|
|
72
|
-
impliedBy.implying = output;
|
|
73
|
-
return output;
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
var ExplicitRelationInit = class extends RelationInit {
|
|
77
|
-
foreignKeyConfig;
|
|
78
|
-
implyingRelationName;
|
|
79
|
-
on = [];
|
|
80
|
-
imply(implyingRelationName) {
|
|
81
|
-
this.implyingRelationName = implyingRelationName;
|
|
82
|
-
return this;
|
|
83
|
-
}
|
|
84
|
-
initForeignKey(ormName) {
|
|
85
|
-
const config = this.foreignKeyConfig;
|
|
86
|
-
if (!config) return;
|
|
87
|
-
const columns = [];
|
|
88
|
-
const referencedColumns = [];
|
|
89
|
-
for (const [left, right] of this.on) {
|
|
90
|
-
columns.push(this.referencer.columns[left]);
|
|
91
|
-
referencedColumns.push(this.referencedTable.columns[right]);
|
|
92
|
-
}
|
|
93
|
-
return {
|
|
94
|
-
columns,
|
|
95
|
-
referencedColumns,
|
|
96
|
-
referencedTable: this.referencedTable,
|
|
97
|
-
table: this.referencer,
|
|
98
|
-
name: config.name ?? `${this.referencer.ormName}_${this.referencedTable.ormName}_${ormName}_fk`,
|
|
99
|
-
onDelete: config.onDelete ?? "RESTRICT",
|
|
100
|
-
onUpdate: config.onUpdate ?? "RESTRICT"
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
init(ormName) {
|
|
104
|
-
let id = `${this.referencer.ormName}_${this.referencedTable.ormName}`;
|
|
105
|
-
if (this.implyingRelationName) id += `_${this.implyingRelationName}`;
|
|
106
|
-
return {
|
|
107
|
-
id,
|
|
108
|
-
implied: false,
|
|
109
|
-
foreignKey: this.initForeignKey(ormName),
|
|
110
|
-
implying: void 0,
|
|
111
|
-
on: this.on,
|
|
112
|
-
name: ormName,
|
|
113
|
-
referencer: this.referencer,
|
|
114
|
-
table: this.referencedTable,
|
|
115
|
-
type: this.type
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Define foreign key for explicit relation, please note that:
|
|
120
|
-
*
|
|
121
|
-
* - this constraint is ignored for MongoDB (without Prisma).
|
|
122
|
-
* - you **must** define foreign key for explicit relations, due to the limitations of Prisma.
|
|
123
|
-
*/
|
|
124
|
-
foreignKey(config = {}) {
|
|
125
|
-
this.foreignKeyConfig = config;
|
|
126
|
-
return this;
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
var Column = class _Column {
|
|
130
|
-
type;
|
|
131
|
-
ormName = "";
|
|
132
|
-
isNullable = false;
|
|
133
|
-
isUnique = false;
|
|
134
|
-
default;
|
|
135
|
-
table = void 0;
|
|
136
|
-
initNames;
|
|
137
|
-
get names() {
|
|
138
|
-
return this.initNames(this.ormName);
|
|
139
|
-
}
|
|
140
|
-
set names(v) {
|
|
141
|
-
this.initNames = () => v;
|
|
142
|
-
}
|
|
143
|
-
constructor(type, onInitNames) {
|
|
144
|
-
this.type = type;
|
|
145
|
-
this.initNames = onInitNames;
|
|
146
|
-
}
|
|
147
|
-
nullable(nullable) {
|
|
148
|
-
this.isNullable = nullable ?? true;
|
|
149
|
-
return this;
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Add unique constraint to the field, for consistency, duplicated null values are allowed.
|
|
153
|
-
*/
|
|
154
|
-
unique(unique = true) {
|
|
155
|
-
this.isUnique = unique;
|
|
156
|
-
return this;
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Generate default value on runtime
|
|
160
|
-
*/
|
|
161
|
-
defaultTo$(fn) {
|
|
162
|
-
this.default = { runtime: fn };
|
|
163
|
-
return this;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Set a database-level default value
|
|
167
|
-
*
|
|
168
|
-
* For schemaless database, it's still generated on runtime
|
|
169
|
-
*/
|
|
170
|
-
defaultTo(value) {
|
|
171
|
-
this.default = { value };
|
|
172
|
-
return this;
|
|
173
|
-
}
|
|
174
|
-
clone() {
|
|
175
|
-
const clone = new _Column(this.type, () => this.names);
|
|
176
|
-
clone.ormName = this.ormName;
|
|
177
|
-
clone.isNullable = this.isNullable;
|
|
178
|
-
clone.isUnique = this.isUnique;
|
|
179
|
-
clone.default = this.default;
|
|
180
|
-
clone.table = this.table;
|
|
181
|
-
return clone;
|
|
182
|
-
}
|
|
183
|
-
getUniqueConstraintName() {
|
|
184
|
-
return `unique_c_${this.table.ormName}_${this.ormName}`;
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Generate default value for the column on runtime.
|
|
188
|
-
*/
|
|
189
|
-
generateDefaultValue() {
|
|
190
|
-
if (!this.default) return;
|
|
191
|
-
if ("value" in this.default) return this.default.value;
|
|
192
|
-
if (this.default.runtime === "auto") return (0, import_cuid2.createId)();
|
|
193
|
-
if (this.default.runtime === "now") return new Date(Date.now());
|
|
194
|
-
return this.default.runtime();
|
|
195
|
-
}
|
|
196
|
-
get $in() {
|
|
197
|
-
throw new Error("Type inference only");
|
|
198
|
-
}
|
|
199
|
-
get $out() {
|
|
200
|
-
throw new Error("Type inference only");
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
var IdColumn = class _IdColumn extends Column {
|
|
204
|
-
id = true;
|
|
205
|
-
constructor(type, onInitNames) {
|
|
206
|
-
super(type, (ormName) => ({
|
|
207
|
-
...onInitNames(ormName),
|
|
208
|
-
mongodb: "_id"
|
|
209
|
-
}));
|
|
210
|
-
}
|
|
211
|
-
clone() {
|
|
212
|
-
const clone = new _IdColumn(this.type, () => this.names);
|
|
213
|
-
clone.ormName = this.ormName;
|
|
214
|
-
clone.isNullable = this.isNullable;
|
|
215
|
-
clone.isUnique = this.isUnique;
|
|
216
|
-
clone.default = this.default;
|
|
217
|
-
clone.table = this.table;
|
|
218
|
-
return clone;
|
|
219
|
-
}
|
|
220
|
-
defaultTo$(fn) {
|
|
221
|
-
return super.defaultTo$(fn);
|
|
222
|
-
}
|
|
223
|
-
defaultTo(value) {
|
|
224
|
-
return super.defaultTo(value);
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
function column(name, type) {
|
|
228
|
-
return new Column(type, (ormName) => typeof name === "string" ? nameVariants(name, ormName) : nameVariants(ormName, ormName, name));
|
|
229
|
-
}
|
|
230
|
-
function idColumn(name, type) {
|
|
231
|
-
return new IdColumn(type, (ormName) => typeof name === "string" ? nameVariants(name, ormName) : nameVariants(ormName, ormName, name));
|
|
232
|
-
}
|
|
233
|
-
function relationBuilder(tables, k) {
|
|
234
|
-
const referencer = tables[k];
|
|
235
|
-
return {
|
|
236
|
-
one(another, ...on) {
|
|
237
|
-
if (on.length > 0) {
|
|
238
|
-
const init = new ExplicitRelationInit("one", tables[another], referencer);
|
|
239
|
-
init.on = on;
|
|
240
|
-
return init;
|
|
241
|
-
}
|
|
242
|
-
return new ImplicitRelationInit("one", tables[another], referencer);
|
|
243
|
-
},
|
|
244
|
-
many(another) {
|
|
245
|
-
return new ImplicitRelationInit("many", tables[another], referencer);
|
|
246
|
-
}
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
function table(name, columns) {
|
|
250
|
-
let idCol;
|
|
251
|
-
let names;
|
|
252
|
-
const uniqueConstraints = [];
|
|
253
|
-
const out = {
|
|
254
|
-
ormName: "",
|
|
255
|
-
get names() {
|
|
256
|
-
if (names) return names;
|
|
257
|
-
return typeof name === "string" ? nameVariants(name, out.ormName) : nameVariants(out.ormName, out.ormName, name);
|
|
258
|
-
},
|
|
259
|
-
set names(v) {
|
|
260
|
-
names = v;
|
|
261
|
-
},
|
|
262
|
-
columns,
|
|
263
|
-
relations: {},
|
|
264
|
-
foreignKeys: [],
|
|
265
|
-
getUniqueConstraints(level = "all") {
|
|
266
|
-
const result = [];
|
|
267
|
-
if (level === "all" || level === "table") result.push(...uniqueConstraints);
|
|
268
|
-
if (level === "all" || level === "column") for (const col of Object.values(this.columns)) {
|
|
269
|
-
if (!col.isUnique) continue;
|
|
270
|
-
result.push({
|
|
271
|
-
name: col.getUniqueConstraintName(),
|
|
272
|
-
columns: [col]
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
return result;
|
|
276
|
-
},
|
|
277
|
-
getColumnByName(name2, type = "sql") {
|
|
278
|
-
return Object.values(this.columns).find((c) => c.names[type] === name2);
|
|
279
|
-
},
|
|
280
|
-
getIdColumn() {
|
|
281
|
-
return idCol;
|
|
282
|
-
},
|
|
283
|
-
unique(name2, columns2) {
|
|
284
|
-
uniqueConstraints.push({
|
|
285
|
-
name: name2,
|
|
286
|
-
columns: columns2.map((name3) => {
|
|
287
|
-
const column2 = this.columns[name3];
|
|
288
|
-
if (!column2) throw new Error(`Unknown column name ${name3.toString()}`);
|
|
289
|
-
return column2;
|
|
290
|
-
})
|
|
291
|
-
});
|
|
292
|
-
return this;
|
|
293
|
-
},
|
|
294
|
-
clone() {
|
|
295
|
-
const cloneColumns = {};
|
|
296
|
-
for (const [k, v] of Object.entries(columns)) cloneColumns[k] = v.clone();
|
|
297
|
-
const clone = table(name, cloneColumns);
|
|
298
|
-
for (const con of uniqueConstraints) clone.unique(con.name, con.columns.map((col) => col.ormName));
|
|
299
|
-
return clone;
|
|
300
|
-
}
|
|
301
|
-
};
|
|
302
|
-
for (const k in columns) {
|
|
303
|
-
const column2 = columns[k];
|
|
304
|
-
if (!column2) {
|
|
305
|
-
delete columns[k];
|
|
306
|
-
continue;
|
|
307
|
-
}
|
|
308
|
-
column2.table = out;
|
|
309
|
-
column2.ormName = k;
|
|
310
|
-
if (column2 instanceof IdColumn) idCol = column2;
|
|
311
|
-
}
|
|
312
|
-
if (idCol === void 0) throw new Error(`there's no id column in your table ${name}`);
|
|
313
|
-
return out;
|
|
314
|
-
}
|
|
315
|
-
function schema(config) {
|
|
316
|
-
const { tables, relations } = config;
|
|
317
|
-
for (const k in tables) {
|
|
318
|
-
if (!tables[k]) {
|
|
319
|
-
delete tables[k];
|
|
320
|
-
continue;
|
|
321
|
-
}
|
|
322
|
-
tables[k].ormName = k;
|
|
323
|
-
}
|
|
324
|
-
if (relations) setRelations(tables, relations);
|
|
325
|
-
const out = {
|
|
326
|
-
...config,
|
|
327
|
-
tables: config.tables,
|
|
328
|
-
clone() {
|
|
329
|
-
const cloneTables = {};
|
|
330
|
-
for (const [k, v] of Object.entries(tables)) cloneTables[k] = v.clone();
|
|
331
|
-
return schema({
|
|
332
|
-
...config,
|
|
333
|
-
tables: cloneTables
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
};
|
|
337
|
-
validateSchema(out);
|
|
338
|
-
return out;
|
|
339
|
-
}
|
|
340
|
-
function setRelations(tables, relationsMap) {
|
|
341
|
-
const impliedRelations = [];
|
|
342
|
-
const explicitRelations = [];
|
|
343
|
-
for (const k in relationsMap) {
|
|
344
|
-
const relationFn = relationsMap[k];
|
|
345
|
-
if (!relationFn) continue;
|
|
346
|
-
const table2 = tables[k];
|
|
347
|
-
const relations = relationFn(relationBuilder(tables, k));
|
|
348
|
-
for (const name in relations) {
|
|
349
|
-
const relation = relations[name];
|
|
350
|
-
if (!relation) continue;
|
|
351
|
-
if (relation instanceof ImplicitRelationInit) {
|
|
352
|
-
impliedRelations.push({
|
|
353
|
-
relationName: name,
|
|
354
|
-
relation
|
|
355
|
-
});
|
|
356
|
-
continue;
|
|
357
|
-
}
|
|
358
|
-
if (relation instanceof ExplicitRelationInit) {
|
|
359
|
-
const output = relation.init(name);
|
|
360
|
-
explicitRelations.push({
|
|
361
|
-
relation: output,
|
|
362
|
-
implicitRelationName: relation.implyingRelationName
|
|
363
|
-
});
|
|
364
|
-
table2.relations[name] = output;
|
|
365
|
-
if (output.foreignKey) table2.foreignKeys.push(output.foreignKey);
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
for (const { relation, relationName } of impliedRelations) {
|
|
370
|
-
const referencer = relation.referencer;
|
|
371
|
-
const explicits = explicitRelations.filter((item) => {
|
|
372
|
-
if (item.implicitRelationName) return item.implicitRelationName === relationName;
|
|
373
|
-
return item.relation.table === referencer && item.relation.referencer === relation.referencedTable;
|
|
374
|
-
});
|
|
375
|
-
if (explicits.length !== 1) throw new Error(`Cannot resolve implied relation ${relationName} in table "${relation.referencer.ormName}", you may want to specify \`imply()\` on the explicit relation.`);
|
|
376
|
-
referencer.relations[relationName] = relation.init(relationName, explicits[0].relation);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
function nameVariants(rawName, ormName, names) {
|
|
380
|
-
return {
|
|
381
|
-
convex: ormName,
|
|
382
|
-
drizzle: ormName,
|
|
383
|
-
prisma: ormName,
|
|
384
|
-
mongodb: rawName,
|
|
385
|
-
sql: rawName,
|
|
386
|
-
...names
|
|
387
|
-
};
|
|
388
|
-
}
|
|
389
|
-
function compileForeignKey(key, name) {
|
|
390
|
-
return {
|
|
391
|
-
name: key.name,
|
|
392
|
-
onUpdate: key.onUpdate,
|
|
393
|
-
onDelete: key.onDelete,
|
|
394
|
-
table: key.table.names[name],
|
|
395
|
-
referencedTable: key.referencedTable.names[name],
|
|
396
|
-
referencedColumns: key.referencedColumns.map((col) => col.names[name]),
|
|
397
|
-
columns: key.columns.map((col) => col.names[name])
|
|
398
|
-
};
|
|
399
|
-
}
|
|
400
|
-
//#endregion
|
|
401
|
-
exports.Column = Column;
|
|
402
|
-
exports.ExplicitRelationInit = ExplicitRelationInit;
|
|
403
|
-
exports.IdColumn = IdColumn;
|
|
404
|
-
exports.ImplicitRelationInit = ImplicitRelationInit;
|
|
405
|
-
exports.column = column;
|
|
406
|
-
exports.compileForeignKey = compileForeignKey;
|
|
407
|
-
exports.deepEqual = deepEqual;
|
|
408
|
-
exports.idColumn = idColumn;
|
|
409
|
-
exports.schema = schema;
|
|
410
|
-
exports.table = table;
|