@hot-updater/server 0.30.12 → 0.31.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/_virtual/_rolldown/runtime.cjs +25 -0
- package/dist/_virtual/_rolldown/runtime.mjs +6 -0
- package/dist/adapters/drizzle.cjs +6 -9
- package/dist/adapters/drizzle.d.cts +8 -1
- package/dist/adapters/drizzle.d.mts +8 -1
- package/dist/adapters/drizzle.mjs +5 -2
- package/dist/adapters/kysely.cjs +7 -9
- package/dist/adapters/kysely.d.cts +14 -1
- package/dist/adapters/kysely.d.mts +14 -1
- package/dist/adapters/kysely.mjs +6 -2
- package/dist/adapters/mongodb.cjs +7 -9
- package/dist/adapters/mongodb.d.cts +9 -1
- package/dist/adapters/mongodb.d.mts +9 -1
- package/dist/adapters/mongodb.mjs +5 -2
- package/dist/adapters/prisma.cjs +6 -9
- package/dist/adapters/prisma.d.cts +8 -1
- package/dist/adapters/prisma.d.mts +8 -1
- package/dist/adapters/prisma.mjs +5 -2
- package/dist/db/createBundleDiff.cjs +166 -0
- package/dist/db/createBundleDiff.d.cts +20 -0
- package/dist/db/createBundleDiff.d.mts +20 -0
- package/dist/db/createBundleDiff.mjs +161 -0
- package/dist/db/index.cjs +15 -16
- package/dist/db/index.d.cts +5 -4
- package/dist/db/index.d.mts +5 -4
- package/dist/db/index.mjs +14 -16
- package/dist/db/ormCore.cjs +173 -65
- package/dist/db/ormCore.d.cts +100 -34
- package/dist/db/ormCore.d.mts +100 -34
- package/dist/db/ormCore.mjs +171 -64
- package/dist/db/pluginCore.cjs +37 -3
- package/dist/db/pluginCore.mjs +36 -3
- package/dist/db/schemaEnhancements.cjs +171 -0
- package/dist/db/schemaEnhancements.mjs +167 -0
- package/dist/db/types.cjs +6 -0
- package/dist/db/types.d.cts +19 -7
- package/dist/db/types.d.mts +22 -10
- package/dist/db/types.mjs +6 -1
- package/dist/db/updateArtifacts.cjs +127 -0
- package/dist/db/updateArtifacts.mjs +125 -0
- package/dist/handler.cjs +61 -5
- package/dist/handler.d.cts +2 -2
- package/dist/handler.d.mts +5 -5
- package/dist/handler.mjs +59 -5
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +3 -2
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +2 -1
- package/dist/node.d.cts +0 -1
- package/dist/node.d.mts +0 -1
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/_u64.cjs +112 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/_u64.mjs +108 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/cryptoNode.cjs +22 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/cryptoNode.mjs +18 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/sha3.cjs +219 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/sha3.mjs +214 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/utils.cjs +275 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/utils.mjs +270 -0
- package/dist/node_modules/.pnpm/@paralleldrive_cuid2@2.3.1/node_modules/@paralleldrive/cuid2/index.cjs +17 -0
- package/dist/node_modules/.pnpm/@paralleldrive_cuid2@2.3.1/node_modules/@paralleldrive/cuid2/index.mjs +13 -0
- package/dist/node_modules/.pnpm/@paralleldrive_cuid2@2.3.1/node_modules/@paralleldrive/cuid2/src/index.cjs +69 -0
- package/dist/node_modules/.pnpm/@paralleldrive_cuid2@2.3.1/node_modules/@paralleldrive/cuid2/src/index.mjs +65 -0
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/column.cjs +52 -0
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/column.mjs +52 -0
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/entity.cjs +16 -0
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/entity.mjs +15 -0
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/pg-core/columns/enum.cjs +7 -0
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/pg-core/columns/enum.mjs +7 -0
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/sql/expressions/conditions.cjs +92 -0
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/sql/expressions/conditions.mjs +78 -0
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/sql/expressions/select.cjs +11 -0
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/sql/expressions/select.mjs +10 -0
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/sql/sql.cjs +383 -0
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/sql/sql.mjs +366 -0
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/subquery.cjs +17 -0
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/subquery.mjs +17 -0
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/table.cjs +60 -0
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/table.mjs +59 -0
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/table.utils.cjs +4 -0
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/table.utils.mjs +4 -0
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/tracing.cjs +6 -0
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/tracing.mjs +6 -0
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/view-common.cjs +4 -0
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pglite@0.2.17_@_31f44b782f9321d71f3ce9d35aa1edf7/node_modules/drizzle-orm/view-common.mjs +4 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/drizzle/index.cjs +383 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/drizzle/index.d.cts +12 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/drizzle/index.d.mts +12 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/drizzle/index.mjs +383 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/kysely/index.cjs +4 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/kysely/index.mjs +5 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/prisma/index.cjs +339 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/prisma/index.d.cts +70 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/prisma/index.d.mts +70 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/prisma/index.mjs +339 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-7PZK4ONR.cjs +57 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-7PZK4ONR.mjs +56 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-C6OTUURW.cjs +330 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-C6OTUURW.mjs +326 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-CHTIKPQU.cjs +166 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-CHTIKPQU.mjs +163 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-GUE4GMNC.cjs +14 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-GUE4GMNC.mjs +13 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-LHHP6UVP.cjs +24 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-LHHP6UVP.mjs +24 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-LVCPMTAT.cjs +1190 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-LVCPMTAT.mjs +1189 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-PK2W2SQ7.cjs +197 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-PK2W2SQ7.mjs +197 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-ZEQMAIFI.cjs +410 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-ZEQMAIFI.mjs +400 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-ZOCGSAWS.cjs +213 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/chunk-ZOCGSAWS.mjs +212 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/create-tg0451Y_.d.cts +285 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/create-tg0451Y_.d.mts +285 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/index-CMqePMTF.d.cts +45 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/index-CMqePMTF.d.mts +45 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/index.cjs +69 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/index.d.cts +49 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/index.d.mts +49 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/index.mjs +67 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/query/index.d.cts +156 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/query/index.d.mts +156 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/schema/index.cjs +1 -0
- package/dist/node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare_workers-types@4.20260313.1_@electric-sql_pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/schema/index.mjs +2 -0
- package/dist/{package.cjs → packages/server/package.cjs} +1 -1
- package/dist/{package.mjs → packages/server/package.mjs} +1 -1
- package/dist/runtime.cjs +13 -13
- package/dist/runtime.d.cts +4 -4
- package/dist/runtime.d.mts +4 -4
- package/dist/runtime.mjs +12 -13
- package/dist/schema/v0_21_0.cjs +16 -15
- package/dist/schema/v0_21_0.mjs +3 -2
- package/dist/schema/v0_29_0.cjs +18 -17
- package/dist/schema/v0_29_0.mjs +3 -2
- package/dist/schema/v0_31_0.cjs +48 -0
- package/dist/schema/v0_31_0.mjs +48 -0
- package/dist/storageAccess.cjs +44 -0
- package/dist/storageAccess.mjs +44 -0
- package/dist/version.cjs +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +15 -7
- package/src/adapters/drizzle.ts +15 -1
- package/src/adapters/kysely.ts +24 -1
- package/src/adapters/mongodb.ts +19 -1
- package/src/adapters/prisma.ts +15 -1
- package/src/db/createBundleDiff.spec.ts +402 -0
- package/src/db/createBundleDiff.ts +375 -0
- package/src/db/index.spec.ts +528 -27
- package/src/db/index.ts +22 -36
- package/src/db/ormCore.ts +308 -75
- package/src/db/pluginCore.spec.ts +385 -0
- package/src/db/pluginCore.ts +45 -4
- package/src/db/schemaEnhancements.ts +460 -0
- package/src/db/types.ts +38 -7
- package/src/db/updateArtifacts.ts +388 -0
- package/src/handler-standalone.integration.spec.ts +1 -0
- package/src/handler.spec.ts +121 -0
- package/src/handler.ts +117 -5
- package/src/runtime.spec.ts +287 -55
- package/src/runtime.ts +21 -37
- package/src/schema/v0_21_0.ts +1 -1
- package/src/schema/v0_29_0.ts +1 -1
- package/src/schema/v0_31_0.ts +58 -0
- package/src/storageAccess.spec.ts +57 -0
- package/src/storageAccess.ts +90 -0
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
const require_chunk_ZEQMAIFI = require("../../chunk-ZEQMAIFI.cjs");
|
|
2
|
+
const require_chunk_ZOCGSAWS = require("../../chunk-ZOCGSAWS.cjs");
|
|
3
|
+
const require_chunk_PK2W2SQ7 = require("../../chunk-PK2W2SQ7.cjs");
|
|
4
|
+
const require_chunk_GUE4GMNC = require("../../chunk-GUE4GMNC.cjs");
|
|
5
|
+
//#region ../../node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare+workers-types@4.20260313.1_@electric-sql+pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/prisma/index.js
|
|
6
|
+
var foreignKeyActionMap = {
|
|
7
|
+
"SET NULL": "SetNull",
|
|
8
|
+
CASCADE: "Cascade",
|
|
9
|
+
RESTRICT: "Restrict"
|
|
10
|
+
};
|
|
11
|
+
function generateSchema(schema, provider) {
|
|
12
|
+
function generateTable(table2) {
|
|
13
|
+
const code = [`model ${table2.names.prisma} {`];
|
|
14
|
+
for (const column2 of Object.values(table2.columns)) {
|
|
15
|
+
let map2 = function(name) {
|
|
16
|
+
if (column2.names.prisma === name) return;
|
|
17
|
+
attributes.push(`@map("${name}")`);
|
|
18
|
+
};
|
|
19
|
+
let type;
|
|
20
|
+
const attributes = [];
|
|
21
|
+
map2(provider === "mongodb" ? column2.names.mongodb : column2.names.sql);
|
|
22
|
+
switch (column2.type) {
|
|
23
|
+
case "uuid":
|
|
24
|
+
type = "String";
|
|
25
|
+
switch (provider) {
|
|
26
|
+
case "postgresql":
|
|
27
|
+
case "cockroachdb":
|
|
28
|
+
attributes.push("@db.Uuid");
|
|
29
|
+
break;
|
|
30
|
+
case "mssql":
|
|
31
|
+
attributes.push("@db.UniqueIdentifier");
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
break;
|
|
35
|
+
case "integer":
|
|
36
|
+
type = "Int";
|
|
37
|
+
break;
|
|
38
|
+
case "bigint":
|
|
39
|
+
type = "BigInt";
|
|
40
|
+
break;
|
|
41
|
+
case "bool":
|
|
42
|
+
type = "Boolean";
|
|
43
|
+
break;
|
|
44
|
+
case "json":
|
|
45
|
+
type = "Json";
|
|
46
|
+
break;
|
|
47
|
+
case "timestamp":
|
|
48
|
+
case "date":
|
|
49
|
+
type = "DateTime";
|
|
50
|
+
break;
|
|
51
|
+
case "decimal":
|
|
52
|
+
type = "Decimal";
|
|
53
|
+
break;
|
|
54
|
+
case "binary":
|
|
55
|
+
type = "Bytes";
|
|
56
|
+
break;
|
|
57
|
+
default:
|
|
58
|
+
type = "String";
|
|
59
|
+
if (column2.type.startsWith("varchar")) {
|
|
60
|
+
const parsed = require_chunk_GUE4GMNC.parseVarchar(column2.type);
|
|
61
|
+
switch (provider) {
|
|
62
|
+
case "cockroachdb":
|
|
63
|
+
attributes.push(`@db.String(${parsed})`);
|
|
64
|
+
break;
|
|
65
|
+
case "mysql":
|
|
66
|
+
case "postgresql":
|
|
67
|
+
case "mssql":
|
|
68
|
+
attributes.push(`@db.VarChar(${parsed})`);
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (column2 instanceof require_chunk_ZEQMAIFI.IdColumn) attributes.push("@id");
|
|
74
|
+
if (column2.isUnique) attributes.push("@unique");
|
|
75
|
+
if (column2.default) {
|
|
76
|
+
if ("value" in column2.default) attributes.push(`@default(${JSON.stringify(column2.default.value)})`);
|
|
77
|
+
else if (column2.default.runtime === "auto") attributes.push("@default(cuid())");
|
|
78
|
+
else if (column2.default.runtime === "now") attributes.push("@default(now())");
|
|
79
|
+
}
|
|
80
|
+
if (column2.isNullable) type += "?";
|
|
81
|
+
code.push(` ${[
|
|
82
|
+
column2.names.prisma,
|
|
83
|
+
type,
|
|
84
|
+
...attributes
|
|
85
|
+
].join(" ")}`);
|
|
86
|
+
}
|
|
87
|
+
for (const relation of Object.values(table2.relations)) {
|
|
88
|
+
let type = relation.table.names.prisma;
|
|
89
|
+
if (relation.implied) {
|
|
90
|
+
if (relation.type === "many") type += "[]";
|
|
91
|
+
else type += "?";
|
|
92
|
+
code.push(` ${relation.name} ${type} @relation("${relation.id}")`);
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
const fields = [];
|
|
96
|
+
const references = [];
|
|
97
|
+
let isOptional = false;
|
|
98
|
+
for (const [left, right] of relation.on) {
|
|
99
|
+
const col = table2.columns[left];
|
|
100
|
+
const refCol = relation.table.columns[right];
|
|
101
|
+
if (col.isNullable) isOptional = true;
|
|
102
|
+
fields.push(col.names.prisma);
|
|
103
|
+
references.push(refCol.names.prisma);
|
|
104
|
+
}
|
|
105
|
+
if (isOptional) type += "?";
|
|
106
|
+
const config = relation.foreignKey;
|
|
107
|
+
code.push(` ${relation.name} ${type} @relation(${[
|
|
108
|
+
`"${relation.id}"`,
|
|
109
|
+
`fields: [${fields.join(", ")}]`,
|
|
110
|
+
`references: [${references.join(", ")}]`,
|
|
111
|
+
`onUpdate: ${foreignKeyActionMap[config.onUpdate]}`,
|
|
112
|
+
`onDelete: ${foreignKeyActionMap[config.onDelete]}`
|
|
113
|
+
].join(", ")})`);
|
|
114
|
+
}
|
|
115
|
+
for (const con of table2.getUniqueConstraints("table")) code.push(`@@unique([${con.columns.map((col) => col.names.prisma).join(", ")}])`);
|
|
116
|
+
function mapTable(name) {
|
|
117
|
+
if (table2.names.prisma === name) return;
|
|
118
|
+
code.push(`@@map("${name}")`);
|
|
119
|
+
}
|
|
120
|
+
mapTable(provider === "mongodb" ? table2.names.mongodb : table2.names.sql);
|
|
121
|
+
code.push("}");
|
|
122
|
+
return code.join("\n");
|
|
123
|
+
}
|
|
124
|
+
const lines = [];
|
|
125
|
+
for (const t of Object.values(schema.tables)) lines.push(generateTable(t));
|
|
126
|
+
return lines.join("\n\n");
|
|
127
|
+
}
|
|
128
|
+
function buildWhere(condition) {
|
|
129
|
+
if (condition.type === 2) {
|
|
130
|
+
const column2 = condition.a;
|
|
131
|
+
const value = condition.b;
|
|
132
|
+
const name = column2.names.prisma;
|
|
133
|
+
if (value instanceof require_chunk_ZEQMAIFI.Column) throw new Error("Prisma adapter does not support comparing against another column at the moment.");
|
|
134
|
+
switch (condition.operator) {
|
|
135
|
+
case "=":
|
|
136
|
+
case "is": return { [name]: value };
|
|
137
|
+
case "!=":
|
|
138
|
+
case "is not": return { [name]: { not: value } };
|
|
139
|
+
case ">": return { [name]: { gt: value } };
|
|
140
|
+
case ">=": return { [name]: { gte: value } };
|
|
141
|
+
case "<": return { [name]: { lt: value } };
|
|
142
|
+
case "<=": return { [name]: { lte: value } };
|
|
143
|
+
case "in": return { [name]: { in: value } };
|
|
144
|
+
case "not in": return { [name]: { notIn: value } };
|
|
145
|
+
case "starts with": return { [name]: { startsWith: value } };
|
|
146
|
+
case "not starts with": return { NOT: { [name]: { startsWith: value } } };
|
|
147
|
+
case "contains": return { [name]: { contains: value } };
|
|
148
|
+
case "not contains": return { NOT: { [name]: { contains: value } } };
|
|
149
|
+
case "ends with": return { [name]: { endsWith: value } };
|
|
150
|
+
case "not ends with": return { NOT: { [name]: { endsWith: value } } };
|
|
151
|
+
default: throw new Error(`Unsupported operator: ${condition.operator}`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (condition.type === 0) return { AND: condition.items.map(buildWhere) };
|
|
155
|
+
if (condition.type === 3) return { NOT: condition };
|
|
156
|
+
return { OR: condition.items.map(buildWhere) };
|
|
157
|
+
}
|
|
158
|
+
function mapSelect(select, table2) {
|
|
159
|
+
const out = {};
|
|
160
|
+
if (select === true) for (const col of Object.values(table2.columns)) out[col.names.prisma] = true;
|
|
161
|
+
else for (const col of select) out[table2.columns[col].names.prisma] = true;
|
|
162
|
+
return out;
|
|
163
|
+
}
|
|
164
|
+
function mapOrderBy(orderBy) {
|
|
165
|
+
const out = {};
|
|
166
|
+
for (const [col, mode] of orderBy) out[col.names.prisma] = mode;
|
|
167
|
+
return out;
|
|
168
|
+
}
|
|
169
|
+
function mapResult(result, table2) {
|
|
170
|
+
const out = {};
|
|
171
|
+
for (const k in result) {
|
|
172
|
+
const value = result[k];
|
|
173
|
+
if (k in table2.relations) {
|
|
174
|
+
const relation = table2.relations[k];
|
|
175
|
+
if (relation.type === "many") out[k] = value.map((v) => mapResult(v, relation.table));
|
|
176
|
+
else out[k] = value ? mapResult(value, relation.table) : null;
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
const col = table2.getColumnByName(k, "prisma");
|
|
180
|
+
if (col) out[col.ormName] = value;
|
|
181
|
+
}
|
|
182
|
+
return out;
|
|
183
|
+
}
|
|
184
|
+
function fromPrisma(schema, config) {
|
|
185
|
+
const { provider, prisma, relationMode = provider === "mongodb" ? "prisma" : "foreign-keys", db: internalClient, isTransaction = false } = config;
|
|
186
|
+
async function initMongoDB() {
|
|
187
|
+
if (!internalClient || isTransaction) return;
|
|
188
|
+
const db = internalClient.db();
|
|
189
|
+
async function initCollection(table2) {
|
|
190
|
+
const collection = db.collection(table2.names.mongodb);
|
|
191
|
+
const indexes = await collection.indexes();
|
|
192
|
+
for (const index of indexes) {
|
|
193
|
+
if (!index.unique || !index.name || index.sparse) continue;
|
|
194
|
+
await collection.dropIndex(index.name);
|
|
195
|
+
await collection.createIndex(index.key, {
|
|
196
|
+
name: index.name,
|
|
197
|
+
unique: true,
|
|
198
|
+
sparse: true
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
await Promise.all(Object.values(schema.tables).map(initCollection));
|
|
203
|
+
}
|
|
204
|
+
const init = initMongoDB();
|
|
205
|
+
function createFindOptions(table2, v) {
|
|
206
|
+
const where = v.where ? buildWhere(v.where) : void 0;
|
|
207
|
+
const select = mapSelect(v.select, table2);
|
|
208
|
+
if (v.join) for (const { relation, options: joinOptions } of v.join) {
|
|
209
|
+
if (joinOptions === false) continue;
|
|
210
|
+
select[relation.name] = createFindOptions(relation.table, joinOptions);
|
|
211
|
+
}
|
|
212
|
+
return {
|
|
213
|
+
where,
|
|
214
|
+
select,
|
|
215
|
+
skip: v.offset,
|
|
216
|
+
take: v.limit,
|
|
217
|
+
orderBy: v.orderBy ? mapOrderBy(v.orderBy) : void 0
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
function mapValues(table2, values, generateDefault = false) {
|
|
221
|
+
const out = {};
|
|
222
|
+
for (const col of Object.values(table2.columns)) {
|
|
223
|
+
let value = values[col.ormName];
|
|
224
|
+
if (value === void 0 && generateDefault) value = col.generateDefaultValue();
|
|
225
|
+
out[col.names.prisma] = value;
|
|
226
|
+
}
|
|
227
|
+
return out;
|
|
228
|
+
}
|
|
229
|
+
return require_chunk_PK2W2SQ7.toORM({
|
|
230
|
+
tables: schema.tables,
|
|
231
|
+
async count(table2, v) {
|
|
232
|
+
await init;
|
|
233
|
+
return (await prisma[table2.names.prisma].count({
|
|
234
|
+
select: { _all: true },
|
|
235
|
+
where: v.where ? buildWhere(v.where) : void 0
|
|
236
|
+
}))._all;
|
|
237
|
+
},
|
|
238
|
+
async findFirst(table2, v) {
|
|
239
|
+
await init;
|
|
240
|
+
const options = createFindOptions(table2, v);
|
|
241
|
+
delete options.take;
|
|
242
|
+
const result = await prisma[table2.names.prisma].findFirst({
|
|
243
|
+
...options,
|
|
244
|
+
where: options.where
|
|
245
|
+
});
|
|
246
|
+
if (result) return mapResult(result, table2);
|
|
247
|
+
return null;
|
|
248
|
+
},
|
|
249
|
+
async findMany(table2, v) {
|
|
250
|
+
await init;
|
|
251
|
+
return (await prisma[table2.names.prisma].findMany(createFindOptions(table2, v))).map((v2) => mapResult(v2, table2));
|
|
252
|
+
},
|
|
253
|
+
async updateMany(table2, v) {
|
|
254
|
+
await init;
|
|
255
|
+
const where = v.where ? buildWhere(v.where) : void 0;
|
|
256
|
+
await prisma[table2.names.prisma].updateMany({
|
|
257
|
+
where,
|
|
258
|
+
data: v.set
|
|
259
|
+
});
|
|
260
|
+
},
|
|
261
|
+
async create(table2, values) {
|
|
262
|
+
await init;
|
|
263
|
+
if (relationMode === "prisma") await Promise.all(table2.foreignKeys.map((key) => require_chunk_ZOCGSAWS.checkForeignKeyOnInsert(this, key, [values])));
|
|
264
|
+
values = mapValues(table2, values, true);
|
|
265
|
+
return mapResult(await prisma[table2.names.prisma].create({ data: values }), table2);
|
|
266
|
+
},
|
|
267
|
+
async createMany(table2, values) {
|
|
268
|
+
await init;
|
|
269
|
+
const idField = table2.getIdColumn().names.prisma;
|
|
270
|
+
if (relationMode === "prisma") await Promise.all(table2.foreignKeys.map((key) => require_chunk_ZOCGSAWS.checkForeignKeyOnInsert(this, key, values)));
|
|
271
|
+
values = values.map((value) => mapValues(table2, value, true));
|
|
272
|
+
await prisma[table2.names.prisma].createMany({ data: values });
|
|
273
|
+
return values.map((value) => ({ _id: value[idField] }));
|
|
274
|
+
},
|
|
275
|
+
async deleteMany(table2, v) {
|
|
276
|
+
await init;
|
|
277
|
+
const where = v.where ? buildWhere(v.where) : void 0;
|
|
278
|
+
await prisma[table2.names.prisma].deleteMany({ where });
|
|
279
|
+
},
|
|
280
|
+
async upsert(table2, { where, ...v }) {
|
|
281
|
+
await init;
|
|
282
|
+
await prisma[table2.names.prisma].upsert({
|
|
283
|
+
where: where ? buildWhere(where) : {},
|
|
284
|
+
create: mapValues(table2, v.create, true),
|
|
285
|
+
update: mapValues(table2, v.update)
|
|
286
|
+
});
|
|
287
|
+
},
|
|
288
|
+
async transaction(run) {
|
|
289
|
+
await init;
|
|
290
|
+
return prisma.$transaction((tx) => run(fromPrisma(schema, {
|
|
291
|
+
...config,
|
|
292
|
+
isTransaction: true,
|
|
293
|
+
prisma: tx
|
|
294
|
+
})));
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
function prismaAdapter(options) {
|
|
299
|
+
const config = options;
|
|
300
|
+
const settingsModel = (namespace) => `private_${namespace}_settings`;
|
|
301
|
+
return {
|
|
302
|
+
name: "prisma",
|
|
303
|
+
createORM(schema) {
|
|
304
|
+
return fromPrisma(schema, config);
|
|
305
|
+
},
|
|
306
|
+
async getSchemaVersion() {
|
|
307
|
+
const prisma = config.prisma;
|
|
308
|
+
const settings = settingsModel(this.namespace);
|
|
309
|
+
if (!(settings in prisma)) return;
|
|
310
|
+
let result = await prisma[settings].findFirst({ where: { key: "version" } });
|
|
311
|
+
if (!result) try {
|
|
312
|
+
result = await prisma[settings].create({ data: { key: "version" } });
|
|
313
|
+
} catch {
|
|
314
|
+
result = await prisma[settings].findFirst({ where: { key: "version" } });
|
|
315
|
+
}
|
|
316
|
+
return result?.value;
|
|
317
|
+
},
|
|
318
|
+
generateSchema(schema, name) {
|
|
319
|
+
const settings = settingsModel(this.namespace);
|
|
320
|
+
const internalTable = require_chunk_ZEQMAIFI.table(settings, {
|
|
321
|
+
key: require_chunk_ZEQMAIFI.idColumn("key", "varchar(255)"),
|
|
322
|
+
value: require_chunk_ZEQMAIFI.column("value", "string").defaultTo(schema.version)
|
|
323
|
+
});
|
|
324
|
+
internalTable.ormName = settings;
|
|
325
|
+
return {
|
|
326
|
+
code: generateSchema({
|
|
327
|
+
...schema,
|
|
328
|
+
tables: {
|
|
329
|
+
...schema.tables,
|
|
330
|
+
[settings]: internalTable
|
|
331
|
+
}
|
|
332
|
+
}, config.provider),
|
|
333
|
+
path: `./prisma/schema/${name}.prisma`
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
//#endregion
|
|
339
|
+
exports.prismaAdapter = prismaAdapter;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { FumaDBAdapter, Provider } from "../../index-CMqePMTF.cjs";
|
|
2
|
+
import { MongoClient } from "mongodb";
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare+workers-types@4.20260313.1_@electric-sql+pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/prisma/index.d.ts
|
|
5
|
+
type PrismaClient = Record<string, {
|
|
6
|
+
count: (options: {
|
|
7
|
+
select: Record<string, unknown>;
|
|
8
|
+
where?: object;
|
|
9
|
+
}) => Promise<Record<string, number>>;
|
|
10
|
+
upsert: (options: {
|
|
11
|
+
where: object;
|
|
12
|
+
update: Record<string, unknown>;
|
|
13
|
+
create: Record<string, unknown>;
|
|
14
|
+
}) => Promise<void>;
|
|
15
|
+
create: (options: {
|
|
16
|
+
data: Record<string, unknown>;
|
|
17
|
+
}) => Promise<Record<string, unknown>>;
|
|
18
|
+
createMany: (options: {
|
|
19
|
+
data: Record<string, unknown>[];
|
|
20
|
+
}) => Promise<void>;
|
|
21
|
+
delete: (options: {
|
|
22
|
+
where: object;
|
|
23
|
+
}) => Promise<Record<string, unknown>>;
|
|
24
|
+
deleteMany: (options: {
|
|
25
|
+
where?: object;
|
|
26
|
+
}) => Promise<void>;
|
|
27
|
+
findFirst: (options: {
|
|
28
|
+
where: object;
|
|
29
|
+
select?: Record<string, unknown>;
|
|
30
|
+
orderBy?: OrderBy | OrderBy[];
|
|
31
|
+
skip?: number;
|
|
32
|
+
}) => Promise<Record<string, unknown> | null>;
|
|
33
|
+
findMany: (options: {
|
|
34
|
+
where?: object;
|
|
35
|
+
select?: Record<string, unknown>;
|
|
36
|
+
orderBy?: OrderBy | OrderBy[];
|
|
37
|
+
skip?: number;
|
|
38
|
+
take?: number;
|
|
39
|
+
}) => Promise<Record<string, unknown>[]>;
|
|
40
|
+
updateMany: (options: {
|
|
41
|
+
where?: object;
|
|
42
|
+
data: Record<string, unknown>;
|
|
43
|
+
}) => Promise<void>;
|
|
44
|
+
}> & {
|
|
45
|
+
$transaction: <T>(v: (tx: PrismaClient) => T | Promise<T>) => Promise<T>;
|
|
46
|
+
};
|
|
47
|
+
type OrderBy = {
|
|
48
|
+
[k: string]: "asc" | "desc" | OrderBy;
|
|
49
|
+
};
|
|
50
|
+
interface PrismaConfig {
|
|
51
|
+
provider: Provider;
|
|
52
|
+
prisma: PrismaClient;
|
|
53
|
+
/**
|
|
54
|
+
* The relation mode you're using, see https://prisma.io/docs/orm/prisma-schema/data-model/relations/relation-mode.
|
|
55
|
+
*
|
|
56
|
+
* Default to foreign keys on SQL databases, and `prisma` on MongoDB.
|
|
57
|
+
*/
|
|
58
|
+
relationMode?: "prisma" | "foreign-keys";
|
|
59
|
+
/**
|
|
60
|
+
* Underlying database instance, highly recommended to provide so FumaDB can optimize some operations & indexes.
|
|
61
|
+
*
|
|
62
|
+
* supported: MongoDB
|
|
63
|
+
*/
|
|
64
|
+
db?: MongoClient;
|
|
65
|
+
}
|
|
66
|
+
declare function prismaAdapter(options: Omit<PrismaConfig, "prisma"> & {
|
|
67
|
+
prisma: unknown;
|
|
68
|
+
}): FumaDBAdapter;
|
|
69
|
+
//#endregion
|
|
70
|
+
export { prismaAdapter };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { FumaDBAdapter, Provider } from "../../index-CMqePMTF.mjs";
|
|
2
|
+
import { MongoClient } from "mongodb";
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/fumadb@0.2.2_drizzle-orm@0.44.7_@cloudflare+workers-types@4.20260313.1_@electric-sql+pg_c72c8c754becd21f6d6662e8fbd28e7f/node_modules/fumadb/dist/adapters/prisma/index.d.ts
|
|
5
|
+
type PrismaClient = Record<string, {
|
|
6
|
+
count: (options: {
|
|
7
|
+
select: Record<string, unknown>;
|
|
8
|
+
where?: object;
|
|
9
|
+
}) => Promise<Record<string, number>>;
|
|
10
|
+
upsert: (options: {
|
|
11
|
+
where: object;
|
|
12
|
+
update: Record<string, unknown>;
|
|
13
|
+
create: Record<string, unknown>;
|
|
14
|
+
}) => Promise<void>;
|
|
15
|
+
create: (options: {
|
|
16
|
+
data: Record<string, unknown>;
|
|
17
|
+
}) => Promise<Record<string, unknown>>;
|
|
18
|
+
createMany: (options: {
|
|
19
|
+
data: Record<string, unknown>[];
|
|
20
|
+
}) => Promise<void>;
|
|
21
|
+
delete: (options: {
|
|
22
|
+
where: object;
|
|
23
|
+
}) => Promise<Record<string, unknown>>;
|
|
24
|
+
deleteMany: (options: {
|
|
25
|
+
where?: object;
|
|
26
|
+
}) => Promise<void>;
|
|
27
|
+
findFirst: (options: {
|
|
28
|
+
where: object;
|
|
29
|
+
select?: Record<string, unknown>;
|
|
30
|
+
orderBy?: OrderBy | OrderBy[];
|
|
31
|
+
skip?: number;
|
|
32
|
+
}) => Promise<Record<string, unknown> | null>;
|
|
33
|
+
findMany: (options: {
|
|
34
|
+
where?: object;
|
|
35
|
+
select?: Record<string, unknown>;
|
|
36
|
+
orderBy?: OrderBy | OrderBy[];
|
|
37
|
+
skip?: number;
|
|
38
|
+
take?: number;
|
|
39
|
+
}) => Promise<Record<string, unknown>[]>;
|
|
40
|
+
updateMany: (options: {
|
|
41
|
+
where?: object;
|
|
42
|
+
data: Record<string, unknown>;
|
|
43
|
+
}) => Promise<void>;
|
|
44
|
+
}> & {
|
|
45
|
+
$transaction: <T>(v: (tx: PrismaClient) => T | Promise<T>) => Promise<T>;
|
|
46
|
+
};
|
|
47
|
+
type OrderBy = {
|
|
48
|
+
[k: string]: "asc" | "desc" | OrderBy;
|
|
49
|
+
};
|
|
50
|
+
interface PrismaConfig {
|
|
51
|
+
provider: Provider;
|
|
52
|
+
prisma: PrismaClient;
|
|
53
|
+
/**
|
|
54
|
+
* The relation mode you're using, see https://prisma.io/docs/orm/prisma-schema/data-model/relations/relation-mode.
|
|
55
|
+
*
|
|
56
|
+
* Default to foreign keys on SQL databases, and `prisma` on MongoDB.
|
|
57
|
+
*/
|
|
58
|
+
relationMode?: "prisma" | "foreign-keys";
|
|
59
|
+
/**
|
|
60
|
+
* Underlying database instance, highly recommended to provide so FumaDB can optimize some operations & indexes.
|
|
61
|
+
*
|
|
62
|
+
* supported: MongoDB
|
|
63
|
+
*/
|
|
64
|
+
db?: MongoClient;
|
|
65
|
+
}
|
|
66
|
+
declare function prismaAdapter(options: Omit<PrismaConfig, "prisma"> & {
|
|
67
|
+
prisma: unknown;
|
|
68
|
+
}): FumaDBAdapter;
|
|
69
|
+
//#endregion
|
|
70
|
+
export { prismaAdapter };
|