@hot-updater/server 0.33.1 → 0.34.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/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/fixedMigrator.cjs +136 -0
- package/dist/db/fixedMigrator.mjs +135 -0
- package/dist/db/index.cjs +17 -15
- package/dist/db/index.d.cts +3 -3
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +17 -15
- 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 -2
- package/dist/index.d.cts +3 -2
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +2 -2
- package/dist/{packages/server/package.cjs → package.cjs} +1 -1
- package/dist/{packages/server/package.mjs → package.mjs} +1 -1
- package/dist/runtime.cjs +9 -2
- package/dist/runtime.mjs +9 -2
- 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/version.cjs +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +30 -16
- package/src/adapters/drizzle.spec.ts +75 -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/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 +976 -13
- package/src/db/index.ts +37 -36
- 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/runtime.spec.ts +70 -0
- package/src/runtime.ts +14 -2
- 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/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/src/db/ormCore.ts +0 -1059
- package/src/db/ormUpdateCheck.bench.ts +0 -262
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { AnyColumn, AnyRelation, AnySchema, AnyTable, IdColumn, Relation } from "../create-tg0451Y_.cjs";
|
|
2
|
-
|
|
3
|
-
//#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/query/index.d.ts
|
|
4
|
-
declare enum ConditionType {
|
|
5
|
-
And = 0,
|
|
6
|
-
Or = 1,
|
|
7
|
-
Compare = 2,
|
|
8
|
-
Not = 3
|
|
9
|
-
}
|
|
10
|
-
type Condition = {
|
|
11
|
-
type: ConditionType.Compare;
|
|
12
|
-
a: AnyColumn;
|
|
13
|
-
operator: Operator;
|
|
14
|
-
b: AnyColumn | unknown | null;
|
|
15
|
-
} | {
|
|
16
|
-
type: ConditionType.Or | ConditionType.And;
|
|
17
|
-
items: Condition[];
|
|
18
|
-
} | {
|
|
19
|
-
type: ConditionType.Not;
|
|
20
|
-
item: Condition;
|
|
21
|
-
};
|
|
22
|
-
type ConditionBuilder<Columns extends Record<string, AnyColumn>> = {
|
|
23
|
-
<ColName extends keyof Columns>(a: ColName, operator: (typeof valueOperators)[number] | (typeof stringOperators)[number], b: Columns[ColName]["$in"] | null): Condition;
|
|
24
|
-
<ColName extends keyof Columns>(a: ColName, operator: (typeof arrayOperators)[number], b: Columns[ColName]["$in"][]): Condition;
|
|
25
|
-
/**
|
|
26
|
-
* Boolean values
|
|
27
|
-
*/
|
|
28
|
-
<ColName extends keyof Columns>(a: ColName): Condition;
|
|
29
|
-
and: (...v: (Condition | boolean)[]) => Condition | boolean;
|
|
30
|
-
or: (...v: (Condition | boolean)[]) => Condition | boolean;
|
|
31
|
-
not: (v: Condition | boolean) => Condition | boolean;
|
|
32
|
-
isNull: (a: keyof Columns) => Condition;
|
|
33
|
-
isNotNull: (a: keyof Columns) => Condition;
|
|
34
|
-
};
|
|
35
|
-
declare const stringOperators: readonly ["contains", "starts with", "ends with", "not contains", "not starts with", "not ends with"];
|
|
36
|
-
declare const arrayOperators: readonly ["in", "not in"];
|
|
37
|
-
declare const valueOperators: readonly ["=", "!=", ">", ">=", "<", "<=", "is", "is not"];
|
|
38
|
-
declare const operators: readonly ["=", "!=", ">", ">=", "<", "<=", "is", "is not", "in", "not in", "contains", "starts with", "ends with", "not contains", "not starts with", "not ends with"];
|
|
39
|
-
type Operator = (typeof operators)[number];
|
|
40
|
-
interface CompiledJoin {
|
|
41
|
-
relation: AnyRelation;
|
|
42
|
-
options: SimplifyFindOptions<FindManyOptions> | false;
|
|
43
|
-
}
|
|
44
|
-
interface SimplifiedCountOptions {
|
|
45
|
-
where?: Condition | undefined;
|
|
46
|
-
}
|
|
47
|
-
type SimplifyFindOptions<O> = Omit<O, "where" | "orderBy" | "select" | "join"> & {
|
|
48
|
-
select: AnySelectClause;
|
|
49
|
-
where?: Condition | undefined;
|
|
50
|
-
orderBy?: OrderBy<AnyColumn>[];
|
|
51
|
-
join?: CompiledJoin[];
|
|
52
|
-
};
|
|
53
|
-
interface ORMAdapter {
|
|
54
|
-
tables: Record<string, AnyTable>;
|
|
55
|
-
count: (table: AnyTable, v: SimplifiedCountOptions) => Promise<number>;
|
|
56
|
-
findFirst: (table: AnyTable, v: SimplifyFindOptions<FindFirstOptions>) => Promise<Record<string, unknown> | null>;
|
|
57
|
-
findMany: (table: AnyTable, v: SimplifyFindOptions<FindManyOptions>) => Promise<Record<string, unknown>[]>;
|
|
58
|
-
updateMany: (table: AnyTable, v: {
|
|
59
|
-
where?: Condition;
|
|
60
|
-
set: Record<string, unknown>;
|
|
61
|
-
}) => Promise<void>;
|
|
62
|
-
upsert: (table: AnyTable, v: {
|
|
63
|
-
where: Condition | undefined;
|
|
64
|
-
update: Record<string, unknown>;
|
|
65
|
-
create: Record<string, unknown>;
|
|
66
|
-
}) => Promise<void>;
|
|
67
|
-
create: (table: AnyTable, values: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
68
|
-
createMany: (table: AnyTable, values: Record<string, unknown>[]) => Promise<{
|
|
69
|
-
_id: unknown;
|
|
70
|
-
}[]>;
|
|
71
|
-
deleteMany: (table: AnyTable, v: {
|
|
72
|
-
where?: Condition;
|
|
73
|
-
}) => Promise<void>;
|
|
74
|
-
/**
|
|
75
|
-
* Override this to support native transaction, otherwise use soft transaction.
|
|
76
|
-
*/
|
|
77
|
-
transaction: <T>(run: (transactionInstance: AbstractQuery<AnySchema>) => Promise<T>) => Promise<T>;
|
|
78
|
-
}
|
|
79
|
-
type AnySelectClause = SelectClause<AnyTable>;
|
|
80
|
-
type SelectClause<T extends AnyTable> = true | (keyof T["columns"])[];
|
|
81
|
-
type TableToColumnValues<T extends AnyTable> = { [K in keyof T["columns"]]: T["columns"][K]["$out"] };
|
|
82
|
-
type PickNullable<T> = { [P in keyof T as null extends T[P] ? P : never]: T[P] };
|
|
83
|
-
type PickNotNullable<T> = { [P in keyof T as null extends T[P] ? never : P]: T[P] };
|
|
84
|
-
type TableToInsertValues<T extends AnyTable> = Partial<PickNullable<{ [K in keyof T["columns"]]: T["columns"][K]["$in"] }>> & PickNotNullable<{ [K in keyof T["columns"]]: T["columns"][K]["$in"] }>;
|
|
85
|
-
type TableToUpdateValues<T extends AnyTable> = { [K in keyof T["columns"]]?: T["columns"][K] extends IdColumn ? never : T["columns"][K]["$in"] };
|
|
86
|
-
type MainSelectResult<S extends SelectClause<T>, T extends AnyTable> = S extends true ? TableToColumnValues<T> : S extends (keyof T["columns"])[] ? Pick<TableToColumnValues<T>, S[number]> : never;
|
|
87
|
-
type JoinBuilder<T extends AnyTable, Out = {}> = { [K in keyof T["relations"]]: T["relations"][K] extends Relation<infer Type, infer Target> ? <Select extends SelectClause<Target> = true, JoinOut = {}>(options?: Type extends "many" ? FindManyOptions<Target, Select, JoinOut, false> : FindFirstOptions<Target, Select, JoinOut, false>) => JoinBuilder<T, Out & { [$K in K]: MapRelationType<SelectResult<Target, JoinOut, Select>, T["relations"][K]["implied"]>[Type] }> : never };
|
|
88
|
-
type SelectResult<T extends AnyTable, JoinOut, Select extends SelectClause<T>> = MainSelectResult<Select, T> & JoinOut;
|
|
89
|
-
type OrderBy<Column = string> = [columnName: Column, "asc" | "desc"];
|
|
90
|
-
type FindFirstOptions<T extends AnyTable = AnyTable, Select extends SelectClause<T> = SelectClause<T>, JoinOut = {}, IsRoot extends boolean = true> = Omit<FindManyOptions<T, Select, JoinOut, IsRoot>, IsRoot extends true ? "limit" : "limit" | "offset" | "orderBy">;
|
|
91
|
-
interface MapRelationType<Type, Implied extends boolean> {
|
|
92
|
-
one: Implied extends true ? Type | null : Type;
|
|
93
|
-
many: Type[];
|
|
94
|
-
}
|
|
95
|
-
type FindManyOptions<T extends AnyTable = AnyTable, Select extends SelectClause<T> = SelectClause<T>, JoinOut = {}, IsRoot extends boolean = true> = {
|
|
96
|
-
select?: Select;
|
|
97
|
-
where?: (eb: ConditionBuilder<T["columns"]>) => Condition | boolean;
|
|
98
|
-
limit?: number;
|
|
99
|
-
orderBy?: OrderBy<keyof T["columns"]> | OrderBy<keyof T["columns"]>[];
|
|
100
|
-
join?: (builder: JoinBuilder<T, {}>) => JoinBuilder<T, JoinOut>;
|
|
101
|
-
} & (IsRoot extends true ? {
|
|
102
|
-
offset?: number;
|
|
103
|
-
} : {});
|
|
104
|
-
interface AbstractQuery<S extends AnySchema> {
|
|
105
|
-
internal: ORMAdapter;
|
|
106
|
-
/**
|
|
107
|
-
* The code in the transaction will receive a transaction query instance.
|
|
108
|
-
*
|
|
109
|
-
* If you use that instance to write the database (e.g. insert) and an error is thrown, FumaDB will automatically rollback the changes + rethrow the error.
|
|
110
|
-
*
|
|
111
|
-
* It works by using the transaction API that's natively available for the database/ORM, or falling back to the soft transaction layer built by FumaDB.
|
|
112
|
-
*/
|
|
113
|
-
transaction: <T>(run: (orm: AbstractQuery<S>) => Promise<T>) => Promise<T>;
|
|
114
|
-
/**
|
|
115
|
-
* Count (all)
|
|
116
|
-
*/
|
|
117
|
-
count: <TableName extends keyof S["tables"]>(table: TableName, v?: {
|
|
118
|
-
where?: (eb: ConditionBuilder<S["tables"][TableName]["columns"]>) => Condition | boolean;
|
|
119
|
-
}) => Promise<number>;
|
|
120
|
-
findFirst: <TableName extends keyof S["tables"], JoinOut = {}, Select extends SelectClause<S["tables"][TableName]> = true>(table: TableName, v: FindFirstOptions<S["tables"][TableName], Select, JoinOut>) => Promise<SelectResult<S["tables"][TableName], JoinOut, Select> | null>;
|
|
121
|
-
findMany: <TableName extends keyof S["tables"], JoinOut = {}, Select extends SelectClause<S["tables"][TableName]> = true>(table: TableName, v?: FindManyOptions<S["tables"][TableName], Select, JoinOut>) => Promise<SelectResult<S["tables"][TableName], JoinOut, Select>[]>;
|
|
122
|
-
/**
|
|
123
|
-
* Upsert a **single row**.
|
|
124
|
-
*
|
|
125
|
-
* For ORMs:
|
|
126
|
-
* - use built-in method whenever possible.
|
|
127
|
-
*
|
|
128
|
-
* Otherwise:
|
|
129
|
-
* - run `update`.
|
|
130
|
-
* - if updated zero rows, run `create`.
|
|
131
|
-
*/
|
|
132
|
-
upsert: <TableName extends keyof S["tables"]>(table: TableName, v: {
|
|
133
|
-
where: (eb: ConditionBuilder<S["tables"][TableName]["columns"]>) => Condition | boolean;
|
|
134
|
-
update: TableToUpdateValues<S["tables"][TableName]>;
|
|
135
|
-
create: TableToInsertValues<S["tables"][TableName]>;
|
|
136
|
-
}) => Promise<void>;
|
|
137
|
-
/**
|
|
138
|
-
* Note: you cannot update the id of a row, some databases don't support that (including MongoDB).
|
|
139
|
-
*/
|
|
140
|
-
updateMany: <TableName extends keyof S["tables"]>(table: TableName, v: {
|
|
141
|
-
where?: (eb: ConditionBuilder<S["tables"][TableName]["columns"]>) => Condition | boolean;
|
|
142
|
-
set: TableToUpdateValues<S["tables"][TableName]>;
|
|
143
|
-
}) => Promise<void>;
|
|
144
|
-
createMany: <TableName extends keyof S["tables"]>(table: TableName, values: TableToInsertValues<S["tables"][TableName]>[]) => Promise<{
|
|
145
|
-
_id: string;
|
|
146
|
-
}[]>;
|
|
147
|
-
/**
|
|
148
|
-
* Note: when you don't need to receive the result, always use `createMany` for better performance.
|
|
149
|
-
*/
|
|
150
|
-
create: <TableName extends keyof S["tables"]>(table: TableName, values: TableToInsertValues<S["tables"][TableName]>) => Promise<TableToColumnValues<S["tables"][TableName]>>;
|
|
151
|
-
deleteMany: <TableName extends keyof S["tables"]>(table: TableName, v: {
|
|
152
|
-
where?: (eb: ConditionBuilder<S["tables"][TableName]["columns"]>) => Condition | boolean;
|
|
153
|
-
}) => Promise<void>;
|
|
154
|
-
}
|
|
155
|
-
//#endregion
|
|
156
|
-
export { type AbstractQuery };
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { AnyColumn, AnyRelation, AnySchema, AnyTable, IdColumn, Relation } from "../create-tg0451Y_.mjs";
|
|
2
|
-
|
|
3
|
-
//#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/query/index.d.ts
|
|
4
|
-
declare enum ConditionType {
|
|
5
|
-
And = 0,
|
|
6
|
-
Or = 1,
|
|
7
|
-
Compare = 2,
|
|
8
|
-
Not = 3
|
|
9
|
-
}
|
|
10
|
-
type Condition = {
|
|
11
|
-
type: ConditionType.Compare;
|
|
12
|
-
a: AnyColumn;
|
|
13
|
-
operator: Operator;
|
|
14
|
-
b: AnyColumn | unknown | null;
|
|
15
|
-
} | {
|
|
16
|
-
type: ConditionType.Or | ConditionType.And;
|
|
17
|
-
items: Condition[];
|
|
18
|
-
} | {
|
|
19
|
-
type: ConditionType.Not;
|
|
20
|
-
item: Condition;
|
|
21
|
-
};
|
|
22
|
-
type ConditionBuilder<Columns extends Record<string, AnyColumn>> = {
|
|
23
|
-
<ColName extends keyof Columns>(a: ColName, operator: (typeof valueOperators)[number] | (typeof stringOperators)[number], b: Columns[ColName]["$in"] | null): Condition;
|
|
24
|
-
<ColName extends keyof Columns>(a: ColName, operator: (typeof arrayOperators)[number], b: Columns[ColName]["$in"][]): Condition;
|
|
25
|
-
/**
|
|
26
|
-
* Boolean values
|
|
27
|
-
*/
|
|
28
|
-
<ColName extends keyof Columns>(a: ColName): Condition;
|
|
29
|
-
and: (...v: (Condition | boolean)[]) => Condition | boolean;
|
|
30
|
-
or: (...v: (Condition | boolean)[]) => Condition | boolean;
|
|
31
|
-
not: (v: Condition | boolean) => Condition | boolean;
|
|
32
|
-
isNull: (a: keyof Columns) => Condition;
|
|
33
|
-
isNotNull: (a: keyof Columns) => Condition;
|
|
34
|
-
};
|
|
35
|
-
declare const stringOperators: readonly ["contains", "starts with", "ends with", "not contains", "not starts with", "not ends with"];
|
|
36
|
-
declare const arrayOperators: readonly ["in", "not in"];
|
|
37
|
-
declare const valueOperators: readonly ["=", "!=", ">", ">=", "<", "<=", "is", "is not"];
|
|
38
|
-
declare const operators: readonly ["=", "!=", ">", ">=", "<", "<=", "is", "is not", "in", "not in", "contains", "starts with", "ends with", "not contains", "not starts with", "not ends with"];
|
|
39
|
-
type Operator = (typeof operators)[number];
|
|
40
|
-
interface CompiledJoin {
|
|
41
|
-
relation: AnyRelation;
|
|
42
|
-
options: SimplifyFindOptions<FindManyOptions> | false;
|
|
43
|
-
}
|
|
44
|
-
interface SimplifiedCountOptions {
|
|
45
|
-
where?: Condition | undefined;
|
|
46
|
-
}
|
|
47
|
-
type SimplifyFindOptions<O> = Omit<O, "where" | "orderBy" | "select" | "join"> & {
|
|
48
|
-
select: AnySelectClause;
|
|
49
|
-
where?: Condition | undefined;
|
|
50
|
-
orderBy?: OrderBy<AnyColumn>[];
|
|
51
|
-
join?: CompiledJoin[];
|
|
52
|
-
};
|
|
53
|
-
interface ORMAdapter {
|
|
54
|
-
tables: Record<string, AnyTable>;
|
|
55
|
-
count: (table: AnyTable, v: SimplifiedCountOptions) => Promise<number>;
|
|
56
|
-
findFirst: (table: AnyTable, v: SimplifyFindOptions<FindFirstOptions>) => Promise<Record<string, unknown> | null>;
|
|
57
|
-
findMany: (table: AnyTable, v: SimplifyFindOptions<FindManyOptions>) => Promise<Record<string, unknown>[]>;
|
|
58
|
-
updateMany: (table: AnyTable, v: {
|
|
59
|
-
where?: Condition;
|
|
60
|
-
set: Record<string, unknown>;
|
|
61
|
-
}) => Promise<void>;
|
|
62
|
-
upsert: (table: AnyTable, v: {
|
|
63
|
-
where: Condition | undefined;
|
|
64
|
-
update: Record<string, unknown>;
|
|
65
|
-
create: Record<string, unknown>;
|
|
66
|
-
}) => Promise<void>;
|
|
67
|
-
create: (table: AnyTable, values: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
68
|
-
createMany: (table: AnyTable, values: Record<string, unknown>[]) => Promise<{
|
|
69
|
-
_id: unknown;
|
|
70
|
-
}[]>;
|
|
71
|
-
deleteMany: (table: AnyTable, v: {
|
|
72
|
-
where?: Condition;
|
|
73
|
-
}) => Promise<void>;
|
|
74
|
-
/**
|
|
75
|
-
* Override this to support native transaction, otherwise use soft transaction.
|
|
76
|
-
*/
|
|
77
|
-
transaction: <T>(run: (transactionInstance: AbstractQuery<AnySchema>) => Promise<T>) => Promise<T>;
|
|
78
|
-
}
|
|
79
|
-
type AnySelectClause = SelectClause<AnyTable>;
|
|
80
|
-
type SelectClause<T extends AnyTable> = true | (keyof T["columns"])[];
|
|
81
|
-
type TableToColumnValues<T extends AnyTable> = { [K in keyof T["columns"]]: T["columns"][K]["$out"] };
|
|
82
|
-
type PickNullable<T> = { [P in keyof T as null extends T[P] ? P : never]: T[P] };
|
|
83
|
-
type PickNotNullable<T> = { [P in keyof T as null extends T[P] ? never : P]: T[P] };
|
|
84
|
-
type TableToInsertValues<T extends AnyTable> = Partial<PickNullable<{ [K in keyof T["columns"]]: T["columns"][K]["$in"] }>> & PickNotNullable<{ [K in keyof T["columns"]]: T["columns"][K]["$in"] }>;
|
|
85
|
-
type TableToUpdateValues<T extends AnyTable> = { [K in keyof T["columns"]]?: T["columns"][K] extends IdColumn ? never : T["columns"][K]["$in"] };
|
|
86
|
-
type MainSelectResult<S extends SelectClause<T>, T extends AnyTable> = S extends true ? TableToColumnValues<T> : S extends (keyof T["columns"])[] ? Pick<TableToColumnValues<T>, S[number]> : never;
|
|
87
|
-
type JoinBuilder<T extends AnyTable, Out = {}> = { [K in keyof T["relations"]]: T["relations"][K] extends Relation<infer Type, infer Target> ? <Select extends SelectClause<Target> = true, JoinOut = {}>(options?: Type extends "many" ? FindManyOptions<Target, Select, JoinOut, false> : FindFirstOptions<Target, Select, JoinOut, false>) => JoinBuilder<T, Out & { [$K in K]: MapRelationType<SelectResult<Target, JoinOut, Select>, T["relations"][K]["implied"]>[Type] }> : never };
|
|
88
|
-
type SelectResult<T extends AnyTable, JoinOut, Select extends SelectClause<T>> = MainSelectResult<Select, T> & JoinOut;
|
|
89
|
-
type OrderBy<Column = string> = [columnName: Column, "asc" | "desc"];
|
|
90
|
-
type FindFirstOptions<T extends AnyTable = AnyTable, Select extends SelectClause<T> = SelectClause<T>, JoinOut = {}, IsRoot extends boolean = true> = Omit<FindManyOptions<T, Select, JoinOut, IsRoot>, IsRoot extends true ? "limit" : "limit" | "offset" | "orderBy">;
|
|
91
|
-
interface MapRelationType<Type, Implied extends boolean> {
|
|
92
|
-
one: Implied extends true ? Type | null : Type;
|
|
93
|
-
many: Type[];
|
|
94
|
-
}
|
|
95
|
-
type FindManyOptions<T extends AnyTable = AnyTable, Select extends SelectClause<T> = SelectClause<T>, JoinOut = {}, IsRoot extends boolean = true> = {
|
|
96
|
-
select?: Select;
|
|
97
|
-
where?: (eb: ConditionBuilder<T["columns"]>) => Condition | boolean;
|
|
98
|
-
limit?: number;
|
|
99
|
-
orderBy?: OrderBy<keyof T["columns"]> | OrderBy<keyof T["columns"]>[];
|
|
100
|
-
join?: (builder: JoinBuilder<T, {}>) => JoinBuilder<T, JoinOut>;
|
|
101
|
-
} & (IsRoot extends true ? {
|
|
102
|
-
offset?: number;
|
|
103
|
-
} : {});
|
|
104
|
-
interface AbstractQuery<S extends AnySchema> {
|
|
105
|
-
internal: ORMAdapter;
|
|
106
|
-
/**
|
|
107
|
-
* The code in the transaction will receive a transaction query instance.
|
|
108
|
-
*
|
|
109
|
-
* If you use that instance to write the database (e.g. insert) and an error is thrown, FumaDB will automatically rollback the changes + rethrow the error.
|
|
110
|
-
*
|
|
111
|
-
* It works by using the transaction API that's natively available for the database/ORM, or falling back to the soft transaction layer built by FumaDB.
|
|
112
|
-
*/
|
|
113
|
-
transaction: <T>(run: (orm: AbstractQuery<S>) => Promise<T>) => Promise<T>;
|
|
114
|
-
/**
|
|
115
|
-
* Count (all)
|
|
116
|
-
*/
|
|
117
|
-
count: <TableName extends keyof S["tables"]>(table: TableName, v?: {
|
|
118
|
-
where?: (eb: ConditionBuilder<S["tables"][TableName]["columns"]>) => Condition | boolean;
|
|
119
|
-
}) => Promise<number>;
|
|
120
|
-
findFirst: <TableName extends keyof S["tables"], JoinOut = {}, Select extends SelectClause<S["tables"][TableName]> = true>(table: TableName, v: FindFirstOptions<S["tables"][TableName], Select, JoinOut>) => Promise<SelectResult<S["tables"][TableName], JoinOut, Select> | null>;
|
|
121
|
-
findMany: <TableName extends keyof S["tables"], JoinOut = {}, Select extends SelectClause<S["tables"][TableName]> = true>(table: TableName, v?: FindManyOptions<S["tables"][TableName], Select, JoinOut>) => Promise<SelectResult<S["tables"][TableName], JoinOut, Select>[]>;
|
|
122
|
-
/**
|
|
123
|
-
* Upsert a **single row**.
|
|
124
|
-
*
|
|
125
|
-
* For ORMs:
|
|
126
|
-
* - use built-in method whenever possible.
|
|
127
|
-
*
|
|
128
|
-
* Otherwise:
|
|
129
|
-
* - run `update`.
|
|
130
|
-
* - if updated zero rows, run `create`.
|
|
131
|
-
*/
|
|
132
|
-
upsert: <TableName extends keyof S["tables"]>(table: TableName, v: {
|
|
133
|
-
where: (eb: ConditionBuilder<S["tables"][TableName]["columns"]>) => Condition | boolean;
|
|
134
|
-
update: TableToUpdateValues<S["tables"][TableName]>;
|
|
135
|
-
create: TableToInsertValues<S["tables"][TableName]>;
|
|
136
|
-
}) => Promise<void>;
|
|
137
|
-
/**
|
|
138
|
-
* Note: you cannot update the id of a row, some databases don't support that (including MongoDB).
|
|
139
|
-
*/
|
|
140
|
-
updateMany: <TableName extends keyof S["tables"]>(table: TableName, v: {
|
|
141
|
-
where?: (eb: ConditionBuilder<S["tables"][TableName]["columns"]>) => Condition | boolean;
|
|
142
|
-
set: TableToUpdateValues<S["tables"][TableName]>;
|
|
143
|
-
}) => Promise<void>;
|
|
144
|
-
createMany: <TableName extends keyof S["tables"]>(table: TableName, values: TableToInsertValues<S["tables"][TableName]>[]) => Promise<{
|
|
145
|
-
_id: string;
|
|
146
|
-
}[]>;
|
|
147
|
-
/**
|
|
148
|
-
* Note: when you don't need to receive the result, always use `createMany` for better performance.
|
|
149
|
-
*/
|
|
150
|
-
create: <TableName extends keyof S["tables"]>(table: TableName, values: TableToInsertValues<S["tables"][TableName]>) => Promise<TableToColumnValues<S["tables"][TableName]>>;
|
|
151
|
-
deleteMany: <TableName extends keyof S["tables"]>(table: TableName, v: {
|
|
152
|
-
where?: (eb: ConditionBuilder<S["tables"][TableName]["columns"]>) => Condition | boolean;
|
|
153
|
-
}) => Promise<void>;
|
|
154
|
-
}
|
|
155
|
-
//#endregion
|
|
156
|
-
export { type AbstractQuery };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require("../chunk-ZEQMAIFI.cjs");
|