drizzle-orm 0.36.4-3c69a1f → 0.36.4-3efe329
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/alias.cjs.map +1 -1
- package/alias.d.cts +3 -3
- package/alias.d.ts +3 -3
- package/alias.js.map +1 -1
- package/aws-data-api/pg/driver.cjs +5 -19
- package/aws-data-api/pg/driver.cjs.map +1 -1
- package/aws-data-api/pg/driver.d.cts +8 -9
- package/aws-data-api/pg/driver.d.ts +8 -9
- package/aws-data-api/pg/driver.js +8 -9
- package/aws-data-api/pg/driver.js.map +1 -1
- package/aws-data-api/pg/migrator.cjs.map +1 -1
- package/aws-data-api/pg/migrator.d.cts +1 -2
- package/aws-data-api/pg/migrator.d.ts +1 -2
- package/aws-data-api/pg/migrator.js.map +1 -1
- package/aws-data-api/pg/session.cjs +4 -67
- package/aws-data-api/pg/session.cjs.map +1 -1
- package/aws-data-api/pg/session.d.cts +8 -13
- package/aws-data-api/pg/session.d.ts +8 -13
- package/aws-data-api/pg/session.js +4 -67
- package/aws-data-api/pg/session.js.map +1 -1
- package/better-sqlite3/driver.cjs +5 -12
- package/better-sqlite3/driver.cjs.map +1 -1
- package/better-sqlite3/driver.d.cts +6 -7
- package/better-sqlite3/driver.d.ts +6 -7
- package/better-sqlite3/driver.js +8 -12
- package/better-sqlite3/driver.js.map +1 -1
- package/better-sqlite3/migrator.cjs.map +1 -1
- package/better-sqlite3/migrator.d.cts +1 -2
- package/better-sqlite3/migrator.d.ts +1 -2
- package/better-sqlite3/migrator.js.map +1 -1
- package/better-sqlite3/session.cjs +4 -49
- package/better-sqlite3/session.cjs.map +1 -1
- package/better-sqlite3/session.d.cts +8 -14
- package/better-sqlite3/session.d.ts +8 -14
- package/better-sqlite3/session.js +4 -49
- package/better-sqlite3/session.js.map +1 -1
- package/bun-sqlite/driver.cjs +5 -22
- package/bun-sqlite/driver.cjs.map +1 -1
- package/bun-sqlite/driver.d.cts +6 -7
- package/bun-sqlite/driver.d.ts +6 -7
- package/bun-sqlite/driver.js +8 -12
- package/bun-sqlite/driver.js.map +1 -1
- package/bun-sqlite/migrator.cjs.map +1 -1
- package/bun-sqlite/migrator.d.cts +1 -2
- package/bun-sqlite/migrator.d.ts +1 -2
- package/bun-sqlite/migrator.js.map +1 -1
- package/bun-sqlite/session.cjs +4 -49
- package/bun-sqlite/session.cjs.map +1 -1
- package/bun-sqlite/session.d.cts +8 -14
- package/bun-sqlite/session.d.ts +8 -14
- package/bun-sqlite/session.js +4 -49
- package/bun-sqlite/session.js.map +1 -1
- package/column-builder.cjs.map +1 -1
- package/column-builder.d.cts +4 -3
- package/column-builder.d.ts +4 -3
- package/column-builder.js.map +1 -1
- package/d1/driver.cjs +5 -22
- package/d1/driver.cjs.map +1 -1
- package/d1/driver.d.cts +2 -3
- package/d1/driver.d.ts +2 -3
- package/d1/driver.js +8 -12
- package/d1/driver.js.map +1 -1
- package/d1/migrator.cjs.map +1 -1
- package/d1/migrator.d.cts +1 -2
- package/d1/migrator.d.ts +1 -2
- package/d1/migrator.js.map +1 -1
- package/d1/session.cjs +6 -48
- package/d1/session.cjs.map +1 -1
- package/d1/session.d.cts +8 -15
- package/d1/session.d.ts +8 -15
- package/d1/session.js +6 -48
- package/d1/session.js.map +1 -1
- package/durable-sqlite/driver.cjs +64 -0
- package/durable-sqlite/driver.cjs.map +1 -0
- package/durable-sqlite/driver.d.cts +9 -0
- package/durable-sqlite/driver.d.ts +9 -0
- package/durable-sqlite/driver.js +42 -0
- package/durable-sqlite/driver.js.map +1 -0
- package/durable-sqlite/index.cjs +25 -0
- package/durable-sqlite/index.cjs.map +1 -0
- package/durable-sqlite/index.d.cts +2 -0
- package/durable-sqlite/index.d.ts +2 -0
- package/durable-sqlite/index.js +3 -0
- package/durable-sqlite/index.js.map +1 -0
- package/durable-sqlite/migrator.cjs +85 -0
- package/durable-sqlite/migrator.cjs.map +1 -0
- package/durable-sqlite/migrator.d.cts +14 -0
- package/durable-sqlite/migrator.d.ts +14 -0
- package/durable-sqlite/migrator.js +61 -0
- package/durable-sqlite/migrator.js.map +1 -0
- package/durable-sqlite/session.cjs +131 -0
- package/durable-sqlite/session.cjs.map +1 -0
- package/durable-sqlite/session.d.cts +46 -0
- package/durable-sqlite/session.d.ts +46 -0
- package/durable-sqlite/session.js +107 -0
- package/durable-sqlite/session.js.map +1 -0
- package/expo-sqlite/driver.cjs +5 -22
- package/expo-sqlite/driver.cjs.map +1 -1
- package/expo-sqlite/driver.d.cts +2 -3
- package/expo-sqlite/driver.d.ts +2 -3
- package/expo-sqlite/driver.js +8 -12
- package/expo-sqlite/driver.js.map +1 -1
- package/expo-sqlite/migrator.cjs.map +1 -1
- package/expo-sqlite/migrator.d.cts +2 -3
- package/expo-sqlite/migrator.d.ts +2 -3
- package/expo-sqlite/migrator.js.map +1 -1
- package/expo-sqlite/query.cjs +2 -13
- package/expo-sqlite/query.cjs.map +1 -1
- package/expo-sqlite/query.d.cts +1 -2
- package/expo-sqlite/query.d.ts +1 -2
- package/expo-sqlite/query.js +2 -3
- package/expo-sqlite/query.js.map +1 -1
- package/expo-sqlite/session.cjs +4 -47
- package/expo-sqlite/session.cjs.map +1 -1
- package/expo-sqlite/session.d.cts +8 -14
- package/expo-sqlite/session.d.ts +8 -14
- package/expo-sqlite/session.js +4 -47
- package/expo-sqlite/session.js.map +1 -1
- package/libsql/driver-core.cjs +5 -22
- package/libsql/driver-core.cjs.map +1 -1
- package/libsql/driver-core.d.cts +1 -2
- package/libsql/driver-core.d.ts +1 -2
- package/libsql/driver-core.js +8 -12
- package/libsql/driver-core.js.map +1 -1
- package/libsql/driver.cjs.map +1 -1
- package/libsql/driver.d.cts +5 -6
- package/libsql/driver.d.ts +5 -6
- package/libsql/driver.js.map +1 -1
- package/libsql/http/index.cjs.map +1 -1
- package/libsql/http/index.d.cts +5 -6
- package/libsql/http/index.d.ts +5 -6
- package/libsql/http/index.js.map +1 -1
- package/libsql/migrator.cjs.map +1 -1
- package/libsql/migrator.d.cts +1 -2
- package/libsql/migrator.d.ts +1 -2
- package/libsql/migrator.js.map +1 -1
- package/libsql/node/index.cjs.map +1 -1
- package/libsql/node/index.d.cts +5 -6
- package/libsql/node/index.d.ts +5 -6
- package/libsql/node/index.js.map +1 -1
- package/libsql/session.cjs +4 -60
- package/libsql/session.cjs.map +1 -1
- package/libsql/session.d.cts +9 -15
- package/libsql/session.d.ts +9 -15
- package/libsql/session.js +4 -60
- package/libsql/session.js.map +1 -1
- package/libsql/sqlite3/index.cjs.map +1 -1
- package/libsql/sqlite3/index.d.cts +5 -6
- package/libsql/sqlite3/index.d.ts +5 -6
- package/libsql/sqlite3/index.js.map +1 -1
- package/libsql/wasm/index.cjs.map +1 -1
- package/libsql/wasm/index.d.cts +5 -6
- package/libsql/wasm/index.d.ts +5 -6
- package/libsql/wasm/index.js.map +1 -1
- package/libsql/web/index.cjs.map +1 -1
- package/libsql/web/index.d.cts +5 -6
- package/libsql/web/index.d.ts +5 -6
- package/libsql/web/index.js.map +1 -1
- package/libsql/ws/index.cjs.map +1 -1
- package/libsql/ws/index.d.cts +5 -6
- package/libsql/ws/index.d.ts +5 -6
- package/libsql/ws/index.js.map +1 -1
- package/mysql-core/db.cjs +8 -29
- package/mysql-core/db.cjs.map +1 -1
- package/mysql-core/db.d.cts +8 -15
- package/mysql-core/db.d.ts +8 -15
- package/mysql-core/db.js +7 -28
- package/mysql-core/db.js.map +1 -1
- package/mysql-core/dialect.cjs +15 -170
- package/mysql-core/dialect.cjs.map +1 -1
- package/mysql-core/dialect.d.cts +13 -29
- package/mysql-core/dialect.d.ts +13 -29
- package/mysql-core/dialect.js +21 -167
- package/mysql-core/dialect.js.map +1 -1
- package/mysql-core/query-builders/count.cjs.map +1 -1
- package/mysql-core/query-builders/count.d.cts +1 -1
- package/mysql-core/query-builders/count.d.ts +1 -1
- package/mysql-core/query-builders/count.js.map +1 -1
- package/mysql-core/query-builders/query.cjs +31 -18
- package/mysql-core/query-builders/query.cjs.map +1 -1
- package/mysql-core/query-builders/query.d.cts +10 -8
- package/mysql-core/query-builders/query.d.ts +10 -8
- package/mysql-core/query-builders/query.js +31 -18
- package/mysql-core/query-builders/query.js.map +1 -1
- package/mysql-core/session.cjs +2 -3
- package/mysql-core/session.cjs.map +1 -1
- package/mysql-core/session.d.cts +7 -10
- package/mysql-core/session.d.ts +7 -10
- package/mysql-core/session.js +2 -3
- package/mysql-core/session.js.map +1 -1
- package/mysql-proxy/driver.cjs +5 -22
- package/mysql-proxy/driver.cjs.map +1 -1
- package/mysql-proxy/driver.d.cts +2 -3
- package/mysql-proxy/driver.d.ts +2 -3
- package/mysql-proxy/driver.js +8 -12
- package/mysql-proxy/driver.js.map +1 -1
- package/mysql-proxy/migrator.cjs.map +1 -1
- package/mysql-proxy/migrator.d.cts +1 -2
- package/mysql-proxy/migrator.d.ts +1 -2
- package/mysql-proxy/migrator.js.map +1 -1
- package/mysql-proxy/session.cjs +2 -47
- package/mysql-proxy/session.cjs.map +1 -1
- package/mysql-proxy/session.d.cts +8 -13
- package/mysql-proxy/session.d.ts +8 -13
- package/mysql-proxy/session.js +2 -47
- package/mysql-proxy/session.js.map +1 -1
- package/mysql2/driver.cjs +7 -24
- package/mysql2/driver.cjs.map +1 -1
- package/mysql2/driver.d.cts +9 -10
- package/mysql2/driver.d.ts +9 -10
- package/mysql2/driver.js +10 -14
- package/mysql2/driver.js.map +1 -1
- package/mysql2/migrator.cjs.map +1 -1
- package/mysql2/migrator.d.cts +1 -2
- package/mysql2/migrator.d.ts +1 -2
- package/mysql2/migrator.js.map +1 -1
- package/mysql2/session.cjs +2 -51
- package/mysql2/session.cjs.map +1 -1
- package/mysql2/session.d.cts +8 -13
- package/mysql2/session.d.ts +8 -13
- package/mysql2/session.js +2 -51
- package/mysql2/session.js.map +1 -1
- package/neon-http/driver.cjs +8 -22
- package/neon-http/driver.cjs.map +1 -1
- package/neon-http/driver.d.cts +10 -11
- package/neon-http/driver.d.ts +10 -11
- package/neon-http/driver.js +8 -12
- package/neon-http/driver.js.map +1 -1
- package/neon-http/migrator.cjs.map +1 -1
- package/neon-http/migrator.d.cts +1 -2
- package/neon-http/migrator.d.ts +1 -2
- package/neon-http/migrator.js.map +1 -1
- package/neon-http/session.cjs +2 -32
- package/neon-http/session.cjs.map +1 -1
- package/neon-http/session.d.cts +8 -13
- package/neon-http/session.d.ts +8 -13
- package/neon-http/session.js +2 -32
- package/neon-http/session.js.map +1 -1
- package/neon-serverless/driver.cjs +7 -18
- package/neon-serverless/driver.cjs.map +1 -1
- package/neon-serverless/driver.d.cts +8 -9
- package/neon-serverless/driver.d.ts +8 -9
- package/neon-serverless/driver.js +10 -8
- package/neon-serverless/driver.js.map +1 -1
- package/neon-serverless/migrator.cjs.map +1 -1
- package/neon-serverless/migrator.d.cts +1 -2
- package/neon-serverless/migrator.d.ts +1 -2
- package/neon-serverless/migrator.js.map +1 -1
- package/neon-serverless/session.cjs +5 -40
- package/neon-serverless/session.cjs.map +1 -1
- package/neon-serverless/session.d.cts +8 -13
- package/neon-serverless/session.d.ts +8 -13
- package/neon-serverless/session.js +5 -40
- package/neon-serverless/session.js.map +1 -1
- package/node-postgres/driver.cjs +7 -13
- package/node-postgres/driver.cjs.map +1 -1
- package/node-postgres/driver.d.cts +8 -9
- package/node-postgres/driver.d.ts +8 -9
- package/node-postgres/driver.js +10 -13
- package/node-postgres/driver.js.map +1 -1
- package/node-postgres/migrator.cjs.map +1 -1
- package/node-postgres/migrator.d.cts +1 -2
- package/node-postgres/migrator.d.ts +1 -2
- package/node-postgres/migrator.js.map +1 -1
- package/node-postgres/session.cjs +4 -45
- package/node-postgres/session.cjs.map +1 -1
- package/node-postgres/session.d.cts +8 -13
- package/node-postgres/session.d.ts +8 -13
- package/node-postgres/session.js +4 -45
- package/node-postgres/session.js.map +1 -1
- package/op-sqlite/driver.cjs +5 -22
- package/op-sqlite/driver.cjs.map +1 -1
- package/op-sqlite/driver.d.cts +2 -3
- package/op-sqlite/driver.d.ts +2 -3
- package/op-sqlite/driver.js +8 -12
- package/op-sqlite/driver.js.map +1 -1
- package/op-sqlite/migrator.cjs.map +1 -1
- package/op-sqlite/migrator.d.cts +2 -3
- package/op-sqlite/migrator.d.ts +2 -3
- package/op-sqlite/migrator.js.map +1 -1
- package/op-sqlite/session.cjs +4 -47
- package/op-sqlite/session.cjs.map +1 -1
- package/op-sqlite/session.d.cts +8 -14
- package/op-sqlite/session.d.ts +8 -14
- package/op-sqlite/session.js +4 -47
- package/op-sqlite/session.js.map +1 -1
- package/package.json +786 -53
- package/pg-core/db.cjs +11 -33
- package/pg-core/db.cjs.map +1 -1
- package/pg-core/db.d.cts +11 -18
- package/pg-core/db.d.ts +11 -18
- package/pg-core/db.js +10 -32
- package/pg-core/db.js.map +1 -1
- package/pg-core/dialect.cjs +488 -146
- package/pg-core/dialect.cjs.map +1 -1
- package/pg-core/dialect.d.cts +7 -21
- package/pg-core/dialect.d.ts +7 -21
- package/pg-core/dialect.js +494 -143
- package/pg-core/dialect.js.map +1 -1
- package/pg-core/query-builders/count.cjs +1 -0
- package/pg-core/query-builders/count.cjs.map +1 -1
- package/pg-core/query-builders/count.d.cts +3 -2
- package/pg-core/query-builders/count.d.ts +3 -2
- package/pg-core/query-builders/count.js +1 -0
- package/pg-core/query-builders/count.js.map +1 -1
- package/pg-core/query-builders/delete.cjs.map +1 -1
- package/pg-core/query-builders/delete.js.map +1 -1
- package/pg-core/query-builders/insert.cjs +1 -9
- package/pg-core/query-builders/insert.cjs.map +1 -1
- package/pg-core/query-builders/insert.js +1 -9
- package/pg-core/query-builders/insert.js.map +1 -1
- package/pg-core/query-builders/query.cjs +18 -15
- package/pg-core/query-builders/query.cjs.map +1 -1
- package/pg-core/query-builders/query.d.cts +6 -6
- package/pg-core/query-builders/query.d.ts +6 -6
- package/pg-core/query-builders/query.js +18 -15
- package/pg-core/query-builders/query.js.map +1 -1
- package/pg-core/query-builders/refresh-materialized-view.cjs.map +1 -1
- package/pg-core/query-builders/refresh-materialized-view.js.map +1 -1
- package/pg-core/query-builders/select.cjs +2 -10
- package/pg-core/query-builders/select.cjs.map +1 -1
- package/pg-core/query-builders/select.js +8 -11
- package/pg-core/query-builders/select.js.map +1 -1
- package/pg-core/query-builders/update.cjs +1 -7
- package/pg-core/query-builders/update.cjs.map +1 -1
- package/pg-core/query-builders/update.d.cts +2 -2
- package/pg-core/query-builders/update.d.ts +2 -2
- package/pg-core/query-builders/update.js +6 -8
- package/pg-core/query-builders/update.js.map +1 -1
- package/pg-core/session.cjs +2 -3
- package/pg-core/session.cjs.map +1 -1
- package/pg-core/session.d.cts +8 -10
- package/pg-core/session.d.ts +8 -10
- package/pg-core/session.js +2 -3
- package/pg-core/session.js.map +1 -1
- package/pg-proxy/driver.cjs +5 -21
- package/pg-proxy/driver.cjs.map +1 -1
- package/pg-proxy/driver.d.cts +2 -3
- package/pg-proxy/driver.d.ts +2 -3
- package/pg-proxy/driver.js +8 -11
- package/pg-proxy/driver.js.map +1 -1
- package/pg-proxy/migrator.cjs.map +1 -1
- package/pg-proxy/migrator.d.cts +1 -2
- package/pg-proxy/migrator.d.ts +1 -2
- package/pg-proxy/migrator.js.map +1 -1
- package/pg-proxy/session.cjs +2 -37
- package/pg-proxy/session.cjs.map +1 -1
- package/pg-proxy/session.d.cts +8 -13
- package/pg-proxy/session.d.ts +8 -13
- package/pg-proxy/session.js +2 -37
- package/pg-proxy/session.js.map +1 -1
- package/pglite/driver.cjs +7 -23
- package/pglite/driver.cjs.map +1 -1
- package/pglite/driver.d.cts +8 -9
- package/pglite/driver.d.ts +8 -9
- package/pglite/driver.js +10 -13
- package/pglite/driver.js.map +1 -1
- package/pglite/migrator.cjs.map +1 -1
- package/pglite/migrator.d.cts +1 -2
- package/pglite/migrator.d.ts +1 -2
- package/pglite/migrator.js.map +1 -1
- package/pglite/session.cjs +3 -34
- package/pglite/session.cjs.map +1 -1
- package/pglite/session.d.cts +8 -13
- package/pglite/session.d.ts +8 -13
- package/pglite/session.js +3 -34
- package/pglite/session.js.map +1 -1
- package/planetscale-serverless/driver.cjs +5 -22
- package/planetscale-serverless/driver.cjs.map +1 -1
- package/planetscale-serverless/driver.d.cts +6 -7
- package/planetscale-serverless/driver.d.ts +6 -7
- package/planetscale-serverless/driver.js +8 -12
- package/planetscale-serverless/driver.js.map +1 -1
- package/planetscale-serverless/migrator.cjs.map +1 -1
- package/planetscale-serverless/migrator.d.cts +1 -2
- package/planetscale-serverless/migrator.d.ts +1 -2
- package/planetscale-serverless/migrator.js.map +1 -1
- package/planetscale-serverless/session.cjs +5 -68
- package/planetscale-serverless/session.cjs.map +1 -1
- package/planetscale-serverless/session.d.cts +9 -14
- package/planetscale-serverless/session.d.ts +9 -14
- package/planetscale-serverless/session.js +5 -68
- package/planetscale-serverless/session.js.map +1 -1
- package/postgres-js/driver.cjs +6 -12
- package/postgres-js/driver.cjs.map +1 -1
- package/postgres-js/driver.d.cts +6 -7
- package/postgres-js/driver.d.ts +6 -7
- package/postgres-js/driver.js +9 -12
- package/postgres-js/driver.js.map +1 -1
- package/postgres-js/migrator.cjs.map +1 -1
- package/postgres-js/migrator.d.cts +1 -2
- package/postgres-js/migrator.d.ts +1 -2
- package/postgres-js/migrator.js.map +1 -1
- package/postgres-js/session.cjs +6 -51
- package/postgres-js/session.cjs.map +1 -1
- package/postgres-js/session.d.cts +9 -15
- package/postgres-js/session.d.ts +9 -15
- package/postgres-js/session.js +6 -51
- package/postgres-js/session.js.map +1 -1
- package/prisma/mysql/driver.cjs +1 -1
- package/prisma/mysql/driver.cjs.map +1 -1
- package/prisma/mysql/driver.js +1 -1
- package/prisma/mysql/driver.js.map +1 -1
- package/prisma/mysql/session.cjs +0 -3
- package/prisma/mysql/session.cjs.map +1 -1
- package/prisma/mysql/session.d.cts +1 -3
- package/prisma/mysql/session.d.ts +1 -3
- package/prisma/mysql/session.js +0 -3
- package/prisma/mysql/session.js.map +1 -1
- package/prisma/pg/driver.cjs +1 -1
- package/prisma/pg/driver.cjs.map +1 -1
- package/prisma/pg/driver.js +1 -1
- package/prisma/pg/driver.js.map +1 -1
- package/prisma/pg/session.cjs +0 -3
- package/prisma/pg/session.cjs.map +1 -1
- package/prisma/pg/session.d.cts +1 -3
- package/prisma/pg/session.d.ts +1 -3
- package/prisma/pg/session.js +0 -3
- package/prisma/pg/session.js.map +1 -1
- package/prisma/sqlite/driver.cjs +1 -1
- package/prisma/sqlite/driver.cjs.map +1 -1
- package/prisma/sqlite/driver.js +1 -1
- package/prisma/sqlite/driver.js.map +1 -1
- package/prisma/sqlite/session.cjs +0 -3
- package/prisma/sqlite/session.cjs.map +1 -1
- package/prisma/sqlite/session.d.cts +2 -4
- package/prisma/sqlite/session.d.ts +2 -4
- package/prisma/sqlite/session.js +0 -3
- package/prisma/sqlite/session.js.map +1 -1
- package/relations.cjs +245 -468
- package/relations.cjs.map +1 -1
- package/relations.d.cts +125 -264
- package/relations.d.ts +125 -264
- package/relations.js +238 -455
- package/relations.js.map +1 -1
- package/singlestore/driver.cjs +113 -0
- package/singlestore/driver.cjs.map +1 -0
- package/singlestore/driver.d.cts +52 -0
- package/singlestore/driver.d.ts +52 -0
- package/singlestore/driver.js +89 -0
- package/singlestore/driver.js.map +1 -0
- package/singlestore/index.cjs +25 -0
- package/singlestore/index.cjs.map +1 -0
- package/singlestore/index.d.cts +2 -0
- package/singlestore/index.d.ts +2 -0
- package/singlestore/index.js +3 -0
- package/singlestore/index.js.map +1 -0
- package/singlestore/migrator.cjs +33 -0
- package/singlestore/migrator.cjs.map +1 -0
- package/singlestore/migrator.d.cts +3 -0
- package/singlestore/migrator.d.ts +3 -0
- package/singlestore/migrator.js +9 -0
- package/singlestore/migrator.js.map +1 -0
- package/singlestore/session.cjs +258 -0
- package/singlestore/session.cjs.map +1 -0
- package/singlestore/session.d.cts +52 -0
- package/singlestore/session.d.ts +52 -0
- package/singlestore/session.js +236 -0
- package/singlestore/session.js.map +1 -0
- package/singlestore-core/alias.cjs +32 -0
- package/singlestore-core/alias.cjs.map +1 -0
- package/singlestore-core/alias.d.cts +4 -0
- package/singlestore-core/alias.d.ts +4 -0
- package/singlestore-core/alias.js +8 -0
- package/singlestore-core/alias.js.map +1 -0
- package/singlestore-core/columns/all.cjs +80 -0
- package/singlestore-core/columns/all.cjs.map +1 -0
- package/singlestore-core/columns/all.d.cts +51 -0
- package/singlestore-core/columns/all.d.ts +51 -0
- package/singlestore-core/columns/all.js +56 -0
- package/singlestore-core/columns/all.js.map +1 -0
- package/singlestore-core/columns/bigint.cjs +96 -0
- package/singlestore-core/columns/bigint.cjs.map +1 -0
- package/singlestore-core/columns/bigint.d.cts +54 -0
- package/singlestore-core/columns/bigint.d.ts +54 -0
- package/singlestore-core/columns/bigint.js +68 -0
- package/singlestore-core/columns/bigint.js.map +1 -0
- package/singlestore-core/columns/binary.cjs +60 -0
- package/singlestore-core/columns/binary.cjs.map +1 -0
- package/singlestore-core/columns/binary.d.cts +28 -0
- package/singlestore-core/columns/binary.d.ts +28 -0
- package/singlestore-core/columns/binary.js +34 -0
- package/singlestore-core/columns/binary.js.map +1 -0
- package/singlestore-core/columns/boolean.cjs +62 -0
- package/singlestore-core/columns/boolean.cjs.map +1 -0
- package/singlestore-core/columns/boolean.d.cts +24 -0
- package/singlestore-core/columns/boolean.d.ts +24 -0
- package/singlestore-core/columns/boolean.js +36 -0
- package/singlestore-core/columns/boolean.js.map +1 -0
- package/singlestore-core/columns/char.cjs +62 -0
- package/singlestore-core/columns/char.cjs.map +1 -0
- package/singlestore-core/columns/char.d.cts +31 -0
- package/singlestore-core/columns/char.d.ts +31 -0
- package/singlestore-core/columns/char.js +36 -0
- package/singlestore-core/columns/char.js.map +1 -0
- package/singlestore-core/columns/common.cjs +82 -0
- package/singlestore-core/columns/common.cjs.map +1 -0
- package/singlestore-core/columns/common.d.cts +42 -0
- package/singlestore-core/columns/common.d.ts +42 -0
- package/singlestore-core/columns/common.js +55 -0
- package/singlestore-core/columns/common.js.map +1 -0
- package/singlestore-core/columns/custom.cjs +77 -0
- package/singlestore-core/columns/custom.cjs.map +1 -0
- package/singlestore-core/columns/custom.d.cts +156 -0
- package/singlestore-core/columns/custom.d.ts +156 -0
- package/singlestore-core/columns/custom.js +51 -0
- package/singlestore-core/columns/custom.js.map +1 -0
- package/singlestore-core/columns/date.cjs +93 -0
- package/singlestore-core/columns/date.cjs.map +1 -0
- package/singlestore-core/columns/date.common.cjs +48 -0
- package/singlestore-core/columns/date.common.cjs.map +1 -0
- package/singlestore-core/columns/date.common.d.cts +16 -0
- package/singlestore-core/columns/date.common.d.ts +16 -0
- package/singlestore-core/columns/date.common.js +23 -0
- package/singlestore-core/columns/date.common.js.map +1 -0
- package/singlestore-core/columns/date.d.cts +53 -0
- package/singlestore-core/columns/date.d.ts +53 -0
- package/singlestore-core/columns/date.js +65 -0
- package/singlestore-core/columns/date.js.map +1 -0
- package/singlestore-core/columns/datetime.cjs +106 -0
- package/singlestore-core/columns/datetime.cjs.map +1 -0
- package/singlestore-core/columns/datetime.d.cts +54 -0
- package/singlestore-core/columns/datetime.d.ts +54 -0
- package/singlestore-core/columns/datetime.js +78 -0
- package/singlestore-core/columns/datetime.js.map +1 -0
- package/singlestore-core/columns/decimal.cjs +76 -0
- package/singlestore-core/columns/decimal.cjs.map +1 -0
- package/singlestore-core/columns/decimal.d.cts +32 -0
- package/singlestore-core/columns/decimal.d.ts +32 -0
- package/singlestore-core/columns/decimal.js +50 -0
- package/singlestore-core/columns/decimal.js.map +1 -0
- package/singlestore-core/columns/double.cjs +72 -0
- package/singlestore-core/columns/double.cjs.map +1 -0
- package/singlestore-core/columns/double.d.cts +32 -0
- package/singlestore-core/columns/double.d.ts +32 -0
- package/singlestore-core/columns/double.js +46 -0
- package/singlestore-core/columns/double.js.map +1 -0
- package/singlestore-core/columns/enum.cjs +67 -0
- package/singlestore-core/columns/enum.cjs.map +1 -0
- package/singlestore-core/columns/enum.d.cts +31 -0
- package/singlestore-core/columns/enum.d.ts +31 -0
- package/singlestore-core/columns/enum.js +41 -0
- package/singlestore-core/columns/enum.js.map +1 -0
- package/singlestore-core/columns/float.cjs +72 -0
- package/singlestore-core/columns/float.cjs.map +1 -0
- package/singlestore-core/columns/float.d.cts +32 -0
- package/singlestore-core/columns/float.d.ts +32 -0
- package/singlestore-core/columns/float.js +46 -0
- package/singlestore-core/columns/float.js.map +1 -0
- package/singlestore-core/columns/index.cjs +71 -0
- package/singlestore-core/columns/index.cjs.map +1 -0
- package/singlestore-core/columns/index.d.cts +25 -0
- package/singlestore-core/columns/index.d.ts +25 -0
- package/singlestore-core/columns/index.js +26 -0
- package/singlestore-core/columns/index.js.map +1 -0
- package/singlestore-core/columns/int.cjs +65 -0
- package/singlestore-core/columns/int.cjs.map +1 -0
- package/singlestore-core/columns/int.d.cts +28 -0
- package/singlestore-core/columns/int.d.ts +28 -0
- package/singlestore-core/columns/int.js +39 -0
- package/singlestore-core/columns/int.js.map +1 -0
- package/singlestore-core/columns/json.cjs +59 -0
- package/singlestore-core/columns/json.cjs.map +1 -0
- package/singlestore-core/columns/json.d.cts +24 -0
- package/singlestore-core/columns/json.d.ts +24 -0
- package/singlestore-core/columns/json.js +33 -0
- package/singlestore-core/columns/json.js.map +1 -0
- package/singlestore-core/columns/mediumint.cjs +65 -0
- package/singlestore-core/columns/mediumint.cjs.map +1 -0
- package/singlestore-core/columns/mediumint.d.cts +26 -0
- package/singlestore-core/columns/mediumint.d.ts +26 -0
- package/singlestore-core/columns/mediumint.js +39 -0
- package/singlestore-core/columns/mediumint.js.map +1 -0
- package/singlestore-core/columns/real.cjs +68 -0
- package/singlestore-core/columns/real.cjs.map +1 -0
- package/singlestore-core/columns/real.d.cts +30 -0
- package/singlestore-core/columns/real.d.ts +30 -0
- package/singlestore-core/columns/real.js +42 -0
- package/singlestore-core/columns/real.js.map +1 -0
- package/singlestore-core/columns/serial.cjs +64 -0
- package/singlestore-core/columns/serial.cjs.map +1 -0
- package/singlestore-core/columns/serial.d.cts +24 -0
- package/singlestore-core/columns/serial.d.ts +24 -0
- package/singlestore-core/columns/serial.js +38 -0
- package/singlestore-core/columns/serial.js.map +1 -0
- package/singlestore-core/columns/smallint.cjs +65 -0
- package/singlestore-core/columns/smallint.cjs.map +1 -0
- package/singlestore-core/columns/smallint.d.cts +26 -0
- package/singlestore-core/columns/smallint.d.ts +26 -0
- package/singlestore-core/columns/smallint.js +39 -0
- package/singlestore-core/columns/smallint.js.map +1 -0
- package/singlestore-core/columns/text.cjs +80 -0
- package/singlestore-core/columns/text.cjs.map +1 -0
- package/singlestore-core/columns/text.d.cts +46 -0
- package/singlestore-core/columns/text.d.ts +46 -0
- package/singlestore-core/columns/text.js +51 -0
- package/singlestore-core/columns/text.js.map +1 -0
- package/singlestore-core/columns/time.cjs +56 -0
- package/singlestore-core/columns/time.cjs.map +1 -0
- package/singlestore-core/columns/time.d.cts +23 -0
- package/singlestore-core/columns/time.d.ts +23 -0
- package/singlestore-core/columns/time.js +30 -0
- package/singlestore-core/columns/time.js.map +1 -0
- package/singlestore-core/columns/timestamp.cjs +97 -0
- package/singlestore-core/columns/timestamp.cjs.map +1 -0
- package/singlestore-core/columns/timestamp.d.cts +49 -0
- package/singlestore-core/columns/timestamp.d.ts +49 -0
- package/singlestore-core/columns/timestamp.js +69 -0
- package/singlestore-core/columns/timestamp.js.map +1 -0
- package/singlestore-core/columns/tinyint.cjs +65 -0
- package/singlestore-core/columns/tinyint.cjs.map +1 -0
- package/singlestore-core/columns/tinyint.d.cts +26 -0
- package/singlestore-core/columns/tinyint.d.ts +26 -0
- package/singlestore-core/columns/tinyint.js +39 -0
- package/singlestore-core/columns/tinyint.js.map +1 -0
- package/singlestore-core/columns/varbinary.cjs +61 -0
- package/singlestore-core/columns/varbinary.cjs.map +1 -0
- package/singlestore-core/columns/varbinary.d.cts +26 -0
- package/singlestore-core/columns/varbinary.d.ts +26 -0
- package/singlestore-core/columns/varbinary.js +35 -0
- package/singlestore-core/columns/varbinary.js.map +1 -0
- package/singlestore-core/columns/varchar.cjs +63 -0
- package/singlestore-core/columns/varchar.cjs.map +1 -0
- package/singlestore-core/columns/varchar.d.cts +29 -0
- package/singlestore-core/columns/varchar.d.ts +29 -0
- package/singlestore-core/columns/varchar.js +37 -0
- package/singlestore-core/columns/varchar.js.map +1 -0
- package/singlestore-core/columns/year.cjs +56 -0
- package/singlestore-core/columns/year.cjs.map +1 -0
- package/singlestore-core/columns/year.d.cts +23 -0
- package/singlestore-core/columns/year.d.ts +23 -0
- package/singlestore-core/columns/year.js +30 -0
- package/singlestore-core/columns/year.js.map +1 -0
- package/singlestore-core/db.cjs +261 -0
- package/singlestore-core/db.cjs.map +1 -0
- package/singlestore-core/db.d.cts +231 -0
- package/singlestore-core/db.d.ts +231 -0
- package/singlestore-core/db.js +242 -0
- package/singlestore-core/db.js.map +1 -0
- package/singlestore-core/dialect.cjs +607 -0
- package/singlestore-core/dialect.cjs.map +1 -0
- package/singlestore-core/dialect.d.cts +64 -0
- package/singlestore-core/dialect.d.ts +64 -0
- package/singlestore-core/dialect.js +589 -0
- package/singlestore-core/dialect.js.map +1 -0
- package/singlestore-core/expressions.cjs +49 -0
- package/singlestore-core/expressions.cjs.map +1 -0
- package/singlestore-core/expressions.d.cts +8 -0
- package/singlestore-core/expressions.d.ts +8 -0
- package/singlestore-core/expressions.js +22 -0
- package/singlestore-core/expressions.js.map +1 -0
- package/singlestore-core/index.cjs +47 -0
- package/singlestore-core/index.cjs.map +1 -0
- package/singlestore-core/index.d.cts +13 -0
- package/singlestore-core/index.d.ts +13 -0
- package/singlestore-core/index.js +14 -0
- package/singlestore-core/index.js.map +1 -0
- package/singlestore-core/indexes.cjs +88 -0
- package/singlestore-core/indexes.cjs.map +1 -0
- package/singlestore-core/indexes.d.cts +62 -0
- package/singlestore-core/indexes.d.ts +62 -0
- package/singlestore-core/indexes.js +60 -0
- package/singlestore-core/indexes.js.map +1 -0
- package/singlestore-core/primary-keys.cjs +68 -0
- package/singlestore-core/primary-keys.cjs.map +1 -0
- package/singlestore-core/primary-keys.d.cts +30 -0
- package/singlestore-core/primary-keys.d.ts +30 -0
- package/singlestore-core/primary-keys.js +42 -0
- package/singlestore-core/primary-keys.js.map +1 -0
- package/singlestore-core/query-builders/count.cjs +73 -0
- package/singlestore-core/query-builders/count.cjs.map +1 -0
- package/singlestore-core/query-builders/count.d.cts +25 -0
- package/singlestore-core/query-builders/count.d.ts +25 -0
- package/singlestore-core/query-builders/count.js +49 -0
- package/singlestore-core/query-builders/count.js.map +1 -0
- package/singlestore-core/query-builders/delete.cjs +123 -0
- package/singlestore-core/query-builders/delete.cjs.map +1 -0
- package/singlestore-core/query-builders/delete.d.cts +83 -0
- package/singlestore-core/query-builders/delete.d.ts +83 -0
- package/singlestore-core/query-builders/delete.js +99 -0
- package/singlestore-core/query-builders/delete.js.map +1 -0
- package/singlestore-core/query-builders/index.cjs +33 -0
- package/singlestore-core/query-builders/index.cjs.map +1 -0
- package/singlestore-core/query-builders/index.d.cts +6 -0
- package/singlestore-core/query-builders/index.d.ts +6 -0
- package/singlestore-core/query-builders/index.js +7 -0
- package/singlestore-core/query-builders/index.js.map +1 -0
- package/singlestore-core/query-builders/insert.cjs +146 -0
- package/singlestore-core/query-builders/insert.cjs.map +1 -0
- package/singlestore-core/query-builders/insert.d.cts +106 -0
- package/singlestore-core/query-builders/insert.d.ts +106 -0
- package/singlestore-core/query-builders/insert.js +121 -0
- package/singlestore-core/query-builders/insert.js.map +1 -0
- package/singlestore-core/query-builders/query-builder.cjs +99 -0
- package/singlestore-core/query-builders/query-builder.cjs.map +1 -0
- package/singlestore-core/query-builders/query-builder.d.cts +33 -0
- package/singlestore-core/query-builders/query-builder.d.ts +33 -0
- package/singlestore-core/query-builders/query-builder.js +75 -0
- package/singlestore-core/query-builders/query-builder.js.map +1 -0
- package/{mysql-core/query-builders/_query.cjs → singlestore-core/query-builders/query.cjs} +18 -41
- package/singlestore-core/query-builders/query.cjs.map +1 -0
- package/singlestore-core/query-builders/query.d.cts +42 -0
- package/singlestore-core/query-builders/query.d.ts +42 -0
- package/{mysql-core/query-builders/_query.js → singlestore-core/query-builders/query.js} +18 -29
- package/singlestore-core/query-builders/query.js.map +1 -0
- package/singlestore-core/query-builders/select.cjs +687 -0
- package/singlestore-core/query-builders/select.cjs.map +1 -0
- package/singlestore-core/query-builders/select.d.cts +585 -0
- package/singlestore-core/query-builders/select.d.ts +585 -0
- package/singlestore-core/query-builders/select.js +662 -0
- package/singlestore-core/query-builders/select.js.map +1 -0
- package/singlestore-core/query-builders/select.types.cjs +17 -0
- package/singlestore-core/query-builders/select.types.cjs.map +1 -0
- package/singlestore-core/query-builders/select.types.d.cts +137 -0
- package/singlestore-core/query-builders/select.types.d.ts +137 -0
- package/singlestore-core/query-builders/select.types.js +1 -0
- package/singlestore-core/query-builders/select.types.js.map +1 -0
- package/singlestore-core/query-builders/update.cjs +147 -0
- package/singlestore-core/query-builders/update.cjs.map +1 -0
- package/singlestore-core/query-builders/update.d.cts +102 -0
- package/singlestore-core/query-builders/update.d.ts +102 -0
- package/singlestore-core/query-builders/update.js +122 -0
- package/singlestore-core/query-builders/update.js.map +1 -0
- package/singlestore-core/schema.cjs +56 -0
- package/singlestore-core/schema.cjs.map +1 -0
- package/singlestore-core/schema.d.cts +22 -0
- package/singlestore-core/schema.d.ts +22 -0
- package/singlestore-core/schema.js +29 -0
- package/singlestore-core/schema.js.map +1 -0
- package/singlestore-core/session.cjs +87 -0
- package/singlestore-core/session.cjs.map +1 -0
- package/singlestore-core/session.d.cts +66 -0
- package/singlestore-core/session.d.ts +66 -0
- package/singlestore-core/session.js +61 -0
- package/singlestore-core/session.js.map +1 -0
- package/singlestore-core/subquery.cjs +17 -0
- package/singlestore-core/subquery.cjs.map +1 -0
- package/singlestore-core/subquery.d.cts +5 -0
- package/singlestore-core/subquery.d.ts +5 -0
- package/singlestore-core/subquery.js +1 -0
- package/singlestore-core/subquery.js.map +1 -0
- package/singlestore-core/table.cjs +73 -0
- package/singlestore-core/table.cjs.map +1 -0
- package/singlestore-core/table.d.cts +40 -0
- package/singlestore-core/table.d.ts +40 -0
- package/singlestore-core/table.js +46 -0
- package/singlestore-core/table.js.map +1 -0
- package/singlestore-core/unique-constraint.cjs +82 -0
- package/singlestore-core/unique-constraint.cjs.map +1 -0
- package/singlestore-core/unique-constraint.d.cts +24 -0
- package/singlestore-core/unique-constraint.d.ts +24 -0
- package/singlestore-core/unique-constraint.js +54 -0
- package/singlestore-core/unique-constraint.js.map +1 -0
- package/singlestore-core/utils.cjs +65 -0
- package/singlestore-core/utils.cjs.map +1 -0
- package/singlestore-core/utils.d.cts +13 -0
- package/singlestore-core/utils.d.ts +13 -0
- package/singlestore-core/utils.js +41 -0
- package/singlestore-core/utils.js.map +1 -0
- package/singlestore-core/view-base.cjs +33 -0
- package/singlestore-core/view-base.cjs.map +1 -0
- package/singlestore-core/view-base.d.cts +9 -0
- package/singlestore-core/view-base.d.ts +9 -0
- package/singlestore-core/view-base.js +9 -0
- package/singlestore-core/view-base.js.map +1 -0
- package/singlestore-core/view-common.cjs +29 -0
- package/singlestore-core/view-common.cjs.map +1 -0
- package/singlestore-core/view-common.d.cts +1 -0
- package/singlestore-core/view-common.d.ts +1 -0
- package/singlestore-core/view-common.js +5 -0
- package/singlestore-core/view-common.js.map +1 -0
- package/singlestore-core/view.cjs +146 -0
- package/singlestore-core/view.cjs.map +1 -0
- package/singlestore-core/view.d.cts +65 -0
- package/singlestore-core/view.d.ts +65 -0
- package/singlestore-core/view.js +119 -0
- package/singlestore-core/view.js.map +1 -0
- package/singlestore-proxy/driver.cjs +62 -0
- package/singlestore-proxy/driver.cjs.map +1 -0
- package/singlestore-proxy/driver.d.cts +13 -0
- package/singlestore-proxy/driver.d.ts +13 -0
- package/singlestore-proxy/driver.js +42 -0
- package/singlestore-proxy/driver.js.map +1 -0
- package/singlestore-proxy/index.cjs +25 -0
- package/singlestore-proxy/index.cjs.map +1 -0
- package/singlestore-proxy/index.d.cts +2 -0
- package/singlestore-proxy/index.d.ts +2 -0
- package/singlestore-proxy/index.js +3 -0
- package/singlestore-proxy/index.js.map +1 -0
- package/singlestore-proxy/migrator.cjs +60 -0
- package/singlestore-proxy/migrator.cjs.map +1 -0
- package/singlestore-proxy/migrator.d.cts +4 -0
- package/singlestore-proxy/migrator.d.ts +4 -0
- package/singlestore-proxy/migrator.js +36 -0
- package/singlestore-proxy/migrator.js.map +1 -0
- package/singlestore-proxy/session.cjs +127 -0
- package/singlestore-proxy/session.cjs.map +1 -0
- package/singlestore-proxy/session.d.cts +50 -0
- package/singlestore-proxy/session.d.ts +50 -0
- package/singlestore-proxy/session.js +101 -0
- package/singlestore-proxy/session.js.map +1 -0
- package/sql/sql.cjs.map +1 -1
- package/sql/sql.d.cts +4 -4
- package/sql/sql.d.ts +4 -4
- package/sql/sql.js.map +1 -1
- package/sql-js/driver.cjs +5 -16
- package/sql-js/driver.cjs.map +1 -1
- package/sql-js/driver.d.cts +2 -3
- package/sql-js/driver.d.ts +2 -3
- package/sql-js/driver.js +8 -6
- package/sql-js/driver.js.map +1 -1
- package/sql-js/migrator.cjs.map +1 -1
- package/sql-js/migrator.d.cts +1 -2
- package/sql-js/migrator.d.ts +1 -2
- package/sql-js/migrator.js.map +1 -1
- package/sql-js/session.cjs +4 -58
- package/sql-js/session.cjs.map +1 -1
- package/sql-js/session.d.cts +8 -14
- package/sql-js/session.d.ts +8 -14
- package/sql-js/session.js +4 -58
- package/sql-js/session.js.map +1 -1
- package/sqlite-core/columns/blob.cjs +16 -2
- package/sqlite-core/columns/blob.cjs.map +1 -1
- package/sqlite-core/columns/blob.d.cts +2 -2
- package/sqlite-core/columns/blob.d.ts +2 -2
- package/sqlite-core/columns/blob.js +16 -2
- package/sqlite-core/columns/blob.js.map +1 -1
- package/sqlite-core/db.cjs +14 -35
- package/sqlite-core/db.cjs.map +1 -1
- package/sqlite-core/db.d.cts +8 -15
- package/sqlite-core/db.d.ts +8 -15
- package/sqlite-core/db.js +13 -34
- package/sqlite-core/db.js.map +1 -1
- package/sqlite-core/dialect.cjs +7 -164
- package/sqlite-core/dialect.cjs.map +1 -1
- package/sqlite-core/dialect.d.cts +9 -25
- package/sqlite-core/dialect.d.ts +9 -25
- package/sqlite-core/dialect.js +13 -161
- package/sqlite-core/dialect.js.map +1 -1
- package/sqlite-core/query-builders/count.cjs.map +1 -1
- package/sqlite-core/query-builders/count.d.cts +1 -1
- package/sqlite-core/query-builders/count.d.ts +1 -1
- package/sqlite-core/query-builders/count.js.map +1 -1
- package/sqlite-core/query-builders/delete.cjs.map +1 -1
- package/sqlite-core/query-builders/delete.d.cts +1 -1
- package/sqlite-core/query-builders/delete.d.ts +1 -1
- package/sqlite-core/query-builders/delete.js.map +1 -1
- package/sqlite-core/query-builders/insert.cjs.map +1 -1
- package/sqlite-core/query-builders/insert.d.cts +3 -3
- package/sqlite-core/query-builders/insert.d.ts +3 -3
- package/sqlite-core/query-builders/insert.js.map +1 -1
- package/sqlite-core/query-builders/query.cjs +48 -30
- package/sqlite-core/query-builders/query.cjs.map +1 -1
- package/sqlite-core/query-builders/query.d.cts +16 -14
- package/sqlite-core/query-builders/query.d.ts +16 -14
- package/sqlite-core/query-builders/query.js +48 -30
- package/sqlite-core/query-builders/query.js.map +1 -1
- package/sqlite-core/query-builders/select.cjs.map +1 -1
- package/sqlite-core/query-builders/select.d.cts +3 -3
- package/sqlite-core/query-builders/select.d.ts +3 -3
- package/sqlite-core/query-builders/select.js.map +1 -1
- package/sqlite-core/query-builders/update.cjs.map +1 -1
- package/sqlite-core/query-builders/update.d.cts +3 -3
- package/sqlite-core/query-builders/update.d.ts +3 -3
- package/sqlite-core/query-builders/update.js.map +1 -1
- package/sqlite-core/session.cjs +2 -6
- package/sqlite-core/session.cjs.map +1 -1
- package/sqlite-core/session.d.cts +6 -14
- package/sqlite-core/session.d.ts +6 -14
- package/sqlite-core/session.js +2 -6
- package/sqlite-core/session.js.map +1 -1
- package/sqlite-proxy/driver.cjs +5 -22
- package/sqlite-proxy/driver.cjs.map +1 -1
- package/sqlite-proxy/driver.d.cts +3 -4
- package/sqlite-proxy/driver.d.ts +3 -4
- package/sqlite-proxy/driver.js +5 -12
- package/sqlite-proxy/driver.js.map +1 -1
- package/sqlite-proxy/migrator.cjs.map +1 -1
- package/sqlite-proxy/migrator.d.cts +1 -2
- package/sqlite-proxy/migrator.d.ts +1 -2
- package/sqlite-proxy/migrator.js.map +1 -1
- package/sqlite-proxy/session.cjs +4 -47
- package/sqlite-proxy/session.cjs.map +1 -1
- package/sqlite-proxy/session.d.cts +8 -14
- package/sqlite-proxy/session.d.ts +8 -14
- package/sqlite-proxy/session.js +4 -47
- package/sqlite-proxy/session.js.map +1 -1
- package/table.cjs.map +1 -1
- package/table.d.cts +1 -1
- package/table.d.ts +1 -1
- package/table.js.map +1 -1
- package/tidb-serverless/driver.cjs +5 -22
- package/tidb-serverless/driver.cjs.map +1 -1
- package/tidb-serverless/driver.d.cts +6 -7
- package/tidb-serverless/driver.d.ts +6 -7
- package/tidb-serverless/driver.js +8 -12
- package/tidb-serverless/driver.js.map +1 -1
- package/tidb-serverless/migrator.cjs.map +1 -1
- package/tidb-serverless/migrator.d.cts +1 -2
- package/tidb-serverless/migrator.d.ts +1 -2
- package/tidb-serverless/migrator.js.map +1 -1
- package/tidb-serverless/session.cjs +5 -62
- package/tidb-serverless/session.cjs.map +1 -1
- package/tidb-serverless/session.d.cts +9 -14
- package/tidb-serverless/session.d.ts +9 -14
- package/tidb-serverless/session.js +5 -62
- package/tidb-serverless/session.js.map +1 -1
- package/utils.cjs +2 -2
- package/utils.cjs.map +1 -1
- package/utils.d.cts +2 -3
- package/utils.d.ts +2 -3
- package/utils.js +2 -2
- package/utils.js.map +1 -1
- package/vercel-postgres/driver.cjs +7 -23
- package/vercel-postgres/driver.cjs.map +1 -1
- package/vercel-postgres/driver.d.cts +8 -9
- package/vercel-postgres/driver.d.ts +8 -9
- package/vercel-postgres/driver.js +10 -13
- package/vercel-postgres/driver.js.map +1 -1
- package/vercel-postgres/migrator.cjs.map +1 -1
- package/vercel-postgres/migrator.d.cts +1 -2
- package/vercel-postgres/migrator.d.ts +1 -2
- package/vercel-postgres/migrator.js.map +1 -1
- package/vercel-postgres/session.cjs +4 -34
- package/vercel-postgres/session.cjs.map +1 -1
- package/vercel-postgres/session.d.cts +8 -13
- package/vercel-postgres/session.d.ts +8 -13
- package/vercel-postgres/session.js +4 -34
- package/vercel-postgres/session.js.map +1 -1
- package/version.cjs +1 -1
- package/version.d.cts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/xata-http/driver.cjs +5 -17
- package/xata-http/driver.cjs.map +1 -1
- package/xata-http/driver.d.cts +4 -5
- package/xata-http/driver.d.ts +4 -5
- package/xata-http/driver.js +5 -7
- package/xata-http/driver.js.map +1 -1
- package/xata-http/migrator.cjs.map +1 -1
- package/xata-http/migrator.d.cts +1 -2
- package/xata-http/migrator.d.ts +1 -2
- package/xata-http/migrator.js.map +1 -1
- package/xata-http/session.cjs +2 -30
- package/xata-http/session.cjs.map +1 -1
- package/xata-http/session.d.cts +8 -13
- package/xata-http/session.d.ts +8 -13
- package/xata-http/session.js +2 -30
- package/xata-http/session.js.map +1 -1
- package/_relations.cjs +0 -328
- package/_relations.cjs.map +0 -1
- package/_relations.d.cts +0 -215
- package/_relations.d.ts +0 -215
- package/_relations.js +0 -316
- package/_relations.js.map +0 -1
- package/mysql-core/query-builders/_query.cjs.map +0 -1
- package/mysql-core/query-builders/_query.d.cts +0 -44
- package/mysql-core/query-builders/_query.d.ts +0 -44
- package/mysql-core/query-builders/_query.js.map +0 -1
- package/pg-core/query-builders/_query.cjs +0 -155
- package/pg-core/query-builders/_query.cjs.map +0 -1
- package/pg-core/query-builders/_query.d.cts +0 -47
- package/pg-core/query-builders/_query.d.ts +0 -47
- package/pg-core/query-builders/_query.js +0 -120
- package/pg-core/query-builders/_query.js.map +0 -1
- package/sqlite-core/query-builders/_query.cjs +0 -187
- package/sqlite-core/query-builders/_query.cjs.map +0 -1
- package/sqlite-core/query-builders/_query.d.cts +0 -55
- package/sqlite-core/query-builders/_query.d.ts +0 -55
- package/sqlite-core/query-builders/_query.js +0 -151
- package/sqlite-core/query-builders/_query.js.map +0 -1
package/mysql-core/dialect.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import * as V1 from "../_relations.cjs";
|
|
2
1
|
import { entityKind } from "../entity.cjs";
|
|
3
2
|
import type { MigrationConfig, MigrationMeta } from "../migrator.cjs";
|
|
4
|
-
import type
|
|
3
|
+
import { type BuildRelationalQueryResult, type DBQueryConfig, type Relation, type TableRelationalConfig, type TablesRelationalConfig } from "../relations.cjs";
|
|
5
4
|
import { SQL } from "../sql/sql.cjs";
|
|
6
5
|
import type { QueryWithTypings } from "../sql/sql.cjs";
|
|
7
6
|
import { type Casing, type UpdateSet } from "../utils.cjs";
|
|
@@ -51,41 +50,26 @@ export declare class MySqlDialect {
|
|
|
51
50
|
generatedIds: Record<string, unknown>[];
|
|
52
51
|
};
|
|
53
52
|
sqlToQuery(sql: SQL, invokeSource?: 'indexes' | undefined): QueryWithTypings;
|
|
54
|
-
|
|
55
|
-
_buildRelationalQuery({ fullSchema, schema, tableNamesMap, table, tableConfig, queryConfig: config, tableAlias, nestedQueryRelation, joinOn, }: {
|
|
53
|
+
buildRelationalQuery({ fullSchema, schema, tableNamesMap, table, tableConfig, queryConfig: config, tableAlias, nestedQueryRelation, joinOn, }: {
|
|
56
54
|
fullSchema: Record<string, unknown>;
|
|
57
|
-
schema:
|
|
55
|
+
schema: TablesRelationalConfig;
|
|
58
56
|
tableNamesMap: Record<string, string>;
|
|
59
57
|
table: MySqlTable;
|
|
60
|
-
tableConfig:
|
|
61
|
-
queryConfig: true |
|
|
58
|
+
tableConfig: TableRelationalConfig;
|
|
59
|
+
queryConfig: true | DBQueryConfig<'many', true>;
|
|
62
60
|
tableAlias: string;
|
|
63
|
-
nestedQueryRelation?:
|
|
61
|
+
nestedQueryRelation?: Relation;
|
|
64
62
|
joinOn?: SQL;
|
|
65
|
-
}):
|
|
66
|
-
|
|
67
|
-
_buildRelationalQueryWithoutLateralSubqueries({ fullSchema, schema, tableNamesMap, table, tableConfig, queryConfig: config, tableAlias, nestedQueryRelation, joinOn, }: {
|
|
63
|
+
}): BuildRelationalQueryResult<MySqlTable, MySqlColumn>;
|
|
64
|
+
buildRelationalQueryWithoutLateralSubqueries({ fullSchema, schema, tableNamesMap, table, tableConfig, queryConfig: config, tableAlias, nestedQueryRelation, joinOn, }: {
|
|
68
65
|
fullSchema: Record<string, unknown>;
|
|
69
|
-
schema: V1.TablesRelationalConfig;
|
|
70
|
-
tableNamesMap: Record<string, string>;
|
|
71
|
-
table: MySqlTable;
|
|
72
|
-
tableConfig: V1.TableRelationalConfig;
|
|
73
|
-
queryConfig: true | V1.DBQueryConfig<'many', true>;
|
|
74
|
-
tableAlias: string;
|
|
75
|
-
nestedQueryRelation?: V1.Relation;
|
|
76
|
-
joinOn?: SQL;
|
|
77
|
-
}): V1.BuildRelationalQueryResult<MySqlTable, MySqlColumn>;
|
|
78
|
-
private unwrapAllColumns;
|
|
79
|
-
private getSelectedTableColumns;
|
|
80
|
-
private buildColumns;
|
|
81
|
-
buildRelationalQuery({ tables, schema, tableNamesMap, table, tableConfig, queryConfig: config, relationWhere, mode, }: {
|
|
82
|
-
tables: Record<string, MySqlTable>;
|
|
83
66
|
schema: TablesRelationalConfig;
|
|
84
67
|
tableNamesMap: Record<string, string>;
|
|
85
68
|
table: MySqlTable;
|
|
86
69
|
tableConfig: TableRelationalConfig;
|
|
87
|
-
queryConfig
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
70
|
+
queryConfig: true | DBQueryConfig<'many', true>;
|
|
71
|
+
tableAlias: string;
|
|
72
|
+
nestedQueryRelation?: Relation;
|
|
73
|
+
joinOn?: SQL;
|
|
74
|
+
}): BuildRelationalQueryResult<MySqlTable, MySqlColumn>;
|
|
91
75
|
}
|
package/mysql-core/dialect.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import * as V1 from "../_relations.js";
|
|
2
1
|
import { entityKind } from "../entity.js";
|
|
3
2
|
import type { MigrationConfig, MigrationMeta } from "../migrator.js";
|
|
4
|
-
import type
|
|
3
|
+
import { type BuildRelationalQueryResult, type DBQueryConfig, type Relation, type TableRelationalConfig, type TablesRelationalConfig } from "../relations.js";
|
|
5
4
|
import { SQL } from "../sql/sql.js";
|
|
6
5
|
import type { QueryWithTypings } from "../sql/sql.js";
|
|
7
6
|
import { type Casing, type UpdateSet } from "../utils.js";
|
|
@@ -51,41 +50,26 @@ export declare class MySqlDialect {
|
|
|
51
50
|
generatedIds: Record<string, unknown>[];
|
|
52
51
|
};
|
|
53
52
|
sqlToQuery(sql: SQL, invokeSource?: 'indexes' | undefined): QueryWithTypings;
|
|
54
|
-
|
|
55
|
-
_buildRelationalQuery({ fullSchema, schema, tableNamesMap, table, tableConfig, queryConfig: config, tableAlias, nestedQueryRelation, joinOn, }: {
|
|
53
|
+
buildRelationalQuery({ fullSchema, schema, tableNamesMap, table, tableConfig, queryConfig: config, tableAlias, nestedQueryRelation, joinOn, }: {
|
|
56
54
|
fullSchema: Record<string, unknown>;
|
|
57
|
-
schema:
|
|
55
|
+
schema: TablesRelationalConfig;
|
|
58
56
|
tableNamesMap: Record<string, string>;
|
|
59
57
|
table: MySqlTable;
|
|
60
|
-
tableConfig:
|
|
61
|
-
queryConfig: true |
|
|
58
|
+
tableConfig: TableRelationalConfig;
|
|
59
|
+
queryConfig: true | DBQueryConfig<'many', true>;
|
|
62
60
|
tableAlias: string;
|
|
63
|
-
nestedQueryRelation?:
|
|
61
|
+
nestedQueryRelation?: Relation;
|
|
64
62
|
joinOn?: SQL;
|
|
65
|
-
}):
|
|
66
|
-
|
|
67
|
-
_buildRelationalQueryWithoutLateralSubqueries({ fullSchema, schema, tableNamesMap, table, tableConfig, queryConfig: config, tableAlias, nestedQueryRelation, joinOn, }: {
|
|
63
|
+
}): BuildRelationalQueryResult<MySqlTable, MySqlColumn>;
|
|
64
|
+
buildRelationalQueryWithoutLateralSubqueries({ fullSchema, schema, tableNamesMap, table, tableConfig, queryConfig: config, tableAlias, nestedQueryRelation, joinOn, }: {
|
|
68
65
|
fullSchema: Record<string, unknown>;
|
|
69
|
-
schema: V1.TablesRelationalConfig;
|
|
70
|
-
tableNamesMap: Record<string, string>;
|
|
71
|
-
table: MySqlTable;
|
|
72
|
-
tableConfig: V1.TableRelationalConfig;
|
|
73
|
-
queryConfig: true | V1.DBQueryConfig<'many', true>;
|
|
74
|
-
tableAlias: string;
|
|
75
|
-
nestedQueryRelation?: V1.Relation;
|
|
76
|
-
joinOn?: SQL;
|
|
77
|
-
}): V1.BuildRelationalQueryResult<MySqlTable, MySqlColumn>;
|
|
78
|
-
private unwrapAllColumns;
|
|
79
|
-
private getSelectedTableColumns;
|
|
80
|
-
private buildColumns;
|
|
81
|
-
buildRelationalQuery({ tables, schema, tableNamesMap, table, tableConfig, queryConfig: config, relationWhere, mode, }: {
|
|
82
|
-
tables: Record<string, MySqlTable>;
|
|
83
66
|
schema: TablesRelationalConfig;
|
|
84
67
|
tableNamesMap: Record<string, string>;
|
|
85
68
|
table: MySqlTable;
|
|
86
69
|
tableConfig: TableRelationalConfig;
|
|
87
|
-
queryConfig
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
70
|
+
queryConfig: true | DBQueryConfig<'many', true>;
|
|
71
|
+
tableAlias: string;
|
|
72
|
+
nestedQueryRelation?: Relation;
|
|
73
|
+
joinOn?: SQL;
|
|
74
|
+
}): BuildRelationalQueryResult<MySqlTable, MySqlColumn>;
|
|
91
75
|
}
|
package/mysql-core/dialect.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as V1 from "../_relations.js";
|
|
2
1
|
import { aliasedTable, aliasedTableColumn, mapColumnsInAliasedSQLToAlias, mapColumnsInSQLToAlias } from "../alias.js";
|
|
3
2
|
import { CasingCache } from "../casing.js";
|
|
4
3
|
import { Column } from "../column.js";
|
|
@@ -6,16 +5,15 @@ import { entityKind, is } from "../entity.js";
|
|
|
6
5
|
import { DrizzleError } from "../errors.js";
|
|
7
6
|
import { and, eq } from "../expressions.js";
|
|
8
7
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
relationToSQL
|
|
8
|
+
getOperators,
|
|
9
|
+
getOrderByOperators,
|
|
10
|
+
Many,
|
|
11
|
+
normalizeRelation,
|
|
12
|
+
One
|
|
15
13
|
} from "../relations.js";
|
|
16
14
|
import { Param, SQL, sql, View } from "../sql/sql.js";
|
|
17
15
|
import { Subquery } from "../subquery.js";
|
|
18
|
-
import {
|
|
16
|
+
import { getTableName, getTableUniqueName, Table } from "../table.js";
|
|
19
17
|
import { orderSelectedFields } from "../utils.js";
|
|
20
18
|
import { ViewBaseConfig } from "../view-common.js";
|
|
21
19
|
import { MySqlColumn } from "./columns/common.js";
|
|
@@ -371,8 +369,7 @@ class MySqlDialect {
|
|
|
371
369
|
invokeSource
|
|
372
370
|
});
|
|
373
371
|
}
|
|
374
|
-
|
|
375
|
-
_buildRelationalQuery({
|
|
372
|
+
buildRelationalQuery({
|
|
376
373
|
fullSchema,
|
|
377
374
|
schema,
|
|
378
375
|
tableNamesMap,
|
|
@@ -401,7 +398,7 @@ class MySqlDialect {
|
|
|
401
398
|
Object.entries(tableConfig.columns).map(([key, value]) => [key, aliasedTableColumn(value, tableAlias)])
|
|
402
399
|
);
|
|
403
400
|
if (config.where) {
|
|
404
|
-
const whereSql = typeof config.where === "function" ? config.where(aliasedColumns,
|
|
401
|
+
const whereSql = typeof config.where === "function" ? config.where(aliasedColumns, getOperators()) : config.where;
|
|
405
402
|
where = whereSql && mapColumnsInSQLToAlias(whereSql, tableAlias);
|
|
406
403
|
}
|
|
407
404
|
const fieldsSelection = [];
|
|
@@ -453,7 +450,7 @@ class MySqlDialect {
|
|
|
453
450
|
selection: []
|
|
454
451
|
});
|
|
455
452
|
}
|
|
456
|
-
let orderByOrig = typeof config.orderBy === "function" ? config.orderBy(aliasedColumns,
|
|
453
|
+
let orderByOrig = typeof config.orderBy === "function" ? config.orderBy(aliasedColumns, getOrderByOperators()) : config.orderBy ?? [];
|
|
457
454
|
if (!Array.isArray(orderByOrig)) {
|
|
458
455
|
orderByOrig = [orderByOrig];
|
|
459
456
|
}
|
|
@@ -470,7 +467,7 @@ class MySqlDialect {
|
|
|
470
467
|
queryConfig: selectedRelationConfigValue,
|
|
471
468
|
relation
|
|
472
469
|
} of selectedRelations) {
|
|
473
|
-
const normalizedRelation =
|
|
470
|
+
const normalizedRelation = normalizeRelation(schema, tableNamesMap, relation);
|
|
474
471
|
const relationTableName = getTableUniqueName(relation.referencedTable);
|
|
475
472
|
const relationTableTsName = tableNamesMap[relationTableName];
|
|
476
473
|
const relationTableAlias = `${tableAlias}_${selectedRelationTsKey}`;
|
|
@@ -482,13 +479,13 @@ class MySqlDialect {
|
|
|
482
479
|
)
|
|
483
480
|
)
|
|
484
481
|
);
|
|
485
|
-
const builtRelation = this.
|
|
482
|
+
const builtRelation = this.buildRelationalQuery({
|
|
486
483
|
fullSchema,
|
|
487
484
|
schema,
|
|
488
485
|
tableNamesMap,
|
|
489
486
|
table: fullSchema[relationTableTsName],
|
|
490
487
|
tableConfig: schema[relationTableTsName],
|
|
491
|
-
queryConfig: is(relation,
|
|
488
|
+
queryConfig: is(relation, One) ? selectedRelationConfigValue === true ? { limit: 1 } : { ...selectedRelationConfigValue, limit: 1 } : selectedRelationConfigValue,
|
|
492
489
|
tableAlias: relationTableAlias,
|
|
493
490
|
joinOn: joinOn2,
|
|
494
491
|
nestedQueryRelation: relation
|
|
@@ -523,7 +520,7 @@ class MySqlDialect {
|
|
|
523
520
|
),
|
|
524
521
|
sql`, `
|
|
525
522
|
)})`;
|
|
526
|
-
if (is(nestedQueryRelation,
|
|
523
|
+
if (is(nestedQueryRelation, Many)) {
|
|
527
524
|
field = sql`coalesce(json_arrayagg(${field}), json_array())`;
|
|
528
525
|
}
|
|
529
526
|
const nestedSelection = [{
|
|
@@ -597,8 +594,7 @@ class MySqlDialect {
|
|
|
597
594
|
selection
|
|
598
595
|
};
|
|
599
596
|
}
|
|
600
|
-
|
|
601
|
-
_buildRelationalQueryWithoutLateralSubqueries({
|
|
597
|
+
buildRelationalQueryWithoutLateralSubqueries({
|
|
602
598
|
fullSchema,
|
|
603
599
|
schema,
|
|
604
600
|
tableNamesMap,
|
|
@@ -626,7 +622,7 @@ class MySqlDialect {
|
|
|
626
622
|
Object.entries(tableConfig.columns).map(([key, value]) => [key, aliasedTableColumn(value, tableAlias)])
|
|
627
623
|
);
|
|
628
624
|
if (config.where) {
|
|
629
|
-
const whereSql = typeof config.where === "function" ? config.where(aliasedColumns,
|
|
625
|
+
const whereSql = typeof config.where === "function" ? config.where(aliasedColumns, getOperators()) : config.where;
|
|
630
626
|
where = whereSql && mapColumnsInSQLToAlias(whereSql, tableAlias);
|
|
631
627
|
}
|
|
632
628
|
const fieldsSelection = [];
|
|
@@ -678,7 +674,7 @@ class MySqlDialect {
|
|
|
678
674
|
selection: []
|
|
679
675
|
});
|
|
680
676
|
}
|
|
681
|
-
let orderByOrig = typeof config.orderBy === "function" ? config.orderBy(aliasedColumns,
|
|
677
|
+
let orderByOrig = typeof config.orderBy === "function" ? config.orderBy(aliasedColumns, getOrderByOperators()) : config.orderBy ?? [];
|
|
682
678
|
if (!Array.isArray(orderByOrig)) {
|
|
683
679
|
orderByOrig = [orderByOrig];
|
|
684
680
|
}
|
|
@@ -695,7 +691,7 @@ class MySqlDialect {
|
|
|
695
691
|
queryConfig: selectedRelationConfigValue,
|
|
696
692
|
relation
|
|
697
693
|
} of selectedRelations) {
|
|
698
|
-
const normalizedRelation =
|
|
694
|
+
const normalizedRelation = normalizeRelation(schema, tableNamesMap, relation);
|
|
699
695
|
const relationTableName = getTableUniqueName(relation.referencedTable);
|
|
700
696
|
const relationTableTsName = tableNamesMap[relationTableName];
|
|
701
697
|
const relationTableAlias = `${tableAlias}_${selectedRelationTsKey}`;
|
|
@@ -707,19 +703,19 @@ class MySqlDialect {
|
|
|
707
703
|
)
|
|
708
704
|
)
|
|
709
705
|
);
|
|
710
|
-
const builtRelation = this.
|
|
706
|
+
const builtRelation = this.buildRelationalQueryWithoutLateralSubqueries({
|
|
711
707
|
fullSchema,
|
|
712
708
|
schema,
|
|
713
709
|
tableNamesMap,
|
|
714
710
|
table: fullSchema[relationTableTsName],
|
|
715
711
|
tableConfig: schema[relationTableTsName],
|
|
716
|
-
queryConfig: is(relation,
|
|
712
|
+
queryConfig: is(relation, One) ? selectedRelationConfigValue === true ? { limit: 1 } : { ...selectedRelationConfigValue, limit: 1 } : selectedRelationConfigValue,
|
|
717
713
|
tableAlias: relationTableAlias,
|
|
718
714
|
joinOn: joinOn2,
|
|
719
715
|
nestedQueryRelation: relation
|
|
720
716
|
});
|
|
721
717
|
let fieldSql = sql`(${builtRelation.sql})`;
|
|
722
|
-
if (is(relation,
|
|
718
|
+
if (is(relation, Many)) {
|
|
723
719
|
fieldSql = sql`coalesce(${fieldSql}, json_array())`;
|
|
724
720
|
}
|
|
725
721
|
const field = fieldSql.as(selectedRelationTsKey);
|
|
@@ -747,7 +743,7 @@ class MySqlDialect {
|
|
|
747
743
|
),
|
|
748
744
|
sql`, `
|
|
749
745
|
)})`;
|
|
750
|
-
if (is(nestedQueryRelation,
|
|
746
|
+
if (is(nestedQueryRelation, Many)) {
|
|
751
747
|
field = sql`json_arrayagg(${field})`;
|
|
752
748
|
}
|
|
753
749
|
const nestedSelection = [{
|
|
@@ -819,148 +815,6 @@ class MySqlDialect {
|
|
|
819
815
|
selection
|
|
820
816
|
};
|
|
821
817
|
}
|
|
822
|
-
unwrapAllColumns = (table, selection) => {
|
|
823
|
-
return sql.join(
|
|
824
|
-
Object.entries(table[Columns]).map(([k, v]) => {
|
|
825
|
-
selection.push({
|
|
826
|
-
key: k,
|
|
827
|
-
field: v
|
|
828
|
-
});
|
|
829
|
-
return sql`${v} as ${sql.identifier(k)}`;
|
|
830
|
-
}),
|
|
831
|
-
sql`, `
|
|
832
|
-
);
|
|
833
|
-
};
|
|
834
|
-
getSelectedTableColumns = (table, columns) => {
|
|
835
|
-
const selectedColumns = [];
|
|
836
|
-
if (!columns) {
|
|
837
|
-
for (const [k, v] of Object.entries(table[Columns])) {
|
|
838
|
-
selectedColumns.push({
|
|
839
|
-
column: v,
|
|
840
|
-
tsName: k
|
|
841
|
-
});
|
|
842
|
-
}
|
|
843
|
-
return selectedColumns;
|
|
844
|
-
}
|
|
845
|
-
const entries = Object.entries(columns);
|
|
846
|
-
let colSelectionMode;
|
|
847
|
-
for (const [k, v] of entries) {
|
|
848
|
-
if (colSelectionMode === void 0)
|
|
849
|
-
colSelectionMode = v;
|
|
850
|
-
else if (v !== void 0 && colSelectionMode !== v) {
|
|
851
|
-
throw new Error("Columns cannot be both true and false at the same time");
|
|
852
|
-
}
|
|
853
|
-
if (v) {
|
|
854
|
-
selectedColumns.push({
|
|
855
|
-
column: table[Columns][k],
|
|
856
|
-
tsName: k
|
|
857
|
-
});
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
if (colSelectionMode === false) {
|
|
861
|
-
for (const [k, v] of Object.entries(table[Columns])) {
|
|
862
|
-
if (columns[k] === false)
|
|
863
|
-
continue;
|
|
864
|
-
selectedColumns.push({
|
|
865
|
-
column: v,
|
|
866
|
-
tsName: k
|
|
867
|
-
});
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
return selectedColumns;
|
|
871
|
-
};
|
|
872
|
-
buildColumns = (table, selection, params) => params?.columns ? (() => {
|
|
873
|
-
const columnIdentifiers = [];
|
|
874
|
-
const selectedColumns = this.getSelectedTableColumns(table, params?.columns);
|
|
875
|
-
for (const column of selectedColumns) {
|
|
876
|
-
columnIdentifiers.push(
|
|
877
|
-
sql`${table[column.tsName]} as ${sql.identifier(column.tsName)}`
|
|
878
|
-
);
|
|
879
|
-
}
|
|
880
|
-
return columnIdentifiers.length ? sql.join(columnIdentifiers, sql`, `) : this.unwrapAllColumns(table, selection);
|
|
881
|
-
})() : (() => {
|
|
882
|
-
const columnIdentifiers = [this.unwrapAllColumns(table, selection)];
|
|
883
|
-
return sql.join(columnIdentifiers, sql`, `);
|
|
884
|
-
})();
|
|
885
|
-
buildRelationalQuery({
|
|
886
|
-
tables,
|
|
887
|
-
schema,
|
|
888
|
-
tableNamesMap,
|
|
889
|
-
table,
|
|
890
|
-
tableConfig,
|
|
891
|
-
queryConfig: config,
|
|
892
|
-
relationWhere,
|
|
893
|
-
mode
|
|
894
|
-
}) {
|
|
895
|
-
const selection = [];
|
|
896
|
-
const isSingle = mode === "first";
|
|
897
|
-
const params = config === true ? void 0 : config;
|
|
898
|
-
const limit = isSingle ? 1 : params?.limit;
|
|
899
|
-
const offset = params?.offset;
|
|
900
|
-
const columns = this.buildColumns(table, selection, params);
|
|
901
|
-
const where = params?.where && relationWhere ? and(relationFilterToSQL(table, params.where), relationWhere) : params?.where ? relationFilterToSQL(table, params.where) : relationWhere;
|
|
902
|
-
const order = params?.orderBy ? relationsOrderToSQL(table, params.orderBy) : void 0;
|
|
903
|
-
const extras = params?.extras ? relationExtrasToSQL(table, params.extras) : void 0;
|
|
904
|
-
if (extras)
|
|
905
|
-
selection.push(...extras.selection);
|
|
906
|
-
const selectionArr = [columns];
|
|
907
|
-
const joins = params ? (() => {
|
|
908
|
-
const { with: joins2 } = params;
|
|
909
|
-
if (!joins2)
|
|
910
|
-
return;
|
|
911
|
-
const withEntries = Object.entries(joins2).filter(([_, v]) => v);
|
|
912
|
-
if (!withEntries.length)
|
|
913
|
-
return;
|
|
914
|
-
return sql.join(
|
|
915
|
-
withEntries.map(([k, join]) => {
|
|
916
|
-
selectionArr.push(sql`${sql.identifier(k)}.${sql.identifier("r")} as ${sql.identifier(k)}`);
|
|
917
|
-
if (is(tableConfig.relations[k], AggregatedField)) {
|
|
918
|
-
const relation2 = tableConfig.relations[k];
|
|
919
|
-
relation2.onTable(table);
|
|
920
|
-
const query2 = relation2.getSQL();
|
|
921
|
-
selection.push({
|
|
922
|
-
key: k,
|
|
923
|
-
field: relation2
|
|
924
|
-
});
|
|
925
|
-
return sql`, lateral(${query2}) as ${sql.identifier(k)}`;
|
|
926
|
-
}
|
|
927
|
-
const relation = tableConfig.relations[k];
|
|
928
|
-
const isSingle2 = is(relation, One);
|
|
929
|
-
const targetTable = relation.targetTable;
|
|
930
|
-
const relationFilter = relationToSQL(relation);
|
|
931
|
-
const innerQuery = this.buildRelationalQuery({
|
|
932
|
-
table: targetTable,
|
|
933
|
-
mode: isSingle2 ? "first" : "many",
|
|
934
|
-
schema,
|
|
935
|
-
queryConfig: join,
|
|
936
|
-
tableConfig: schema[tableNamesMap[getTableUniqueName(targetTable)]],
|
|
937
|
-
tableNamesMap,
|
|
938
|
-
tables,
|
|
939
|
-
relationWhere: relationFilter
|
|
940
|
-
});
|
|
941
|
-
selection.push({
|
|
942
|
-
field: targetTable,
|
|
943
|
-
key: k,
|
|
944
|
-
selection: innerQuery.selection,
|
|
945
|
-
isArray: !isSingle2
|
|
946
|
-
});
|
|
947
|
-
const jsonColumns = sql.join(
|
|
948
|
-
innerQuery.selection.map((s) => sql`${sql.raw(this.escapeString(s.key))}, ${sql.identifier(s.key)}`),
|
|
949
|
-
sql`, `
|
|
950
|
-
);
|
|
951
|
-
return sql`, lateral(select ${isSingle2 ? sql`json_object(${jsonColumns}) as ${sql.identifier("r")}` : sql`coalesce(json_arrayagg(json_object(${jsonColumns})), json_array()) as ${sql.identifier("r")}`} from (${innerQuery.sql}) as ${sql.identifier("t")}) as ${sql.identifier(k)}`;
|
|
952
|
-
})
|
|
953
|
-
);
|
|
954
|
-
})() : void 0;
|
|
955
|
-
if (extras?.sql)
|
|
956
|
-
selectionArr.push(extras.sql);
|
|
957
|
-
const selectionSet = sql.join(selectionArr, sql`, `);
|
|
958
|
-
const query = sql`select ${selectionSet} from ${table}${sql`${joins}`.if(joins)}${sql` where ${where}`.if(where)}${sql` order by ${order}`.if(order)}${sql` limit ${limit}`.if(limit !== void 0)}${sql` offset ${offset}`.if(offset !== void 0)}`;
|
|
959
|
-
return {
|
|
960
|
-
sql: query,
|
|
961
|
-
selection
|
|
962
|
-
};
|
|
963
|
-
}
|
|
964
818
|
}
|
|
965
819
|
export {
|
|
966
820
|
MySqlDialect
|