@fragno-dev/db 0.1.9 → 0.1.11
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/.turbo/turbo-build.log +130 -213
- package/CHANGELOG.md +12 -0
- package/dist/adapters/drizzle/drizzle-adapter.js +1 -1
- package/dist/adapters/drizzle/drizzle-query.d.ts +1 -0
- package/dist/adapters/drizzle/drizzle-query.d.ts.map +1 -1
- package/dist/adapters/drizzle/drizzle-query.js +3 -4
- package/dist/adapters/drizzle/drizzle-query.js.map +1 -1
- package/dist/adapters/drizzle/drizzle-uow-compiler.d.ts +2 -0
- package/dist/adapters/drizzle/drizzle-uow-compiler.d.ts.map +1 -1
- package/dist/adapters/drizzle/drizzle-uow-compiler.js +49 -40
- package/dist/adapters/drizzle/drizzle-uow-compiler.js.map +1 -1
- package/dist/adapters/drizzle/drizzle-uow-executor.js +2 -3
- package/dist/adapters/drizzle/drizzle-uow-executor.js.map +1 -1
- package/dist/adapters/drizzle/generate.d.ts.map +1 -1
- package/dist/adapters/drizzle/generate.js +13 -6
- package/dist/adapters/drizzle/generate.js.map +1 -1
- package/dist/adapters/drizzle/shared.d.ts +1 -0
- package/dist/adapters/drizzle/shared.js +2 -0
- package/dist/adapters/drizzle/shared.js.map +1 -1
- package/dist/adapters/kysely/kysely-query-builder.js +23 -12
- package/dist/adapters/kysely/kysely-query-builder.js.map +1 -1
- package/package.json +10 -2
- package/src/adapters/drizzle/drizzle-adapter-pglite.test.ts +121 -0
- package/src/adapters/drizzle/drizzle-query.test.ts +2 -2
- package/src/adapters/drizzle/drizzle-query.ts +4 -4
- package/src/adapters/drizzle/drizzle-uow-compiler.ts +27 -2
- package/src/adapters/drizzle/generate.test.ts +38 -19
- package/src/adapters/drizzle/generate.ts +20 -12
- package/src/adapters/kysely/kysely-query-builder.ts +35 -11
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/alias.js +0 -77
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/alias.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/casing.js +0 -49
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/casing.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/column-builder.js +0 -108
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/column-builder.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/column.js +0 -55
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/column.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/entity.js +0 -18
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/entity.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/errors.js +0 -21
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/errors.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/pg-core/columns/common.js +0 -183
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/pg-core/columns/common.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/pg-core/columns/enum.js +0 -58
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/pg-core/columns/enum.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/pg-core/foreign-keys.js +0 -68
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/pg-core/foreign-keys.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/pg-core/unique-constraint.js +0 -56
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/pg-core/unique-constraint.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/pg-core/utils/array.js +0 -65
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/pg-core/utils/array.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/query-builders/query-builder.js +0 -14
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/query-builders/query-builder.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/query-promise.js +0 -26
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/query-promise.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/relations.js +0 -127
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/relations.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/selection-proxy.js +0 -47
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/selection-proxy.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sql/expressions/conditions.js +0 -99
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sql/expressions/conditions.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sql/expressions/select.js +0 -13
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sql/expressions/select.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sql/functions/aggregate.js +0 -10
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sql/functions/aggregate.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sql/sql.js +0 -372
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sql/sql.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/columns/common.js +0 -60
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/columns/common.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/db.js +0 -269
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/db.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/dialect.js +0 -457
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/dialect.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/foreign-keys.js +0 -68
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/foreign-keys.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/query-builders/count.js +0 -41
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/query-builders/count.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/query-builders/delete.js +0 -119
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/query-builders/delete.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/query-builders/insert.js +0 -170
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/query-builders/insert.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/query-builders/query-builder.js +0 -75
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/query-builders/query-builder.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/query-builders/query.js +0 -107
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/query-builders/query.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/query-builders/raw.js +0 -37
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/query-builders/raw.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/query-builders/select.js +0 -621
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/query-builders/select.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/query-builders/update.js +0 -170
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/query-builders/update.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/table.js +0 -20
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/table.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/unique-constraint.js +0 -48
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/unique-constraint.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/utils.js +0 -17
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/utils.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/view-base.js +0 -11
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/sqlite-core/view-base.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/subquery.js +0 -23
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/subquery.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/table.js +0 -68
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/table.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/table.utils.js +0 -6
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/table.utils.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/tracing-utils.js +0 -8
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/tracing-utils.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/tracing.js +0 -8
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/tracing.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/utils.js +0 -53
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/utils.js.map +0 -1
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/view-common.js +0 -6
- package/dist/node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql_pglite@0.3.11_@libsql_client@0.15.15_@types_better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/view-common.js.map +0 -1
|
@@ -178,7 +178,7 @@ describe("drizzle-query", () => {
|
|
|
178
178
|
|
|
179
179
|
const [query] = queries;
|
|
180
180
|
expect(query.sql).toMatchInlineSnapshot(
|
|
181
|
-
`"select "id", "userId", "expiresAt", "createdAt", "_internalId", "_version" from "session" "session" where "session"."userId" = $1"`,
|
|
181
|
+
`"select "id", "userId", "expiresAt", "createdAt", "_internalId", "_version" from "session" "session" where "session"."userId" = (select "_internalId" from "user" where "id" = $1 limit 1)"`,
|
|
182
182
|
);
|
|
183
183
|
expect(query.params).toEqual([userId]);
|
|
184
184
|
});
|
|
@@ -394,7 +394,7 @@ describe("drizzle-query", () => {
|
|
|
394
394
|
// Verify the find query that's executed first
|
|
395
395
|
const findQuery = queries[0];
|
|
396
396
|
expect(findQuery.sql).toMatchInlineSnapshot(
|
|
397
|
-
`"select "id", "userId", "expiresAt", "createdAt", "_internalId", "_version" from "session" "session" where "session"."userId" = $1"`,
|
|
397
|
+
`"select "id", "userId", "expiresAt", "createdAt", "_internalId", "_version" from "session" "session" where "session"."userId" = (select "_internalId" from "user" where "id" = $1 limit 1)"`,
|
|
398
398
|
);
|
|
399
399
|
expect(findQuery.params).toEqual([userId]);
|
|
400
400
|
|
|
@@ -113,10 +113,10 @@ export function fromDrizzle<T extends AnySchema>(
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
return {
|
|
116
|
-
find(tableName, builderFn) {
|
|
117
|
-
const uow = createUOW({ config: uowConfig });
|
|
118
|
-
uow.
|
|
119
|
-
return
|
|
116
|
+
async find(tableName, builderFn) {
|
|
117
|
+
const uow = createUOW({ config: uowConfig }).find(tableName, builderFn);
|
|
118
|
+
const [result] = await uow.executeRetrieve();
|
|
119
|
+
return result;
|
|
120
120
|
},
|
|
121
121
|
|
|
122
122
|
async findFirst(tableName, builderFn) {
|
|
@@ -97,8 +97,33 @@ export function createDrizzleUOWCompiler<TSchema extends AnySchema>(
|
|
|
97
97
|
if (right instanceof Column) {
|
|
98
98
|
right = toDrizzleColumn(right);
|
|
99
99
|
} else {
|
|
100
|
-
//
|
|
101
|
-
|
|
100
|
+
// Handle string references - convert external ID to internal ID via subquery
|
|
101
|
+
if (condition.a.role === "reference" && typeof right === "string") {
|
|
102
|
+
// Find the table that contains this column
|
|
103
|
+
const table = Object.values(schema.tables).find((t) =>
|
|
104
|
+
Object.values(t.columns).includes(condition.a),
|
|
105
|
+
);
|
|
106
|
+
if (table) {
|
|
107
|
+
// Find relation that uses this column
|
|
108
|
+
const relation = Object.values(table.relations).find((rel) =>
|
|
109
|
+
rel.on.some(([localCol]) => localCol === condition.a.ormName),
|
|
110
|
+
);
|
|
111
|
+
if (relation) {
|
|
112
|
+
const refTable = relation.table;
|
|
113
|
+
const internalIdCol = refTable.getInternalIdColumn();
|
|
114
|
+
const idCol = refTable.getIdColumn();
|
|
115
|
+
const physicalTableName = mapper
|
|
116
|
+
? mapper.toPhysical(refTable.ormName)
|
|
117
|
+
: refTable.ormName;
|
|
118
|
+
|
|
119
|
+
// Build a SQL subquery using Drizzle's sql template
|
|
120
|
+
right = Drizzle.sql`(select ${Drizzle.sql.identifier(internalIdCol.name)} from ${Drizzle.sql.identifier(physicalTableName)} where ${Drizzle.sql.identifier(idCol.name)} = ${right} limit 1)`;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
} else {
|
|
124
|
+
// Serialize non-Column values (e.g., FragnoId -> string, Date -> number for SQLite)
|
|
125
|
+
right = serialize(right, condition.a, provider);
|
|
126
|
+
}
|
|
102
127
|
}
|
|
103
128
|
|
|
104
129
|
switch (op) {
|
|
@@ -105,11 +105,13 @@ describe("generateSchema", () => {
|
|
|
105
105
|
|
|
106
106
|
export const test_schema = {
|
|
107
107
|
users_test: users_test,
|
|
108
|
-
users: users_test,
|
|
109
108
|
users_testRelations: users_testRelations,
|
|
109
|
+
users: users_test,
|
|
110
|
+
usersRelations: users_testRelations,
|
|
110
111
|
posts_test: posts_test,
|
|
111
|
-
posts: posts_test,
|
|
112
112
|
posts_testRelations: posts_testRelations,
|
|
113
|
+
posts: posts_test,
|
|
114
|
+
postsRelations: posts_testRelations,
|
|
113
115
|
schemaVersion: 3
|
|
114
116
|
}"
|
|
115
117
|
`);
|
|
@@ -190,11 +192,13 @@ describe("generateSchema", () => {
|
|
|
190
192
|
|
|
191
193
|
export const test_schema = {
|
|
192
194
|
users_test: users_test,
|
|
193
|
-
users: users_test,
|
|
194
195
|
users_testRelations: users_testRelations,
|
|
196
|
+
users: users_test,
|
|
197
|
+
usersRelations: users_testRelations,
|
|
195
198
|
posts_test: posts_test,
|
|
196
|
-
posts: posts_test,
|
|
197
199
|
posts_testRelations: posts_testRelations,
|
|
200
|
+
posts: posts_test,
|
|
201
|
+
postsRelations: posts_testRelations,
|
|
198
202
|
schemaVersion: 3
|
|
199
203
|
}"
|
|
200
204
|
`);
|
|
@@ -275,11 +279,13 @@ describe("generateSchema", () => {
|
|
|
275
279
|
|
|
276
280
|
export const test_schema = {
|
|
277
281
|
users_test: users_test,
|
|
278
|
-
users: users_test,
|
|
279
282
|
users_testRelations: users_testRelations,
|
|
283
|
+
users: users_test,
|
|
284
|
+
usersRelations: users_testRelations,
|
|
280
285
|
posts_test: posts_test,
|
|
281
|
-
posts: posts_test,
|
|
282
286
|
posts_testRelations: posts_testRelations,
|
|
287
|
+
posts: posts_test,
|
|
288
|
+
postsRelations: posts_testRelations,
|
|
283
289
|
schemaVersion: 3
|
|
284
290
|
}"
|
|
285
291
|
`);
|
|
@@ -555,11 +561,13 @@ describe("generateSchema", () => {
|
|
|
555
561
|
|
|
556
562
|
export const test_schema = {
|
|
557
563
|
users_test: users_test,
|
|
558
|
-
users: users_test,
|
|
559
564
|
users_testRelations: users_testRelations,
|
|
565
|
+
users: users_test,
|
|
566
|
+
usersRelations: users_testRelations,
|
|
560
567
|
posts_test: posts_test,
|
|
561
|
-
posts: posts_test,
|
|
562
568
|
posts_testRelations: posts_testRelations,
|
|
569
|
+
posts: posts_test,
|
|
570
|
+
postsRelations: posts_testRelations,
|
|
563
571
|
schemaVersion: 4
|
|
564
572
|
}"
|
|
565
573
|
`);
|
|
@@ -633,11 +641,13 @@ describe("generateSchema", () => {
|
|
|
633
641
|
|
|
634
642
|
export const test_schema = {
|
|
635
643
|
users_test: users_test,
|
|
636
|
-
users: users_test,
|
|
637
644
|
users_testRelations: users_testRelations,
|
|
645
|
+
users: users_test,
|
|
646
|
+
usersRelations: users_testRelations,
|
|
638
647
|
posts_test: posts_test,
|
|
639
|
-
posts: posts_test,
|
|
640
648
|
posts_testRelations: posts_testRelations,
|
|
649
|
+
posts: posts_test,
|
|
650
|
+
postsRelations: posts_testRelations,
|
|
641
651
|
schemaVersion: 4
|
|
642
652
|
}"
|
|
643
653
|
`);
|
|
@@ -711,11 +721,13 @@ describe("generateSchema", () => {
|
|
|
711
721
|
|
|
712
722
|
export const test_schema = {
|
|
713
723
|
users_test: users_test,
|
|
714
|
-
users: users_test,
|
|
715
724
|
users_testRelations: users_testRelations,
|
|
725
|
+
users: users_test,
|
|
726
|
+
usersRelations: users_testRelations,
|
|
716
727
|
posts_test: posts_test,
|
|
717
|
-
posts: posts_test,
|
|
718
728
|
posts_testRelations: posts_testRelations,
|
|
729
|
+
posts: posts_test,
|
|
730
|
+
postsRelations: posts_testRelations,
|
|
719
731
|
schemaVersion: 4
|
|
720
732
|
}"
|
|
721
733
|
`);
|
|
@@ -807,8 +819,9 @@ describe("generateSchema", () => {
|
|
|
807
819
|
|
|
808
820
|
export const test_schema = {
|
|
809
821
|
categories_test: categories_test,
|
|
810
|
-
categories: categories_test,
|
|
811
822
|
categories_testRelations: categories_testRelations,
|
|
823
|
+
categories: categories_test,
|
|
824
|
+
categoriesRelations: categories_testRelations,
|
|
812
825
|
products_test: products_test,
|
|
813
826
|
products: products_test,
|
|
814
827
|
schemaVersion: 3
|
|
@@ -905,8 +918,9 @@ describe("generateSchema", () => {
|
|
|
905
918
|
|
|
906
919
|
export const test_schema = {
|
|
907
920
|
category_test: category_test,
|
|
908
|
-
category: category_test,
|
|
909
921
|
category_testRelations: category_testRelations,
|
|
922
|
+
category: category_test,
|
|
923
|
+
categoryRelations: category_testRelations,
|
|
910
924
|
schemaVersion: 3
|
|
911
925
|
}"
|
|
912
926
|
`);
|
|
@@ -988,8 +1002,9 @@ describe("generateSchema", () => {
|
|
|
988
1002
|
|
|
989
1003
|
export const test_schema = {
|
|
990
1004
|
comment_test: comment_test,
|
|
991
|
-
comment: comment_test,
|
|
992
1005
|
comment_testRelations: comment_testRelations,
|
|
1006
|
+
comment: comment_test,
|
|
1007
|
+
commentRelations: comment_testRelations,
|
|
993
1008
|
schemaVersion: 2
|
|
994
1009
|
}"
|
|
995
1010
|
`);
|
|
@@ -1050,8 +1065,9 @@ describe("generateSchema", () => {
|
|
|
1050
1065
|
|
|
1051
1066
|
export const test_schema = {
|
|
1052
1067
|
comment_test: comment_test,
|
|
1053
|
-
comment: comment_test,
|
|
1054
1068
|
comment_testRelations: comment_testRelations,
|
|
1069
|
+
comment: comment_test,
|
|
1070
|
+
commentRelations: comment_testRelations,
|
|
1055
1071
|
schemaVersion: 2
|
|
1056
1072
|
}"
|
|
1057
1073
|
`);
|
|
@@ -1112,8 +1128,9 @@ describe("generateSchema", () => {
|
|
|
1112
1128
|
|
|
1113
1129
|
export const test_schema = {
|
|
1114
1130
|
comment_test: comment_test,
|
|
1115
|
-
comment: comment_test,
|
|
1116
1131
|
comment_testRelations: comment_testRelations,
|
|
1132
|
+
comment: comment_test,
|
|
1133
|
+
commentRelations: comment_testRelations,
|
|
1117
1134
|
schemaVersion: 2
|
|
1118
1135
|
}"
|
|
1119
1136
|
`);
|
|
@@ -1262,11 +1279,13 @@ describe("generateSchema", () => {
|
|
|
1262
1279
|
|
|
1263
1280
|
export const my_fragment_v2_schema = {
|
|
1264
1281
|
users_my_fragment_v2: users_my_fragment_v2,
|
|
1265
|
-
users: users_my_fragment_v2,
|
|
1266
1282
|
users_my_fragment_v2Relations: users_my_fragment_v2Relations,
|
|
1283
|
+
users: users_my_fragment_v2,
|
|
1284
|
+
usersRelations: users_my_fragment_v2Relations,
|
|
1267
1285
|
posts_my_fragment_v2: posts_my_fragment_v2,
|
|
1268
|
-
posts: posts_my_fragment_v2,
|
|
1269
1286
|
posts_my_fragment_v2Relations: posts_my_fragment_v2Relations,
|
|
1287
|
+
posts: posts_my_fragment_v2,
|
|
1288
|
+
postsRelations: posts_my_fragment_v2Relations,
|
|
1270
1289
|
schemaVersion: 3
|
|
1271
1290
|
}"
|
|
1272
1291
|
`);
|
|
@@ -547,21 +547,15 @@ function generateFragmentSchemaExport(
|
|
|
547
547
|
namespace: string,
|
|
548
548
|
tablesWithRelations?: Set<string>,
|
|
549
549
|
): string {
|
|
550
|
-
const
|
|
550
|
+
const drizzleEntries: string[] = [];
|
|
551
551
|
|
|
552
552
|
for (const table of Object.values(schema.tables)) {
|
|
553
553
|
const physicalExportName = namespace
|
|
554
554
|
? `${table.ormName}_${sanitizeNamespace(namespace)}`
|
|
555
555
|
: table.ormName;
|
|
556
556
|
|
|
557
|
-
//
|
|
558
|
-
|
|
559
|
-
entries.push(` ${physicalExportName}: ${physicalExportName}`);
|
|
560
|
-
|
|
561
|
-
// Add convenient alias using the original table name (without namespace)
|
|
562
|
-
if (namespace) {
|
|
563
|
-
entries.push(` ${table.ormName}: ${physicalExportName}`);
|
|
564
|
-
}
|
|
557
|
+
// Add physical table name to drizzle schema
|
|
558
|
+
drizzleEntries.push(` ${physicalExportName}: ${physicalExportName}`);
|
|
565
559
|
|
|
566
560
|
// Include relations for this table if they exist (either explicit or inverse)
|
|
567
561
|
if (tablesWithRelations?.has(table.name)) {
|
|
@@ -569,16 +563,30 @@ function generateFragmentSchemaExport(
|
|
|
569
563
|
? `${table.ormName}_${sanitizeNamespace(namespace)}Relations`
|
|
570
564
|
: `${table.ormName}Relations`;
|
|
571
565
|
|
|
572
|
-
|
|
566
|
+
drizzleEntries.push(` ${relationsName}: ${relationsName}`);
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
// Add convenience aliases WITH their relations to work around Drizzle bug
|
|
570
|
+
// The key insight: Drizzle needs BOTH the table alias AND its relations alias
|
|
571
|
+
// in the same schema object for relational queries to work
|
|
572
|
+
if (namespace) {
|
|
573
|
+
drizzleEntries.push(` ${table.ormName}: ${physicalExportName}`);
|
|
574
|
+
|
|
575
|
+
// Also add the relations under the aliased name if they exist
|
|
576
|
+
if (tablesWithRelations?.has(table.name)) {
|
|
577
|
+
const physicalRelationsName = `${table.ormName}_${sanitizeNamespace(namespace)}Relations`;
|
|
578
|
+
const aliasRelationsName = `${table.ormName}Relations`;
|
|
579
|
+
drizzleEntries.push(` ${aliasRelationsName}: ${physicalRelationsName}`);
|
|
580
|
+
}
|
|
573
581
|
}
|
|
574
582
|
}
|
|
575
583
|
|
|
576
584
|
// Add schema version as a number
|
|
577
|
-
|
|
585
|
+
drizzleEntries.push(` schemaVersion: ${schema.version}`);
|
|
578
586
|
|
|
579
587
|
const exportName = namespace ? `${sanitizeNamespace(namespace)}_schema` : "_schema";
|
|
580
588
|
|
|
581
|
-
return `export const ${exportName} = {\n${
|
|
589
|
+
return `export const ${exportName} = {\n${drizzleEntries.join(",\n")}\n}`;
|
|
582
590
|
}
|
|
583
591
|
|
|
584
592
|
// ============================================================================
|
|
@@ -45,6 +45,8 @@ export function fullSQLName(column: AnyColumn, mapper?: TableNameMapper) {
|
|
|
45
45
|
* @param condition - The condition tree to build the WHERE clause from
|
|
46
46
|
* @param eb - Kysely expression builder for constructing SQL expressions
|
|
47
47
|
* @param provider - The SQL provider (affects SQL generation)
|
|
48
|
+
* @param mapper - Optional table name mapper for namespace prefixing
|
|
49
|
+
* @param table - The table being queried (used for resolving reference columns)
|
|
48
50
|
* @returns A Kysely expression wrapper representing the WHERE clause
|
|
49
51
|
* @internal
|
|
50
52
|
*
|
|
@@ -64,6 +66,7 @@ export function buildWhere(
|
|
|
64
66
|
eb: ExpressionBuilder<any, any>, // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
65
67
|
provider: SQLProvider,
|
|
66
68
|
mapper?: TableNameMapper,
|
|
69
|
+
table?: AnyTable,
|
|
67
70
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
68
71
|
): ExpressionWrapper<any, any, SqlBool> {
|
|
69
72
|
if (condition.type === "compare") {
|
|
@@ -72,7 +75,28 @@ export function buildWhere(
|
|
|
72
75
|
let val = condition.b;
|
|
73
76
|
|
|
74
77
|
if (!(val instanceof Column)) {
|
|
75
|
-
|
|
78
|
+
// Handle string references - convert external ID to internal ID via subquery
|
|
79
|
+
if (left.role === "reference" && typeof val === "string" && table) {
|
|
80
|
+
// Find relation that uses this column
|
|
81
|
+
const relation = Object.values(table.relations).find((rel) =>
|
|
82
|
+
rel.on.some(([localCol]) => localCol === left.ormName),
|
|
83
|
+
);
|
|
84
|
+
if (relation) {
|
|
85
|
+
const refTable = relation.table;
|
|
86
|
+
const internalIdCol = refTable.getInternalIdColumn();
|
|
87
|
+
const idCol = refTable.getIdColumn();
|
|
88
|
+
const physicalTableName = mapper ? mapper.toPhysical(refTable.ormName) : refTable.ormName;
|
|
89
|
+
|
|
90
|
+
// Build a SQL subquery
|
|
91
|
+
val = eb
|
|
92
|
+
.selectFrom(physicalTableName)
|
|
93
|
+
.select(internalIdCol.name)
|
|
94
|
+
.where(idCol.name, "=", val)
|
|
95
|
+
.limit(1);
|
|
96
|
+
}
|
|
97
|
+
} else {
|
|
98
|
+
val = serialize(val, left, provider);
|
|
99
|
+
}
|
|
76
100
|
}
|
|
77
101
|
|
|
78
102
|
let v: BinaryOperator;
|
|
@@ -123,14 +147,14 @@ export function buildWhere(
|
|
|
123
147
|
|
|
124
148
|
// Nested conditions
|
|
125
149
|
if (condition.type === "and") {
|
|
126
|
-
return eb.and(condition.items.map((v) => buildWhere(v, eb, provider, mapper)));
|
|
150
|
+
return eb.and(condition.items.map((v) => buildWhere(v, eb, provider, mapper, table)));
|
|
127
151
|
}
|
|
128
152
|
|
|
129
153
|
if (condition.type === "not") {
|
|
130
|
-
return eb.not(buildWhere(condition.item, eb, provider, mapper));
|
|
154
|
+
return eb.not(buildWhere(condition.item, eb, provider, mapper, table));
|
|
131
155
|
}
|
|
132
156
|
|
|
133
|
-
return eb.or(condition.items.map((v) => buildWhere(v, eb, provider, mapper)));
|
|
157
|
+
return eb.or(condition.items.map((v) => buildWhere(v, eb, provider, mapper, table)));
|
|
134
158
|
}
|
|
135
159
|
|
|
136
160
|
/**
|
|
@@ -426,7 +450,7 @@ export function createKyselyQueryBuilder(
|
|
|
426
450
|
count(table: AnyTable, { where }: { where?: Condition }): CompiledQuery {
|
|
427
451
|
let query = kysely.selectFrom(getTableName(table)).select(kysely.fn.countAll().as("count"));
|
|
428
452
|
if (where) {
|
|
429
|
-
query = query.where((b) => buildWhere(where, b, provider, mapper));
|
|
453
|
+
query = query.where((b) => buildWhere(where, b, provider, mapper, table));
|
|
430
454
|
}
|
|
431
455
|
return query.compile();
|
|
432
456
|
},
|
|
@@ -463,7 +487,7 @@ export function createKyselyQueryBuilder(
|
|
|
463
487
|
|
|
464
488
|
const where = v.where;
|
|
465
489
|
if (where) {
|
|
466
|
-
query = query.where((eb) => buildWhere(where, eb, provider, mapper));
|
|
490
|
+
query = query.where((eb) => buildWhere(where, eb, provider, mapper, table));
|
|
467
491
|
}
|
|
468
492
|
|
|
469
493
|
if (v.offset !== undefined) {
|
|
@@ -530,7 +554,7 @@ export function createKyselyQueryBuilder(
|
|
|
530
554
|
}
|
|
531
555
|
|
|
532
556
|
if (joinOptions.where) {
|
|
533
|
-
conditions.push(buildWhere(joinOptions.where, eb, provider, mapper));
|
|
557
|
+
conditions.push(buildWhere(joinOptions.where, eb, provider, mapper, targetTable));
|
|
534
558
|
}
|
|
535
559
|
|
|
536
560
|
return eb.and(conditions);
|
|
@@ -570,7 +594,7 @@ export function createKyselyQueryBuilder(
|
|
|
570
594
|
let query = kysely.updateTable(getTableName(table)).set(processed);
|
|
571
595
|
const { where } = v;
|
|
572
596
|
if (where) {
|
|
573
|
-
query = query.where((eb) => buildWhere(where, eb, provider, mapper));
|
|
597
|
+
query = query.where((eb) => buildWhere(where, eb, provider, mapper, table));
|
|
574
598
|
}
|
|
575
599
|
return query.compile();
|
|
576
600
|
},
|
|
@@ -579,7 +603,7 @@ export function createKyselyQueryBuilder(
|
|
|
579
603
|
const idColumn = table.getIdColumn();
|
|
580
604
|
let query = kysely.selectFrom(getTableName(table)).select([`${idColumn.name} as id`]);
|
|
581
605
|
if (where) {
|
|
582
|
-
query = query.where((b) => buildWhere(where, b, provider, mapper));
|
|
606
|
+
query = query.where((b) => buildWhere(where, b, provider, mapper, table));
|
|
583
607
|
}
|
|
584
608
|
return query.limit(1).compile();
|
|
585
609
|
},
|
|
@@ -597,7 +621,7 @@ export function createKyselyQueryBuilder(
|
|
|
597
621
|
query = query.top(1);
|
|
598
622
|
}
|
|
599
623
|
if (where) {
|
|
600
|
-
query = query.where((b) => buildWhere(where, b, provider, mapper));
|
|
624
|
+
query = query.where((b) => buildWhere(where, b, provider, mapper, table));
|
|
601
625
|
}
|
|
602
626
|
return query.compile();
|
|
603
627
|
},
|
|
@@ -624,7 +648,7 @@ export function createKyselyQueryBuilder(
|
|
|
624
648
|
deleteMany(table: AnyTable, { where }: { where?: Condition }): CompiledQuery {
|
|
625
649
|
let query = kysely.deleteFrom(getTableName(table));
|
|
626
650
|
if (where) {
|
|
627
|
-
query = query.where((eb) => buildWhere(where, eb, provider, mapper));
|
|
651
|
+
query = query.where((eb) => buildWhere(where, eb, provider, mapper, table));
|
|
628
652
|
}
|
|
629
653
|
return query.compile();
|
|
630
654
|
},
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { entityKind, is } from "./entity.js";
|
|
2
|
-
import { Column } from "./column.js";
|
|
3
|
-
import { ViewBaseConfig } from "./view-common.js";
|
|
4
|
-
import { Table } from "./table.js";
|
|
5
|
-
import { SQL, sql } from "./sql/sql.js";
|
|
6
|
-
|
|
7
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql+pglite@0.3.11_@libsql+client@0.15.15_@types+better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/alias.js
|
|
8
|
-
var ColumnAliasProxyHandler = class {
|
|
9
|
-
constructor(table) {
|
|
10
|
-
this.table = table;
|
|
11
|
-
}
|
|
12
|
-
static [entityKind] = "ColumnAliasProxyHandler";
|
|
13
|
-
get(columnObj, prop) {
|
|
14
|
-
if (prop === "table") return this.table;
|
|
15
|
-
return columnObj[prop];
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
var TableAliasProxyHandler = class {
|
|
19
|
-
constructor(alias, replaceOriginalName) {
|
|
20
|
-
this.alias = alias;
|
|
21
|
-
this.replaceOriginalName = replaceOriginalName;
|
|
22
|
-
}
|
|
23
|
-
static [entityKind] = "TableAliasProxyHandler";
|
|
24
|
-
get(target, prop) {
|
|
25
|
-
if (prop === Table.Symbol.IsAlias) return true;
|
|
26
|
-
if (prop === Table.Symbol.Name) return this.alias;
|
|
27
|
-
if (this.replaceOriginalName && prop === Table.Symbol.OriginalName) return this.alias;
|
|
28
|
-
if (prop === ViewBaseConfig) return {
|
|
29
|
-
...target[ViewBaseConfig],
|
|
30
|
-
name: this.alias,
|
|
31
|
-
isAlias: true
|
|
32
|
-
};
|
|
33
|
-
if (prop === Table.Symbol.Columns) {
|
|
34
|
-
const columns = target[Table.Symbol.Columns];
|
|
35
|
-
if (!columns) return columns;
|
|
36
|
-
const proxiedColumns = {};
|
|
37
|
-
Object.keys(columns).map((key) => {
|
|
38
|
-
proxiedColumns[key] = new Proxy(columns[key], new ColumnAliasProxyHandler(new Proxy(target, this)));
|
|
39
|
-
});
|
|
40
|
-
return proxiedColumns;
|
|
41
|
-
}
|
|
42
|
-
const value = target[prop];
|
|
43
|
-
if (is(value, Column)) return new Proxy(value, new ColumnAliasProxyHandler(new Proxy(target, this)));
|
|
44
|
-
return value;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
var RelationTableAliasProxyHandler = class {
|
|
48
|
-
constructor(alias) {
|
|
49
|
-
this.alias = alias;
|
|
50
|
-
}
|
|
51
|
-
static [entityKind] = "RelationTableAliasProxyHandler";
|
|
52
|
-
get(target, prop) {
|
|
53
|
-
if (prop === "sourceTable") return aliasedTable(target.sourceTable, this.alias);
|
|
54
|
-
return target[prop];
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
function aliasedTable(table, tableAlias) {
|
|
58
|
-
return new Proxy(table, new TableAliasProxyHandler(tableAlias, false));
|
|
59
|
-
}
|
|
60
|
-
function aliasedTableColumn(column, tableAlias) {
|
|
61
|
-
return new Proxy(column, new ColumnAliasProxyHandler(new Proxy(column.table, new TableAliasProxyHandler(tableAlias, false))));
|
|
62
|
-
}
|
|
63
|
-
function mapColumnsInAliasedSQLToAlias(query, alias) {
|
|
64
|
-
return new SQL.Aliased(mapColumnsInSQLToAlias(query.sql, alias), query.fieldAlias);
|
|
65
|
-
}
|
|
66
|
-
function mapColumnsInSQLToAlias(query, alias) {
|
|
67
|
-
return sql.join(query.queryChunks.map((c) => {
|
|
68
|
-
if (is(c, Column)) return aliasedTableColumn(c, alias);
|
|
69
|
-
if (is(c, SQL)) return mapColumnsInSQLToAlias(c, alias);
|
|
70
|
-
if (is(c, SQL.Aliased)) return mapColumnsInAliasedSQLToAlias(c, alias);
|
|
71
|
-
return c;
|
|
72
|
-
}));
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
//#endregion
|
|
76
|
-
export { ColumnAliasProxyHandler, TableAliasProxyHandler, aliasedTable, aliasedTableColumn, mapColumnsInAliasedSQLToAlias, mapColumnsInSQLToAlias };
|
|
77
|
-
//# sourceMappingURL=alias.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"alias.js","names":[],"sources":["../../../../../../../../node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql+pglite@0.3.11_@libsql+client@0.15.15_@types+better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/alias.js"],"sourcesContent":["import { Column } from \"./column.js\";\nimport { entityKind, is } from \"./entity.js\";\nimport { SQL, sql } from \"./sql/sql.js\";\nimport { Table } from \"./table.js\";\nimport { ViewBaseConfig } from \"./view-common.js\";\nclass ColumnAliasProxyHandler {\n constructor(table) {\n this.table = table;\n }\n static [entityKind] = \"ColumnAliasProxyHandler\";\n get(columnObj, prop) {\n if (prop === \"table\") {\n return this.table;\n }\n return columnObj[prop];\n }\n}\nclass TableAliasProxyHandler {\n constructor(alias, replaceOriginalName) {\n this.alias = alias;\n this.replaceOriginalName = replaceOriginalName;\n }\n static [entityKind] = \"TableAliasProxyHandler\";\n get(target, prop) {\n if (prop === Table.Symbol.IsAlias) {\n return true;\n }\n if (prop === Table.Symbol.Name) {\n return this.alias;\n }\n if (this.replaceOriginalName && prop === Table.Symbol.OriginalName) {\n return this.alias;\n }\n if (prop === ViewBaseConfig) {\n return {\n ...target[ViewBaseConfig],\n name: this.alias,\n isAlias: true\n };\n }\n if (prop === Table.Symbol.Columns) {\n const columns = target[Table.Symbol.Columns];\n if (!columns) {\n return columns;\n }\n const proxiedColumns = {};\n Object.keys(columns).map((key) => {\n proxiedColumns[key] = new Proxy(\n columns[key],\n new ColumnAliasProxyHandler(new Proxy(target, this))\n );\n });\n return proxiedColumns;\n }\n const value = target[prop];\n if (is(value, Column)) {\n return new Proxy(value, new ColumnAliasProxyHandler(new Proxy(target, this)));\n }\n return value;\n }\n}\nclass RelationTableAliasProxyHandler {\n constructor(alias) {\n this.alias = alias;\n }\n static [entityKind] = \"RelationTableAliasProxyHandler\";\n get(target, prop) {\n if (prop === \"sourceTable\") {\n return aliasedTable(target.sourceTable, this.alias);\n }\n return target[prop];\n }\n}\nfunction aliasedTable(table, tableAlias) {\n return new Proxy(table, new TableAliasProxyHandler(tableAlias, false));\n}\nfunction aliasedRelation(relation, tableAlias) {\n return new Proxy(relation, new RelationTableAliasProxyHandler(tableAlias));\n}\nfunction aliasedTableColumn(column, tableAlias) {\n return new Proxy(\n column,\n new ColumnAliasProxyHandler(new Proxy(column.table, new TableAliasProxyHandler(tableAlias, false)))\n );\n}\nfunction mapColumnsInAliasedSQLToAlias(query, alias) {\n return new SQL.Aliased(mapColumnsInSQLToAlias(query.sql, alias), query.fieldAlias);\n}\nfunction mapColumnsInSQLToAlias(query, alias) {\n return sql.join(query.queryChunks.map((c) => {\n if (is(c, Column)) {\n return aliasedTableColumn(c, alias);\n }\n if (is(c, SQL)) {\n return mapColumnsInSQLToAlias(c, alias);\n }\n if (is(c, SQL.Aliased)) {\n return mapColumnsInAliasedSQLToAlias(c, alias);\n }\n return c;\n }));\n}\nexport {\n ColumnAliasProxyHandler,\n RelationTableAliasProxyHandler,\n TableAliasProxyHandler,\n aliasedRelation,\n aliasedTable,\n aliasedTableColumn,\n mapColumnsInAliasedSQLToAlias,\n mapColumnsInSQLToAlias\n};\n//# sourceMappingURL=alias.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;AAKA,IAAM,0BAAN,MAA8B;CAC5B,YAAY,OAAO;AACjB,OAAK,QAAQ;;CAEf,QAAQ,cAAc;CACtB,IAAI,WAAW,MAAM;AACnB,MAAI,SAAS,QACX,QAAO,KAAK;AAEd,SAAO,UAAU;;;AAGrB,IAAM,yBAAN,MAA6B;CAC3B,YAAY,OAAO,qBAAqB;AACtC,OAAK,QAAQ;AACb,OAAK,sBAAsB;;CAE7B,QAAQ,cAAc;CACtB,IAAI,QAAQ,MAAM;AAChB,MAAI,SAAS,MAAM,OAAO,QACxB,QAAO;AAET,MAAI,SAAS,MAAM,OAAO,KACxB,QAAO,KAAK;AAEd,MAAI,KAAK,uBAAuB,SAAS,MAAM,OAAO,aACpD,QAAO,KAAK;AAEd,MAAI,SAAS,eACX,QAAO;GACL,GAAG,OAAO;GACV,MAAM,KAAK;GACX,SAAS;GACV;AAEH,MAAI,SAAS,MAAM,OAAO,SAAS;GACjC,MAAM,UAAU,OAAO,MAAM,OAAO;AACpC,OAAI,CAAC,QACH,QAAO;GAET,MAAM,iBAAiB,EAAE;AACzB,UAAO,KAAK,QAAQ,CAAC,KAAK,QAAQ;AAChC,mBAAe,OAAO,IAAI,MACxB,QAAQ,MACR,IAAI,wBAAwB,IAAI,MAAM,QAAQ,KAAK,CAAC,CACrD;KACD;AACF,UAAO;;EAET,MAAM,QAAQ,OAAO;AACrB,MAAI,GAAG,OAAO,OAAO,CACnB,QAAO,IAAI,MAAM,OAAO,IAAI,wBAAwB,IAAI,MAAM,QAAQ,KAAK,CAAC,CAAC;AAE/E,SAAO;;;AAGX,IAAM,iCAAN,MAAqC;CACnC,YAAY,OAAO;AACjB,OAAK,QAAQ;;CAEf,QAAQ,cAAc;CACtB,IAAI,QAAQ,MAAM;AAChB,MAAI,SAAS,cACX,QAAO,aAAa,OAAO,aAAa,KAAK,MAAM;AAErD,SAAO,OAAO;;;AAGlB,SAAS,aAAa,OAAO,YAAY;AACvC,QAAO,IAAI,MAAM,OAAO,IAAI,uBAAuB,YAAY,MAAM,CAAC;;AAKxE,SAAS,mBAAmB,QAAQ,YAAY;AAC9C,QAAO,IAAI,MACT,QACA,IAAI,wBAAwB,IAAI,MAAM,OAAO,OAAO,IAAI,uBAAuB,YAAY,MAAM,CAAC,CAAC,CACpG;;AAEH,SAAS,8BAA8B,OAAO,OAAO;AACnD,QAAO,IAAI,IAAI,QAAQ,uBAAuB,MAAM,KAAK,MAAM,EAAE,MAAM,WAAW;;AAEpF,SAAS,uBAAuB,OAAO,OAAO;AAC5C,QAAO,IAAI,KAAK,MAAM,YAAY,KAAK,MAAM;AAC3C,MAAI,GAAG,GAAG,OAAO,CACf,QAAO,mBAAmB,GAAG,MAAM;AAErC,MAAI,GAAG,GAAG,IAAI,CACZ,QAAO,uBAAuB,GAAG,MAAM;AAEzC,MAAI,GAAG,GAAG,IAAI,QAAQ,CACpB,QAAO,8BAA8B,GAAG,MAAM;AAEhD,SAAO;GACP,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { entityKind } from "./entity.js";
|
|
2
|
-
import { Table } from "./table.js";
|
|
3
|
-
|
|
4
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql+pglite@0.3.11_@libsql+client@0.15.15_@types+better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/casing.js
|
|
5
|
-
function toSnakeCase(input) {
|
|
6
|
-
return (input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? []).map((word) => word.toLowerCase()).join("_");
|
|
7
|
-
}
|
|
8
|
-
function toCamelCase(input) {
|
|
9
|
-
return (input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? []).reduce((acc, word, i) => {
|
|
10
|
-
return acc + (i === 0 ? word.toLowerCase() : `${word[0].toUpperCase()}${word.slice(1)}`);
|
|
11
|
-
}, "");
|
|
12
|
-
}
|
|
13
|
-
function noopCase(input) {
|
|
14
|
-
return input;
|
|
15
|
-
}
|
|
16
|
-
var CasingCache = class {
|
|
17
|
-
static [entityKind] = "CasingCache";
|
|
18
|
-
/** @internal */
|
|
19
|
-
cache = {};
|
|
20
|
-
cachedTables = {};
|
|
21
|
-
convert;
|
|
22
|
-
constructor(casing) {
|
|
23
|
-
this.convert = casing === "snake_case" ? toSnakeCase : casing === "camelCase" ? toCamelCase : noopCase;
|
|
24
|
-
}
|
|
25
|
-
getColumnCasing(column) {
|
|
26
|
-
if (!column.keyAsName) return column.name;
|
|
27
|
-
const key = `${column.table[Table.Symbol.Schema] ?? "public"}.${column.table[Table.Symbol.OriginalName]}.${column.name}`;
|
|
28
|
-
if (!this.cache[key]) this.cacheTable(column.table);
|
|
29
|
-
return this.cache[key];
|
|
30
|
-
}
|
|
31
|
-
cacheTable(table) {
|
|
32
|
-
const tableKey = `${table[Table.Symbol.Schema] ?? "public"}.${table[Table.Symbol.OriginalName]}`;
|
|
33
|
-
if (!this.cachedTables[tableKey]) {
|
|
34
|
-
for (const column of Object.values(table[Table.Symbol.Columns])) {
|
|
35
|
-
const columnKey = `${tableKey}.${column.name}`;
|
|
36
|
-
this.cache[columnKey] = this.convert(column.name);
|
|
37
|
-
}
|
|
38
|
-
this.cachedTables[tableKey] = true;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
clearCache() {
|
|
42
|
-
this.cache = {};
|
|
43
|
-
this.cachedTables = {};
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
//#endregion
|
|
48
|
-
export { CasingCache };
|
|
49
|
-
//# sourceMappingURL=casing.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"casing.js","names":[],"sources":["../../../../../../../../node_modules/.pnpm/drizzle-orm@0.44.7_@electric-sql+pglite@0.3.11_@libsql+client@0.15.15_@types+better-sql_d581c715d15ad795b3728767f4706e8d/node_modules/drizzle-orm/casing.js"],"sourcesContent":["import { entityKind } from \"./entity.js\";\nimport { Table } from \"./table.js\";\nfunction toSnakeCase(input) {\n const words = input.replace(/['\\u2019]/g, \"\").match(/[\\da-z]+|[A-Z]+(?![a-z])|[A-Z][\\da-z]+/g) ?? [];\n return words.map((word) => word.toLowerCase()).join(\"_\");\n}\nfunction toCamelCase(input) {\n const words = input.replace(/['\\u2019]/g, \"\").match(/[\\da-z]+|[A-Z]+(?![a-z])|[A-Z][\\da-z]+/g) ?? [];\n return words.reduce((acc, word, i) => {\n const formattedWord = i === 0 ? word.toLowerCase() : `${word[0].toUpperCase()}${word.slice(1)}`;\n return acc + formattedWord;\n }, \"\");\n}\nfunction noopCase(input) {\n return input;\n}\nclass CasingCache {\n static [entityKind] = \"CasingCache\";\n /** @internal */\n cache = {};\n cachedTables = {};\n convert;\n constructor(casing) {\n this.convert = casing === \"snake_case\" ? toSnakeCase : casing === \"camelCase\" ? toCamelCase : noopCase;\n }\n getColumnCasing(column) {\n if (!column.keyAsName) return column.name;\n const schema = column.table[Table.Symbol.Schema] ?? \"public\";\n const tableName = column.table[Table.Symbol.OriginalName];\n const key = `${schema}.${tableName}.${column.name}`;\n if (!this.cache[key]) {\n this.cacheTable(column.table);\n }\n return this.cache[key];\n }\n cacheTable(table) {\n const schema = table[Table.Symbol.Schema] ?? \"public\";\n const tableName = table[Table.Symbol.OriginalName];\n const tableKey = `${schema}.${tableName}`;\n if (!this.cachedTables[tableKey]) {\n for (const column of Object.values(table[Table.Symbol.Columns])) {\n const columnKey = `${tableKey}.${column.name}`;\n this.cache[columnKey] = this.convert(column.name);\n }\n this.cachedTables[tableKey] = true;\n }\n }\n clearCache() {\n this.cache = {};\n this.cachedTables = {};\n }\n}\nexport {\n CasingCache,\n toCamelCase,\n toSnakeCase\n};\n//# sourceMappingURL=casing.js.map"],"x_google_ignoreList":[0],"mappings":";;;;AAEA,SAAS,YAAY,OAAO;AAE1B,SADc,MAAM,QAAQ,cAAc,GAAG,CAAC,MAAM,0CAA0C,IAAI,EAAE,EACvF,KAAK,SAAS,KAAK,aAAa,CAAC,CAAC,KAAK,IAAI;;AAE1D,SAAS,YAAY,OAAO;AAE1B,SADc,MAAM,QAAQ,cAAc,GAAG,CAAC,MAAM,0CAA0C,IAAI,EAAE,EACvF,QAAQ,KAAK,MAAM,MAAM;AAEpC,SAAO,OADe,MAAM,IAAI,KAAK,aAAa,GAAG,GAAG,KAAK,GAAG,aAAa,GAAG,KAAK,MAAM,EAAE;IAE5F,GAAG;;AAER,SAAS,SAAS,OAAO;AACvB,QAAO;;AAET,IAAM,cAAN,MAAkB;CAChB,QAAQ,cAAc;;CAEtB,QAAQ,EAAE;CACV,eAAe,EAAE;CACjB;CACA,YAAY,QAAQ;AAClB,OAAK,UAAU,WAAW,eAAe,cAAc,WAAW,cAAc,cAAc;;CAEhG,gBAAgB,QAAQ;AACtB,MAAI,CAAC,OAAO,UAAW,QAAO,OAAO;EAGrC,MAAM,MAAM,GAFG,OAAO,MAAM,MAAM,OAAO,WAAW,SAE9B,GADJ,OAAO,MAAM,MAAM,OAAO,cACT,GAAG,OAAO;AAC7C,MAAI,CAAC,KAAK,MAAM,KACd,MAAK,WAAW,OAAO,MAAM;AAE/B,SAAO,KAAK,MAAM;;CAEpB,WAAW,OAAO;EAGhB,MAAM,WAAW,GAFF,MAAM,MAAM,OAAO,WAAW,SAElB,GADT,MAAM,MAAM,OAAO;AAErC,MAAI,CAAC,KAAK,aAAa,WAAW;AAChC,QAAK,MAAM,UAAU,OAAO,OAAO,MAAM,MAAM,OAAO,SAAS,EAAE;IAC/D,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO;AACxC,SAAK,MAAM,aAAa,KAAK,QAAQ,OAAO,KAAK;;AAEnD,QAAK,aAAa,YAAY;;;CAGlC,aAAa;AACX,OAAK,QAAQ,EAAE;AACf,OAAK,eAAe,EAAE"}
|