drizzle-orm 0.28.3 → 0.28.4
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-d302772a.mjs → alias-e80df77c.mjs} +2302 -2299
- package/alias-e80df77c.mjs.map +1 -0
- package/alias.d.cts +31 -0
- package/alias.d.mts +31 -0
- package/alias.d.ts +7 -7
- package/aws-data-api/common/index.d.cts +9 -0
- package/aws-data-api/common/index.d.mts +9 -0
- package/aws-data-api/common/index.d.ts +1 -1
- package/aws-data-api/pg/driver.d.cts +23 -0
- package/aws-data-api/pg/driver.d.mts +23 -0
- package/aws-data-api/pg/driver.d.ts +6 -6
- package/aws-data-api/pg/index.cjs +17 -17
- package/aws-data-api/pg/index.d.cts +2 -0
- package/aws-data-api/pg/index.d.mts +2 -0
- package/aws-data-api/pg/index.d.ts +2 -2
- package/aws-data-api/pg/index.mjs +3 -2
- package/aws-data-api/pg/index.mjs.map +1 -1
- package/aws-data-api/pg/migrator.d.cts +3 -0
- package/aws-data-api/pg/migrator.d.mts +3 -0
- package/aws-data-api/pg/migrator.d.ts +2 -2
- package/aws-data-api/pg/session.d.cts +50 -0
- package/aws-data-api/pg/session.d.mts +50 -0
- package/aws-data-api/pg/session.d.ts +6 -6
- package/better-sqlite3/driver.d.cts +5 -0
- package/better-sqlite3/driver.d.mts +5 -0
- package/better-sqlite3/driver.d.ts +2 -2
- package/better-sqlite3/index.cjs +16 -16
- package/better-sqlite3/index.d.cts +2 -0
- package/better-sqlite3/index.d.mts +2 -0
- package/better-sqlite3/index.d.ts +2 -2
- package/better-sqlite3/index.mjs +3 -2
- package/better-sqlite3/index.mjs.map +1 -1
- package/better-sqlite3/migrator.d.cts +3 -0
- package/better-sqlite3/migrator.d.mts +3 -0
- package/better-sqlite3/migrator.d.ts +2 -2
- package/better-sqlite3/session.d.cts +48 -0
- package/better-sqlite3/session.d.mts +48 -0
- package/better-sqlite3/session.d.ts +8 -8
- package/bun-sqlite/driver.d.cts +6 -0
- package/bun-sqlite/driver.d.mts +6 -0
- package/bun-sqlite/driver.d.ts +2 -2
- package/bun-sqlite/index.cjs +16 -16
- package/bun-sqlite/index.d.cts +2 -0
- package/bun-sqlite/index.d.mts +2 -0
- package/bun-sqlite/index.d.ts +2 -2
- package/bun-sqlite/index.mjs +3 -2
- package/bun-sqlite/index.mjs.map +1 -1
- package/bun-sqlite/migrator.d.cts +3 -0
- package/bun-sqlite/migrator.d.mts +3 -0
- package/bun-sqlite/migrator.d.ts +2 -2
- package/bun-sqlite/session.d.cts +52 -0
- package/bun-sqlite/session.d.mts +52 -0
- package/bun-sqlite/session.d.ts +9 -9
- package/column-builder.d.cts +146 -0
- package/column-builder.d.mts +146 -0
- package/column-builder.d.ts +22 -20
- package/column.d.cts +56 -0
- package/column.d.mts +56 -0
- package/column.d.ts +5 -5
- package/d1/driver.d.cts +5 -0
- package/d1/driver.d.mts +5 -0
- package/d1/driver.d.ts +2 -2
- package/d1/index.cjs +19 -19
- package/d1/index.d.cts +2 -0
- package/d1/index.d.mts +2 -0
- package/d1/index.d.ts +2 -2
- package/d1/index.mjs +3 -2
- package/d1/index.mjs.map +1 -1
- package/d1/migrator.d.cts +3 -0
- package/d1/migrator.d.mts +3 -0
- package/d1/migrator.d.ts +2 -2
- package/d1/session.d.cts +50 -0
- package/d1/session.d.mts +50 -0
- package/d1/session.d.ts +9 -9
- package/entity.d.cts +7 -0
- package/entity.d.mts +7 -0
- package/errors.d.cts +10 -0
- package/errors.d.mts +10 -0
- package/errors.d.ts +1 -1
- package/expressions.d.cts +1 -0
- package/expressions.d.mts +1 -0
- package/expressions.d.ts +1 -1
- package/{alias-58b7b8c9.cjs → index-b1dbb7ec.cjs} +3071 -3030
- package/index-b1dbb7ec.cjs.map +1 -0
- package/index.cjs +100 -132
- package/index.cjs.map +1 -1
- package/index.d.cts +15 -0
- package/index.d.mts +15 -0
- package/index.d.ts +15 -15
- package/index.mjs +3 -2
- package/index.mjs.map +1 -1
- package/knex/index.d.cts +9 -0
- package/knex/index.d.mts +9 -0
- package/knex/index.d.ts +5 -5
- package/kysely/index.d.cts +16 -0
- package/kysely/index.d.mts +16 -0
- package/kysely/index.d.ts +7 -7
- package/libsql/driver.d.cts +5 -0
- package/libsql/driver.d.mts +5 -0
- package/libsql/driver.d.ts +2 -2
- package/libsql/index.cjs +17 -16
- package/libsql/index.cjs.map +1 -1
- package/libsql/index.d.cts +2 -0
- package/libsql/index.d.mts +2 -0
- package/libsql/index.d.ts +2 -2
- package/libsql/index.mjs +4 -2
- package/libsql/index.mjs.map +1 -1
- package/libsql/migrator.d.cts +3 -0
- package/libsql/migrator.d.mts +3 -0
- package/libsql/migrator.d.ts +2 -2
- package/libsql/session.d.cts +53 -0
- package/libsql/session.d.mts +53 -0
- package/libsql/session.d.ts +9 -9
- package/logger.d.cts +23 -0
- package/logger.d.mts +23 -0
- package/logger.d.ts +1 -1
- package/migrator.d.cts +15 -0
- package/migrator.d.mts +15 -0
- package/mysql-core/alias.d.cts +4 -0
- package/mysql-core/alias.d.mts +4 -0
- package/mysql-core/alias.d.ts +3 -3
- package/mysql-core/checks.d.cts +18 -0
- package/mysql-core/checks.d.mts +18 -0
- package/mysql-core/checks.d.ts +3 -3
- package/mysql-core/columns/bigint.d.cts +43 -0
- package/mysql-core/columns/bigint.d.mts +43 -0
- package/mysql-core/columns/bigint.d.ts +4 -4
- package/mysql-core/columns/binary.d.cts +25 -0
- package/mysql-core/columns/binary.d.mts +25 -0
- package/mysql-core/columns/binary.d.ts +4 -4
- package/mysql-core/columns/boolean.d.cts +22 -0
- package/mysql-core/columns/boolean.d.mts +22 -0
- package/mysql-core/columns/boolean.d.ts +4 -4
- package/mysql-core/columns/char.d.cts +28 -0
- package/mysql-core/columns/char.d.mts +28 -0
- package/mysql-core/columns/char.d.ts +5 -5
- package/mysql-core/columns/common.d.cts +49 -0
- package/mysql-core/columns/common.d.mts +49 -0
- package/mysql-core/columns/common.d.ts +13 -9
- package/mysql-core/columns/custom.d.cts +148 -0
- package/mysql-core/columns/custom.d.mts +148 -0
- package/mysql-core/columns/custom.d.ts +7 -7
- package/mysql-core/columns/date.common.d.cts +16 -0
- package/mysql-core/columns/date.common.d.mts +16 -0
- package/mysql-core/columns/date.common.d.ts +4 -4
- package/mysql-core/columns/date.d.cts +49 -0
- package/mysql-core/columns/date.d.mts +49 -0
- package/mysql-core/columns/date.d.ts +6 -6
- package/mysql-core/columns/datetime.d.cts +53 -0
- package/mysql-core/columns/datetime.d.mts +53 -0
- package/mysql-core/columns/datetime.d.ts +6 -6
- package/mysql-core/columns/decimal.d.cts +27 -0
- package/mysql-core/columns/decimal.d.mts +27 -0
- package/mysql-core/columns/decimal.d.ts +4 -4
- package/mysql-core/columns/double.d.cts +27 -0
- package/mysql-core/columns/double.d.mts +27 -0
- package/mysql-core/columns/double.d.ts +4 -4
- package/mysql-core/columns/enum.d.cts +27 -0
- package/mysql-core/columns/enum.d.mts +27 -0
- package/mysql-core/columns/enum.d.ts +5 -5
- package/mysql-core/columns/float.d.cts +21 -0
- package/mysql-core/columns/float.d.mts +21 -0
- package/mysql-core/columns/float.d.ts +4 -4
- package/mysql-core/columns/index.d.cts +25 -0
- package/mysql-core/columns/index.d.mts +25 -0
- package/mysql-core/columns/index.d.ts +25 -25
- package/mysql-core/columns/int.d.cts +22 -0
- package/mysql-core/columns/int.d.mts +22 -0
- package/mysql-core/columns/int.d.ts +4 -4
- package/mysql-core/columns/json.d.cts +22 -0
- package/mysql-core/columns/json.d.mts +22 -0
- package/mysql-core/columns/json.d.ts +4 -4
- package/mysql-core/columns/mediumint.d.cts +22 -0
- package/mysql-core/columns/mediumint.d.mts +22 -0
- package/mysql-core/columns/mediumint.d.ts +4 -4
- package/mysql-core/columns/real.d.cts +27 -0
- package/mysql-core/columns/real.d.mts +27 -0
- package/mysql-core/columns/real.d.ts +4 -4
- package/mysql-core/columns/serial.d.cts +22 -0
- package/mysql-core/columns/serial.d.mts +22 -0
- package/mysql-core/columns/serial.d.ts +4 -4
- package/mysql-core/columns/smallint.d.cts +22 -0
- package/mysql-core/columns/smallint.d.mts +22 -0
- package/mysql-core/columns/smallint.d.ts +4 -4
- package/mysql-core/columns/text.d.cts +37 -0
- package/mysql-core/columns/text.d.mts +37 -0
- package/mysql-core/columns/text.d.ts +5 -5
- package/mysql-core/columns/time.d.cts +25 -0
- package/mysql-core/columns/time.d.mts +25 -0
- package/mysql-core/columns/time.d.ts +4 -4
- package/mysql-core/columns/timestamp.d.cts +47 -0
- package/mysql-core/columns/timestamp.d.mts +47 -0
- package/mysql-core/columns/timestamp.d.ts +5 -5
- package/mysql-core/columns/tinyint.d.cts +22 -0
- package/mysql-core/columns/tinyint.d.mts +22 -0
- package/mysql-core/columns/tinyint.d.ts +4 -4
- package/mysql-core/columns/varbinary.d.cts +24 -0
- package/mysql-core/columns/varbinary.d.mts +24 -0
- package/mysql-core/columns/varbinary.d.ts +4 -4
- package/mysql-core/columns/varchar.d.cts +27 -0
- package/mysql-core/columns/varchar.d.mts +27 -0
- package/mysql-core/columns/varchar.d.ts +5 -5
- package/mysql-core/columns/year.d.cts +21 -0
- package/mysql-core/columns/year.d.mts +21 -0
- package/mysql-core/columns/year.d.ts +4 -4
- package/mysql-core/db.d.cts +55 -0
- package/mysql-core/db.d.mts +55 -0
- package/mysql-core/db.d.ts +14 -14
- package/mysql-core/dialect.d.cts +59 -0
- package/mysql-core/dialect.d.mts +59 -0
- package/mysql-core/dialect.d.ts +12 -12
- package/mysql-core/expressions.d.cts +8 -0
- package/mysql-core/expressions.d.mts +8 -0
- package/mysql-core/expressions.d.ts +3 -3
- package/mysql-core/foreign-keys.d.cts +48 -0
- package/mysql-core/foreign-keys.d.mts +48 -0
- package/mysql-core/foreign-keys.d.ts +3 -3
- package/mysql-core/index.cjs +156 -1028
- package/mysql-core/index.cjs.map +1 -1
- package/mysql-core/index.d.cts +16 -0
- package/mysql-core/index.d.mts +16 -0
- package/mysql-core/index.d.ts +16 -16
- package/mysql-core/index.mjs +37 -36
- package/mysql-core/index.mjs.map +1 -1
- package/mysql-core/indexes.d.cts +59 -0
- package/mysql-core/indexes.d.mts +59 -0
- package/mysql-core/indexes.d.ts +4 -4
- package/mysql-core/primary-keys.d.cts +17 -0
- package/mysql-core/primary-keys.d.mts +17 -0
- package/mysql-core/primary-keys.d.ts +3 -3
- package/mysql-core/query-builders/delete.d.cts +39 -0
- package/mysql-core/query-builders/delete.d.mts +39 -0
- package/mysql-core/query-builders/delete.d.ts +9 -9
- package/mysql-core/query-builders/index.d.cts +6 -0
- package/mysql-core/query-builders/index.d.mts +6 -0
- package/mysql-core/query-builders/index.d.ts +6 -6
- package/mysql-core/query-builders/insert.d.cts +59 -0
- package/mysql-core/query-builders/insert.d.mts +59 -0
- package/mysql-core/query-builders/insert.d.ts +11 -11
- package/mysql-core/query-builders/query-builder.d.cts +29 -0
- package/mysql-core/query-builders/query-builder.d.mts +29 -0
- package/mysql-core/query-builders/query-builder.d.ts +7 -7
- package/mysql-core/query-builders/query.d.cts +44 -0
- package/mysql-core/query-builders/query.d.mts +44 -0
- package/mysql-core/query-builders/query.d.ts +9 -9
- package/mysql-core/query-builders/select.d.cts +92 -0
- package/mysql-core/query-builders/select.d.mts +92 -0
- package/mysql-core/query-builders/select.d.ts +17 -17
- package/mysql-core/query-builders/select.types.d.cts +77 -0
- package/mysql-core/query-builders/select.types.d.mts +77 -0
- package/mysql-core/query-builders/select.types.d.ts +12 -12
- package/mysql-core/query-builders/update.d.cts +54 -0
- package/mysql-core/query-builders/update.d.mts +54 -0
- package/mysql-core/query-builders/update.d.ts +11 -11
- package/mysql-core/schema.d.cts +24 -0
- package/mysql-core/schema.d.mts +24 -0
- package/mysql-core/schema.d.ts +3 -3
- package/mysql-core/session.d.cts +63 -0
- package/mysql-core/session.d.mts +63 -0
- package/mysql-core/session.d.ts +7 -7
- package/mysql-core/subquery.d.cts +6 -0
- package/mysql-core/subquery.d.mts +6 -0
- package/mysql-core/subquery.d.ts +4 -4
- package/mysql-core/table.d.cts +35 -0
- package/mysql-core/table.d.mts +35 -0
- package/mysql-core/table.d.ts +11 -11
- package/mysql-core/unique-constraint.d.cts +24 -0
- package/mysql-core/unique-constraint.d.mts +24 -0
- package/mysql-core/unique-constraint.d.ts +3 -3
- package/mysql-core/utils.d.cts +32 -0
- package/mysql-core/utils.d.mts +32 -0
- package/mysql-core/utils.d.ts +11 -11
- package/mysql-core/view.d.cts +73 -0
- package/mysql-core/view.d.mts +73 -0
- package/mysql-core/view.d.ts +11 -11
- package/mysql2/driver.d.cts +31 -0
- package/mysql2/driver.d.mts +31 -0
- package/mysql2/driver.d.ts +10 -10
- package/mysql2/index.cjs +29 -27
- package/mysql2/index.cjs.map +1 -1
- package/mysql2/index.d.cts +2 -0
- package/mysql2/index.d.mts +2 -0
- package/mysql2/index.d.ts +2 -2
- package/mysql2/index.mjs +5 -2
- package/mysql2/index.mjs.map +1 -1
- package/mysql2/migrator.d.cts +3 -0
- package/mysql2/migrator.d.mts +3 -0
- package/mysql2/migrator.d.ts +2 -2
- package/mysql2/session.d.cts +52 -0
- package/mysql2/session.d.mts +52 -0
- package/mysql2/session.d.ts +8 -8
- package/neon-http/driver.d.cts +21 -0
- package/neon-http/driver.d.mts +21 -0
- package/neon-http/driver.d.ts +7 -7
- package/neon-http/index.cjs +16 -16
- package/neon-http/index.d.cts +2 -0
- package/neon-http/index.d.mts +2 -0
- package/neon-http/index.d.ts +2 -2
- package/neon-http/index.mjs +3 -2
- package/neon-http/index.mjs.map +1 -1
- package/neon-http/migrator.cjs +9 -6
- package/neon-http/migrator.cjs.map +1 -1
- package/neon-http/migrator.d.cts +11 -0
- package/neon-http/migrator.d.mts +11 -0
- package/neon-http/migrator.d.ts +2 -2
- package/neon-http/migrator.mjs +3 -1
- package/neon-http/migrator.mjs.map +1 -1
- package/neon-http/session.d.cts +55 -0
- package/neon-http/session.d.mts +55 -0
- package/neon-http/session.d.ts +10 -10
- package/neon-serverless/driver.d.cts +22 -0
- package/neon-serverless/driver.d.mts +22 -0
- package/neon-serverless/driver.d.ts +8 -8
- package/neon-serverless/index.cjs +22 -22
- package/neon-serverless/index.d.cts +2 -0
- package/neon-serverless/index.d.mts +2 -0
- package/neon-serverless/index.d.ts +2 -2
- package/neon-serverless/index.mjs +3 -2
- package/neon-serverless/index.mjs.map +1 -1
- package/neon-serverless/migrator.d.cts +3 -0
- package/neon-serverless/migrator.d.mts +3 -0
- package/neon-serverless/migrator.d.ts +2 -2
- package/neon-serverless/session.d.cts +48 -0
- package/neon-serverless/session.d.mts +48 -0
- package/neon-serverless/session.d.ts +10 -10
- package/node-postgres/driver.d.cts +22 -0
- package/node-postgres/driver.d.mts +22 -0
- package/node-postgres/driver.d.ts +8 -8
- package/node-postgres/index.cjs +27 -27
- package/node-postgres/index.d.cts +2 -0
- package/node-postgres/index.d.mts +2 -0
- package/node-postgres/index.d.ts +2 -2
- package/node-postgres/index.mjs +3 -2
- package/node-postgres/index.mjs.map +1 -1
- package/node-postgres/migrator.d.cts +3 -0
- package/node-postgres/migrator.d.mts +3 -0
- package/node-postgres/migrator.d.ts +2 -2
- package/node-postgres/session.d.cts +46 -0
- package/node-postgres/session.d.mts +46 -0
- package/node-postgres/session.d.ts +10 -10
- package/operations.d.cts +15 -0
- package/operations.d.mts +15 -0
- package/operations.d.ts +3 -3
- package/package.json +291 -74
- package/pg-core/alias.d.cts +4 -0
- package/pg-core/alias.d.mts +4 -0
- package/pg-core/alias.d.ts +3 -3
- package/pg-core/checks.d.cts +18 -0
- package/pg-core/checks.d.mts +18 -0
- package/pg-core/checks.d.ts +3 -3
- package/pg-core/columns/array.d.cts +26 -0
- package/pg-core/columns/array.d.mts +26 -0
- package/pg-core/columns/array.d.ts +5 -5
- package/pg-core/columns/bigint.d.cts +43 -0
- package/pg-core/columns/bigint.d.mts +43 -0
- package/pg-core/columns/bigint.d.ts +4 -4
- package/pg-core/columns/bigserial.d.cts +43 -0
- package/pg-core/columns/bigserial.d.mts +43 -0
- package/pg-core/columns/bigserial.d.ts +4 -4
- package/pg-core/columns/boolean.d.cts +21 -0
- package/pg-core/columns/boolean.d.mts +21 -0
- package/pg-core/columns/boolean.d.ts +4 -4
- package/pg-core/columns/char.d.cts +34 -0
- package/pg-core/columns/char.d.mts +34 -0
- package/pg-core/columns/char.d.ts +5 -5
- package/pg-core/columns/cidr.d.cts +21 -0
- package/pg-core/columns/cidr.d.mts +21 -0
- package/pg-core/columns/cidr.d.ts +4 -4
- package/pg-core/columns/common.d.cts +54 -0
- package/pg-core/columns/common.d.mts +54 -0
- package/pg-core/columns/common.d.ts +15 -13
- package/pg-core/columns/custom.d.cts +148 -0
- package/pg-core/columns/custom.d.mts +148 -0
- package/pg-core/columns/custom.d.ts +7 -7
- package/pg-core/columns/date.common.d.cts +7 -0
- package/pg-core/columns/date.common.d.mts +7 -0
- package/pg-core/columns/date.common.d.ts +4 -4
- package/pg-core/columns/date.d.cts +45 -0
- package/pg-core/columns/date.d.mts +45 -0
- package/pg-core/columns/date.d.ts +5 -5
- package/pg-core/columns/double-precision.d.cts +22 -0
- package/pg-core/columns/double-precision.d.mts +22 -0
- package/pg-core/columns/double-precision.d.ts +4 -4
- package/pg-core/columns/enum.d.cts +42 -0
- package/pg-core/columns/enum.d.mts +42 -0
- package/pg-core/columns/enum.d.ts +6 -6
- package/pg-core/columns/index.d.cts +28 -0
- package/pg-core/columns/index.d.mts +28 -0
- package/pg-core/columns/index.d.ts +28 -28
- package/pg-core/columns/inet.d.cts +21 -0
- package/pg-core/columns/inet.d.mts +21 -0
- package/pg-core/columns/inet.d.ts +4 -4
- package/pg-core/columns/integer.d.cts +23 -0
- package/pg-core/columns/integer.d.mts +23 -0
- package/pg-core/columns/integer.d.ts +4 -4
- package/pg-core/columns/interval.d.cts +32 -0
- package/pg-core/columns/interval.d.mts +32 -0
- package/pg-core/columns/interval.d.ts +5 -5
- package/pg-core/columns/json.d.cts +27 -0
- package/pg-core/columns/json.d.mts +27 -0
- package/pg-core/columns/json.d.ts +5 -5
- package/pg-core/columns/jsonb.d.cts +27 -0
- package/pg-core/columns/jsonb.d.mts +27 -0
- package/pg-core/columns/jsonb.d.ts +5 -5
- package/pg-core/columns/macaddr.d.cts +21 -0
- package/pg-core/columns/macaddr.d.mts +21 -0
- package/pg-core/columns/macaddr.d.ts +4 -4
- package/pg-core/columns/macaddr8.d.cts +21 -0
- package/pg-core/columns/macaddr8.d.mts +21 -0
- package/pg-core/columns/macaddr8.d.ts +4 -4
- package/pg-core/columns/numeric.d.cts +40 -0
- package/pg-core/columns/numeric.d.mts +40 -0
- package/pg-core/columns/numeric.d.ts +5 -5
- package/pg-core/columns/real.d.cts +28 -0
- package/pg-core/columns/real.d.mts +28 -0
- package/pg-core/columns/real.d.ts +5 -5
- package/pg-core/columns/serial.d.cts +21 -0
- package/pg-core/columns/serial.d.mts +21 -0
- package/pg-core/columns/serial.d.ts +4 -4
- package/pg-core/columns/smallint.d.cts +22 -0
- package/pg-core/columns/smallint.d.mts +22 -0
- package/pg-core/columns/smallint.d.ts +4 -4
- package/pg-core/columns/smallserial.d.cts +21 -0
- package/pg-core/columns/smallserial.d.mts +21 -0
- package/pg-core/columns/smallserial.d.ts +4 -4
- package/pg-core/columns/text.d.cts +31 -0
- package/pg-core/columns/text.d.mts +31 -0
- package/pg-core/columns/text.d.ts +5 -5
- package/pg-core/columns/time.d.cts +38 -0
- package/pg-core/columns/time.d.mts +38 -0
- package/pg-core/columns/time.d.ts +7 -7
- package/pg-core/columns/timestamp.d.cts +64 -0
- package/pg-core/columns/timestamp.d.mts +64 -0
- package/pg-core/columns/timestamp.d.ts +7 -7
- package/pg-core/columns/uuid.d.cts +25 -0
- package/pg-core/columns/uuid.d.mts +25 -0
- package/pg-core/columns/uuid.d.ts +4 -4
- package/pg-core/columns/varchar.d.cts +34 -0
- package/pg-core/columns/varchar.d.mts +34 -0
- package/pg-core/columns/varchar.d.ts +5 -5
- package/pg-core/db.d.cts +53 -0
- package/pg-core/db.d.mts +53 -0
- package/pg-core/db.d.ts +17 -17
- package/pg-core/dialect.d.cts +53 -0
- package/pg-core/dialect.d.mts +53 -0
- package/pg-core/dialect.d.ts +11 -11
- package/pg-core/expressions.d.cts +8 -0
- package/pg-core/expressions.d.mts +8 -0
- package/pg-core/expressions.d.ts +3 -3
- package/pg-core/foreign-keys.d.cts +45 -0
- package/pg-core/foreign-keys.d.mts +45 -0
- package/pg-core/foreign-keys.d.ts +3 -3
- package/pg-core/index.cjs +158 -157
- package/pg-core/index.cjs.map +1 -1
- package/pg-core/index.d.cts +16 -0
- package/pg-core/index.d.mts +16 -0
- package/pg-core/index.d.ts +16 -16
- package/pg-core/index.mjs +8 -7
- package/pg-core/index.mjs.map +1 -1
- package/pg-core/indexes.d.cts +72 -0
- package/pg-core/indexes.d.mts +72 -0
- package/pg-core/indexes.d.ts +4 -4
- package/pg-core/primary-keys.d.cts +17 -0
- package/pg-core/primary-keys.d.mts +17 -0
- package/pg-core/primary-keys.d.ts +3 -3
- package/pg-core/query-builders/delete.d.cts +35 -0
- package/pg-core/query-builders/delete.d.mts +35 -0
- package/pg-core/query-builders/delete.d.ts +9 -9
- package/pg-core/query-builders/index.d.cts +7 -0
- package/pg-core/query-builders/index.d.mts +7 -0
- package/pg-core/query-builders/index.d.ts +7 -7
- package/pg-core/query-builders/insert.d.cts +63 -0
- package/pg-core/query-builders/insert.d.mts +63 -0
- package/pg-core/query-builders/insert.d.ts +12 -12
- package/pg-core/query-builders/query-builder.d.cts +37 -0
- package/pg-core/query-builders/query-builder.d.mts +37 -0
- package/pg-core/query-builders/query-builder.d.ts +9 -9
- package/pg-core/query-builders/query.d.cts +39 -0
- package/pg-core/query-builders/query.d.mts +39 -0
- package/pg-core/query-builders/query.d.ts +7 -7
- package/pg-core/query-builders/refresh-materialized-view.d.cts +26 -0
- package/pg-core/query-builders/refresh-materialized-view.d.mts +26 -0
- package/pg-core/query-builders/refresh-materialized-view.d.ts +6 -6
- package/pg-core/query-builders/select.d.cts +211 -0
- package/pg-core/query-builders/select.d.mts +211 -0
- package/pg-core/query-builders/select.d.ts +15 -15
- package/pg-core/query-builders/select.types.d.cts +79 -0
- package/pg-core/query-builders/select.types.d.mts +79 -0
- package/pg-core/query-builders/select.types.d.ts +11 -11
- package/pg-core/query-builders/update.d.cts +53 -0
- package/pg-core/query-builders/update.d.mts +53 -0
- package/pg-core/query-builders/update.d.ts +11 -11
- package/pg-core/schema.d.cts +13 -0
- package/pg-core/schema.d.mts +13 -0
- package/pg-core/schema.d.ts +3 -3
- package/pg-core/session.d.cts +54 -0
- package/pg-core/session.d.mts +54 -0
- package/pg-core/session.d.ts +6 -6
- package/pg-core/subquery.d.cts +5 -0
- package/pg-core/subquery.d.mts +5 -0
- package/pg-core/subquery.d.ts +3 -3
- package/pg-core/table.d.cts +28 -0
- package/pg-core/table.d.mts +28 -0
- package/pg-core/table.d.ts +10 -10
- package/pg-core/unique-constraint.d.cts +25 -0
- package/pg-core/unique-constraint.d.mts +25 -0
- package/pg-core/unique-constraint.d.ts +3 -3
- package/pg-core/utils.d.cts +52 -0
- package/pg-core/utils.d.mts +52 -0
- package/pg-core/utils.d.ts +16 -16
- package/pg-core/view.d.cts +143 -0
- package/pg-core/view.d.mts +143 -0
- package/pg-core/view.d.ts +13 -13
- package/planetscale-serverless/driver.d.cts +10 -0
- package/planetscale-serverless/driver.d.mts +10 -0
- package/planetscale-serverless/driver.d.ts +4 -4
- package/planetscale-serverless/index.cjs +18 -18
- package/planetscale-serverless/index.cjs.map +1 -1
- package/planetscale-serverless/index.d.cts +2 -0
- package/planetscale-serverless/index.d.mts +2 -0
- package/planetscale-serverless/index.d.ts +2 -2
- package/planetscale-serverless/index.mjs +3 -2
- package/planetscale-serverless/index.mjs.map +1 -1
- package/planetscale-serverless/migrator.d.cts +3 -0
- package/planetscale-serverless/migrator.d.mts +3 -0
- package/planetscale-serverless/migrator.d.ts +2 -2
- package/planetscale-serverless/session.d.cts +52 -0
- package/planetscale-serverless/session.d.mts +52 -0
- package/planetscale-serverless/session.d.ts +8 -8
- package/postgres-js/driver.d.cts +6 -0
- package/postgres-js/driver.d.mts +6 -0
- package/postgres-js/driver.d.ts +3 -3
- package/postgres-js/index.cjs +20 -20
- package/postgres-js/index.d.cts +2 -0
- package/postgres-js/index.d.mts +2 -0
- package/postgres-js/index.d.ts +2 -2
- package/postgres-js/index.mjs +3 -2
- package/postgres-js/index.mjs.map +1 -1
- package/postgres-js/migrator.d.cts +3 -0
- package/postgres-js/migrator.d.mts +3 -0
- package/postgres-js/migrator.d.ts +2 -2
- package/postgres-js/session.d.cts +49 -0
- package/postgres-js/session.d.mts +49 -0
- package/postgres-js/session.d.ts +10 -10
- package/primary-key.d.cts +10 -0
- package/primary-key.d.mts +10 -0
- package/primary-key.d.ts +3 -3
- package/query-builders/query-builder.d.cts +10 -0
- package/query-builders/query-builder.d.mts +10 -0
- package/query-builders/query-builder.d.ts +2 -2
- package/query-builders/select.types.d.cts +56 -0
- package/query-builders/select.types.d.mts +56 -0
- package/query-builders/select.types.d.ts +8 -8
- package/query-promise.d.cts +9 -0
- package/query-promise.d.mts +9 -0
- package/query-promise.d.ts +1 -1
- package/relations.d.cts +189 -0
- package/relations.d.mts +189 -0
- package/relations.d.ts +10 -10
- package/{session-775da517.mjs → session-a0c900ab.mjs} +5 -3
- package/session-a0c900ab.mjs.map +1 -0
- package/{session-e7fcd577.mjs → session-a706e83f.mjs} +3 -2
- package/session-a706e83f.mjs.map +1 -0
- package/{session-f61b6e4d.cjs → session-fadbb086.cjs} +239 -239
- package/session-fadbb086.cjs.map +1 -0
- package/sql/expressions/conditions.d.cts +393 -0
- package/sql/expressions/conditions.d.mts +393 -0
- package/sql/expressions/conditions.d.ts +2 -2
- package/sql/expressions/index.d.cts +2 -0
- package/sql/expressions/index.d.mts +2 -0
- package/sql/expressions/index.d.ts +2 -2
- package/sql/expressions/select.d.cts +38 -0
- package/sql/expressions/select.d.mts +38 -0
- package/sql/expressions/select.d.ts +2 -2
- package/sql/index.d.cts +191 -0
- package/sql/index.d.mts +191 -0
- package/sql/index.d.ts +7 -7
- package/sql-js/driver.d.cts +5 -0
- package/sql-js/driver.d.mts +5 -0
- package/sql-js/driver.d.ts +2 -2
- package/sql-js/index.cjs +19 -19
- package/sql-js/index.d.cts +2 -0
- package/sql-js/index.d.mts +2 -0
- package/sql-js/index.d.ts +2 -2
- package/sql-js/index.mjs +3 -2
- package/sql-js/index.mjs.map +1 -1
- package/sql-js/migrator.d.cts +3 -0
- package/sql-js/migrator.d.mts +3 -0
- package/sql-js/migrator.d.ts +2 -2
- package/sql-js/session.d.cts +52 -0
- package/sql-js/session.d.mts +52 -0
- package/sql-js/session.d.ts +9 -9
- package/sqlite-core/alias.d.cts +4 -0
- package/sqlite-core/alias.d.mts +4 -0
- package/sqlite-core/alias.d.ts +3 -3
- package/sqlite-core/checks.d.cts +22 -0
- package/sqlite-core/checks.d.mts +22 -0
- package/sqlite-core/checks.d.ts +3 -3
- package/sqlite-core/columns/blob.d.cts +65 -0
- package/sqlite-core/columns/blob.d.mts +65 -0
- package/sqlite-core/columns/blob.d.ts +6 -6
- package/sqlite-core/columns/common.d.cts +35 -0
- package/sqlite-core/columns/common.d.mts +35 -0
- package/sqlite-core/columns/common.d.ts +14 -12
- package/sqlite-core/columns/custom.d.cts +148 -0
- package/sqlite-core/columns/custom.d.mts +148 -0
- package/sqlite-core/columns/custom.d.ts +7 -7
- package/sqlite-core/columns/index.d.cts +7 -0
- package/sqlite-core/columns/index.d.mts +7 -0
- package/sqlite-core/columns/index.d.ts +7 -7
- package/sqlite-core/columns/integer.d.cts +106 -0
- package/sqlite-core/columns/integer.d.mts +106 -0
- package/sqlite-core/columns/integer.d.ts +7 -7
- package/sqlite-core/columns/numeric.d.cts +21 -0
- package/sqlite-core/columns/numeric.d.mts +21 -0
- package/sqlite-core/columns/numeric.d.ts +4 -4
- package/sqlite-core/columns/real.d.cts +21 -0
- package/sqlite-core/columns/real.d.mts +21 -0
- package/sqlite-core/columns/real.d.ts +4 -4
- package/sqlite-core/columns/text.d.cts +38 -0
- package/sqlite-core/columns/text.d.mts +38 -0
- package/sqlite-core/columns/text.d.ts +6 -6
- package/sqlite-core/db.d.cts +57 -0
- package/sqlite-core/db.d.mts +57 -0
- package/sqlite-core/db.d.ts +14 -14
- package/sqlite-core/dialect.d.cts +53 -0
- package/sqlite-core/dialect.d.mts +53 -0
- package/sqlite-core/dialect.d.ts +10 -10
- package/sqlite-core/expressions.d.cts +9 -0
- package/sqlite-core/expressions.d.mts +9 -0
- package/sqlite-core/expressions.d.ts +3 -3
- package/sqlite-core/foreign-keys.d.cts +48 -0
- package/sqlite-core/foreign-keys.d.mts +48 -0
- package/sqlite-core/foreign-keys.d.ts +3 -3
- package/sqlite-core/index.cjs +11 -11
- package/sqlite-core/index.cjs.map +1 -1
- package/sqlite-core/index.d.cts +15 -0
- package/sqlite-core/index.d.mts +15 -0
- package/sqlite-core/index.d.ts +15 -15
- package/sqlite-core/index.mjs +4 -3
- package/sqlite-core/index.mjs.map +1 -1
- package/sqlite-core/indexes.d.cts +41 -0
- package/sqlite-core/indexes.d.mts +41 -0
- package/sqlite-core/indexes.d.ts +4 -4
- package/sqlite-core/primary-keys.d.cts +20 -0
- package/sqlite-core/primary-keys.d.mts +20 -0
- package/sqlite-core/primary-keys.d.ts +3 -3
- package/sqlite-core/query-builders/delete.d.cts +42 -0
- package/sqlite-core/query-builders/delete.d.mts +42 -0
- package/sqlite-core/query-builders/delete.d.ts +10 -10
- package/sqlite-core/query-builders/index.d.cts +6 -0
- package/sqlite-core/query-builders/index.d.mts +6 -0
- package/sqlite-core/query-builders/index.d.ts +6 -6
- package/sqlite-core/query-builders/insert.d.cts +74 -0
- package/sqlite-core/query-builders/insert.d.mts +74 -0
- package/sqlite-core/query-builders/insert.d.ts +13 -13
- package/sqlite-core/query-builders/query-builder.d.cts +29 -0
- package/sqlite-core/query-builders/query-builder.d.mts +29 -0
- package/sqlite-core/query-builders/query-builder.d.ts +7 -7
- package/sqlite-core/query-builders/query.d.cts +47 -0
- package/sqlite-core/query-builders/query.d.mts +47 -0
- package/sqlite-core/query-builders/query.d.ts +7 -7
- package/sqlite-core/query-builders/select.d.cts +94 -0
- package/sqlite-core/query-builders/select.d.mts +94 -0
- package/sqlite-core/query-builders/select.d.ts +15 -15
- package/sqlite-core/query-builders/select.types.d.cts +63 -0
- package/sqlite-core/query-builders/select.types.d.mts +63 -0
- package/sqlite-core/query-builders/select.types.d.ts +11 -11
- package/sqlite-core/query-builders/update.d.cts +63 -0
- package/sqlite-core/query-builders/update.d.mts +63 -0
- package/sqlite-core/query-builders/update.d.ts +11 -11
- package/sqlite-core/session.d.cts +91 -0
- package/sqlite-core/session.d.mts +91 -0
- package/sqlite-core/session.d.ts +7 -7
- package/sqlite-core/subquery.d.cts +5 -0
- package/sqlite-core/subquery.d.mts +5 -0
- package/sqlite-core/subquery.d.ts +3 -3
- package/sqlite-core/table.d.cts +28 -0
- package/sqlite-core/table.d.mts +28 -0
- package/sqlite-core/table.d.ts +10 -10
- package/sqlite-core/unique-constraint.d.cts +23 -0
- package/sqlite-core/unique-constraint.d.mts +23 -0
- package/sqlite-core/unique-constraint.d.ts +3 -3
- package/sqlite-core/utils.d.cts +31 -0
- package/sqlite-core/utils.d.mts +31 -0
- package/sqlite-core/utils.d.ts +11 -11
- package/sqlite-core/view.d.cts +67 -0
- package/sqlite-core/view.d.mts +67 -0
- package/sqlite-core/view.d.ts +11 -11
- package/sqlite-proxy/driver.d.cts +11 -0
- package/sqlite-proxy/driver.d.mts +11 -0
- package/sqlite-proxy/driver.d.ts +2 -2
- package/sqlite-proxy/index.cjs +19 -19
- package/sqlite-proxy/index.d.cts +2 -0
- package/sqlite-proxy/index.d.mts +2 -0
- package/sqlite-proxy/index.d.ts +2 -2
- package/sqlite-proxy/index.mjs +3 -2
- package/sqlite-proxy/index.mjs.map +1 -1
- package/sqlite-proxy/migrator.cjs +4 -3
- package/sqlite-proxy/migrator.cjs.map +1 -1
- package/sqlite-proxy/migrator.d.cts +4 -0
- package/sqlite-proxy/migrator.d.mts +4 -0
- package/sqlite-proxy/migrator.d.ts +2 -2
- package/sqlite-proxy/migrator.mjs +2 -1
- package/sqlite-proxy/migrator.mjs.map +1 -1
- package/sqlite-proxy/session.d.cts +48 -0
- package/sqlite-proxy/session.d.mts +48 -0
- package/sqlite-proxy/session.d.ts +10 -10
- package/subquery.d.cts +23 -0
- package/subquery.d.mts +23 -0
- package/subquery.d.ts +3 -3
- package/table.d.cts +63 -0
- package/table.d.mts +63 -0
- package/table.d.ts +8 -8
- package/tracing.d.cts +1 -0
- package/tracing.d.mts +1 -0
- package/utils.d.cts +45 -0
- package/utils.d.mts +45 -0
- package/utils.d.ts +4 -4
- package/vercel-postgres/driver.d.cts +21 -0
- package/vercel-postgres/driver.d.mts +21 -0
- package/vercel-postgres/driver.d.ts +7 -7
- package/vercel-postgres/index.cjs +22 -22
- package/vercel-postgres/index.d.cts +2 -0
- package/vercel-postgres/index.d.mts +2 -0
- package/vercel-postgres/index.d.ts +2 -2
- package/vercel-postgres/index.mjs +3 -2
- package/vercel-postgres/index.mjs.map +1 -1
- package/vercel-postgres/migrator.d.cts +3 -0
- package/vercel-postgres/migrator.d.mts +3 -0
- package/vercel-postgres/migrator.d.ts +2 -2
- package/vercel-postgres/session.d.cts +47 -0
- package/vercel-postgres/session.d.mts +47 -0
- package/vercel-postgres/session.d.ts +9 -9
- package/version.cjs +1 -1
- package/version.d.cts +2 -0
- package/version.d.mts +2 -0
- package/version.mjs +1 -1
- package/{session-9eb850c1.mjs → view-ba779eb7.mjs} +171 -169
- package/view-ba779eb7.mjs.map +1 -0
- package/{session-690cd067.cjs → view-e96fe3b6.cjs} +1400 -445
- package/view-e96fe3b6.cjs.map +1 -0
- package/view.d.cts +24 -0
- package/view.d.mts +24 -0
- package/view.d.ts +5 -5
- package/alias-58b7b8c9.cjs.map +0 -1
- package/alias-d302772a.mjs.map +0 -1
- package/session-690cd067.cjs.map +0 -1
- package/session-775da517.mjs.map +0 -1
- package/session-9eb850c1.mjs.map +0 -1
- package/session-e7fcd577.mjs.map +0 -1
- package/session-f61b6e4d.cjs.map +0 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { entityKind } from '../../entity.js';
|
|
2
|
+
import { TypedQueryBuilder } from '../../query-builders/query-builder.js';
|
|
3
|
+
import type { BuildSubquerySelection, GetSelectTableName, GetSelectTableSelection, JoinNullability, SelectMode, SelectResult } from '../../query-builders/select.types.js';
|
|
4
|
+
import { QueryPromise } from '../../query-promise.js';
|
|
5
|
+
import { type Placeholder, type Query, SQL } from '../../sql/index.js';
|
|
6
|
+
import type { SQLiteColumn } from '../columns/index.js';
|
|
7
|
+
import type { SQLiteDialect } from '../dialect.js';
|
|
8
|
+
import type { PreparedQuery, SQLiteSession } from '../session.js';
|
|
9
|
+
import type { SubqueryWithSelection } from '../subquery.js';
|
|
10
|
+
import type { SQLiteTable } from '../table.js';
|
|
11
|
+
import { Subquery } from '../../subquery.js';
|
|
12
|
+
import { type ValueOrArray } from '../../utils.js';
|
|
13
|
+
import { type ColumnsSelection } from '../../view.js';
|
|
14
|
+
import { SQLiteViewBase } from '../view.js';
|
|
15
|
+
import type { JoinFn, SelectedFields, SQLiteSelectConfig, SQLiteSelectHKT, SQLiteSelectHKTBase, SQLiteSelectQueryBuilderHKT } from './select.types.js';
|
|
16
|
+
type CreateSQLiteSelectFromBuilderMode<TBuilderMode extends 'db' | 'qb', TTableName extends string | undefined, TResultType extends 'sync' | 'async', TRunResult, TSelection extends ColumnsSelection, TSelectMode extends SelectMode> = TBuilderMode extends 'db' ? SQLiteSelect<TTableName, TResultType, TRunResult, TSelection, TSelectMode> : SQLiteSelectQueryBuilder<SQLiteSelectQueryBuilderHKT, TTableName, TResultType, TRunResult, TSelection, TSelectMode>;
|
|
17
|
+
export declare class SQLiteSelectBuilder<TSelection extends SelectedFields | undefined, TResultType extends 'sync' | 'async', TRunResult, TBuilderMode extends 'db' | 'qb' = 'db'> {
|
|
18
|
+
static readonly [entityKind]: string;
|
|
19
|
+
private fields;
|
|
20
|
+
private session;
|
|
21
|
+
private dialect;
|
|
22
|
+
private withList;
|
|
23
|
+
private distinct;
|
|
24
|
+
constructor(config: {
|
|
25
|
+
fields: TSelection;
|
|
26
|
+
session: SQLiteSession<any, any, any, any> | undefined;
|
|
27
|
+
dialect: SQLiteDialect;
|
|
28
|
+
withList?: Subquery[];
|
|
29
|
+
distinct?: boolean;
|
|
30
|
+
});
|
|
31
|
+
from<TFrom extends SQLiteTable | Subquery | SQLiteViewBase | SQL>(source: TFrom): CreateSQLiteSelectFromBuilderMode<TBuilderMode, GetSelectTableName<TFrom>, TResultType, TRunResult, TSelection extends undefined ? GetSelectTableSelection<TFrom> : TSelection, TSelection extends undefined ? 'single' : 'partial'>;
|
|
32
|
+
}
|
|
33
|
+
export declare abstract class SQLiteSelectQueryBuilder<THKT extends SQLiteSelectHKTBase, TTableName extends string | undefined, TResultType extends 'sync' | 'async', TRunResult, TSelection extends ColumnsSelection, TSelectMode extends SelectMode, TNullabilityMap extends Record<string, JoinNullability> = TTableName extends string ? Record<TTableName, 'not-null'> : {}> extends TypedQueryBuilder<BuildSubquerySelection<TSelection, TNullabilityMap>, SelectResult<TSelection, TSelectMode, TNullabilityMap>[]> {
|
|
34
|
+
static readonly [entityKind]: string;
|
|
35
|
+
readonly _: {
|
|
36
|
+
readonly selectMode: TSelectMode;
|
|
37
|
+
readonly selection: TSelection;
|
|
38
|
+
readonly result: SelectResult<TSelection, TSelectMode, TNullabilityMap>[];
|
|
39
|
+
readonly selectedFields: BuildSubquerySelection<TSelection, TNullabilityMap>;
|
|
40
|
+
};
|
|
41
|
+
protected config: SQLiteSelectConfig;
|
|
42
|
+
protected joinsNotNullableMap: Record<string, boolean>;
|
|
43
|
+
private tableName;
|
|
44
|
+
private isPartialSelect;
|
|
45
|
+
protected session: SQLiteSession<any, any, any, any> | undefined;
|
|
46
|
+
protected dialect: SQLiteDialect;
|
|
47
|
+
constructor({ table, fields, isPartialSelect, session, dialect, withList, distinct }: {
|
|
48
|
+
table: SQLiteSelectConfig['table'];
|
|
49
|
+
fields: SQLiteSelectConfig['fields'];
|
|
50
|
+
isPartialSelect: boolean;
|
|
51
|
+
session: SQLiteSession<any, any, any, any> | undefined;
|
|
52
|
+
dialect: SQLiteDialect;
|
|
53
|
+
withList: Subquery[] | undefined;
|
|
54
|
+
distinct: boolean | undefined;
|
|
55
|
+
});
|
|
56
|
+
private createJoin;
|
|
57
|
+
leftJoin: JoinFn<THKT, TTableName, TResultType, TRunResult, TSelectMode, "left", TSelection, TNullabilityMap>;
|
|
58
|
+
rightJoin: JoinFn<THKT, TTableName, TResultType, TRunResult, TSelectMode, "right", TSelection, TNullabilityMap>;
|
|
59
|
+
innerJoin: JoinFn<THKT, TTableName, TResultType, TRunResult, TSelectMode, "inner", TSelection, TNullabilityMap>;
|
|
60
|
+
fullJoin: JoinFn<THKT, TTableName, TResultType, TRunResult, TSelectMode, "full", TSelection, TNullabilityMap>;
|
|
61
|
+
where(where: ((aliases: TSelection) => SQL | undefined) | SQL | undefined): this;
|
|
62
|
+
having(having: ((aliases: TSelection) => SQL | undefined) | SQL | undefined): this;
|
|
63
|
+
groupBy(builder: (aliases: TSelection) => ValueOrArray<SQLiteColumn | SQL | SQL.Aliased>): this;
|
|
64
|
+
groupBy(...columns: (SQLiteColumn | SQL)[]): this;
|
|
65
|
+
orderBy(builder: (aliases: TSelection) => ValueOrArray<SQLiteColumn | SQL | SQL.Aliased>): this;
|
|
66
|
+
orderBy(...columns: (SQLiteColumn | SQL)[]): this;
|
|
67
|
+
limit(limit: number | Placeholder): this;
|
|
68
|
+
offset(offset: number | Placeholder): this;
|
|
69
|
+
toSQL(): {
|
|
70
|
+
sql: Query['sql'];
|
|
71
|
+
params: Query['params'];
|
|
72
|
+
};
|
|
73
|
+
as<TAlias extends string>(alias: TAlias): SubqueryWithSelection<BuildSubquerySelection<TSelection, TNullabilityMap>, TAlias>;
|
|
74
|
+
getSelectedFields(): BuildSubquerySelection<TSelection, TNullabilityMap>;
|
|
75
|
+
}
|
|
76
|
+
export interface SQLiteSelect<TTableName extends string | undefined, TResultType extends 'sync' | 'async', TRunResult, TSelection extends ColumnsSelection, TSelectMode extends SelectMode = 'single', TNullabilityMap extends Record<string, JoinNullability> = TTableName extends string ? Record<TTableName, 'not-null'> : {}> extends SQLiteSelectQueryBuilder<SQLiteSelectHKT, TTableName | undefined, TResultType, TRunResult, TSelection, TSelectMode, TNullabilityMap>, QueryPromise<SelectResult<TSelection, TSelectMode, TNullabilityMap>[]> {
|
|
77
|
+
}
|
|
78
|
+
export declare class SQLiteSelect<TTableName extends string | undefined, TResultType extends 'sync' | 'async', TRunResult, TSelection, TSelectMode extends SelectMode = 'single', TNullabilityMap extends Record<string, JoinNullability> = TTableName extends string ? Record<TTableName, 'not-null'> : {}> extends SQLiteSelectQueryBuilder<SQLiteSelectHKT, TTableName, TResultType, TRunResult, TSelection, TSelectMode, TNullabilityMap> {
|
|
79
|
+
static readonly [entityKind]: string;
|
|
80
|
+
prepare(isOneTimeQuery?: boolean): PreparedQuery<{
|
|
81
|
+
type: TResultType;
|
|
82
|
+
run: TRunResult;
|
|
83
|
+
all: SelectResult<TSelection, TSelectMode, TNullabilityMap>[];
|
|
84
|
+
get: SelectResult<TSelection, TSelectMode, TNullabilityMap> | undefined;
|
|
85
|
+
values: any[][];
|
|
86
|
+
execute: SelectResult<TSelection, TSelectMode, TNullabilityMap>[];
|
|
87
|
+
}>;
|
|
88
|
+
run: ReturnType<this['prepare']>['run'];
|
|
89
|
+
all: ReturnType<this['prepare']>['all'];
|
|
90
|
+
get: ReturnType<this['prepare']>['get'];
|
|
91
|
+
values: ReturnType<this['prepare']>['values'];
|
|
92
|
+
execute(): Promise<SelectResult<TSelection, TSelectMode, TNullabilityMap>[]>;
|
|
93
|
+
}
|
|
94
|
+
export {};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { entityKind } from '../../entity';
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
4
|
-
import
|
|
5
|
-
import type
|
|
6
|
-
import type {
|
|
7
|
-
import {
|
|
8
|
-
import type {
|
|
9
|
-
import {
|
|
10
|
-
import type {
|
|
11
|
-
import { Subquery } from '../../subquery';
|
|
12
|
-
import { type ValueOrArray } from '../../utils';
|
|
13
|
-
import { type ColumnsSelection } from '../../view';
|
|
14
|
-
import { SQLiteViewBase } from '../view';
|
|
15
|
-
import type { JoinFn, SelectedFields, SQLiteSelectConfig, SQLiteSelectHKT, SQLiteSelectHKTBase, SQLiteSelectQueryBuilderHKT } from './select.types';
|
|
1
|
+
import { entityKind } from '../../entity.js';
|
|
2
|
+
import { TypedQueryBuilder } from '../../query-builders/query-builder.js';
|
|
3
|
+
import type { BuildSubquerySelection, GetSelectTableName, GetSelectTableSelection, JoinNullability, SelectMode, SelectResult } from '../../query-builders/select.types.js';
|
|
4
|
+
import { QueryPromise } from '../../query-promise.js';
|
|
5
|
+
import { type Placeholder, type Query, SQL } from '../../sql/index.js';
|
|
6
|
+
import type { SQLiteColumn } from '../columns/index.js';
|
|
7
|
+
import type { SQLiteDialect } from '../dialect.js';
|
|
8
|
+
import type { PreparedQuery, SQLiteSession } from '../session.js';
|
|
9
|
+
import type { SubqueryWithSelection } from '../subquery.js';
|
|
10
|
+
import type { SQLiteTable } from '../table.js';
|
|
11
|
+
import { Subquery } from '../../subquery.js';
|
|
12
|
+
import { type ValueOrArray } from '../../utils.js';
|
|
13
|
+
import { type ColumnsSelection } from '../../view.js';
|
|
14
|
+
import { SQLiteViewBase } from '../view.js';
|
|
15
|
+
import type { JoinFn, SelectedFields, SQLiteSelectConfig, SQLiteSelectHKT, SQLiteSelectHKTBase, SQLiteSelectQueryBuilderHKT } from './select.types.js';
|
|
16
16
|
type CreateSQLiteSelectFromBuilderMode<TBuilderMode extends 'db' | 'qb', TTableName extends string | undefined, TResultType extends 'sync' | 'async', TRunResult, TSelection extends ColumnsSelection, TSelectMode extends SelectMode> = TBuilderMode extends 'db' ? SQLiteSelect<TTableName, TResultType, TRunResult, TSelection, TSelectMode> : SQLiteSelectQueryBuilder<SQLiteSelectQueryBuilderHKT, TTableName, TResultType, TRunResult, TSelection, TSelectMode>;
|
|
17
17
|
export declare class SQLiteSelectBuilder<TSelection extends SelectedFields | undefined, TResultType extends 'sync' | 'async', TRunResult, TBuilderMode extends 'db' | 'qb' = 'db'> {
|
|
18
18
|
static readonly [entityKind]: string;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { Placeholder, SQL } from '../../sql/index.js';
|
|
2
|
+
import type { Assume } from '../../utils.js';
|
|
3
|
+
import type { SQLiteColumn } from '../columns/index.js';
|
|
4
|
+
import type { SQLiteTable, SQLiteTableWithColumns } from '../table.js';
|
|
5
|
+
import type { SelectedFields as SelectFieldsBase, SelectedFieldsFlat as SelectFieldsFlatBase, SelectedFieldsOrdered as SelectFieldsOrderedBase } from '../../operations.js';
|
|
6
|
+
import type { AppendToNullabilityMap, AppendToResult, GetSelectTableName, JoinNullability, JoinType, MapColumnsToTableAlias, SelectMode } from '../../query-builders/select.types.js';
|
|
7
|
+
import type { Subquery } from '../../subquery.js';
|
|
8
|
+
import type { Table, UpdateTableConfig } from '../../table.js';
|
|
9
|
+
import { type ColumnsSelection, type View } from '../../view.js';
|
|
10
|
+
import type { SQLiteViewBase, SQLiteViewWithSelection } from '../view.js';
|
|
11
|
+
import type { SQLiteSelect, SQLiteSelectQueryBuilder } from './select.js';
|
|
12
|
+
export interface Join {
|
|
13
|
+
on: SQL | undefined;
|
|
14
|
+
table: SQLiteTable | Subquery | SQLiteViewBase | SQL;
|
|
15
|
+
alias: string | undefined;
|
|
16
|
+
joinType: JoinType;
|
|
17
|
+
}
|
|
18
|
+
export type AnySQLiteSelect = SQLiteSelect<any, any, any, any, any, any>;
|
|
19
|
+
export type BuildAliasTable<TTable extends SQLiteTable | View, TAlias extends string> = TTable extends Table ? SQLiteTableWithColumns<UpdateTableConfig<TTable['_']['config'], {
|
|
20
|
+
name: TAlias;
|
|
21
|
+
columns: MapColumnsToTableAlias<TTable['_']['columns'], TAlias, 'sqlite'>;
|
|
22
|
+
}>> : TTable extends View ? SQLiteViewWithSelection<TAlias, TTable['_']['existing'], MapColumnsToTableAlias<TTable['_']['selectedFields'], TAlias, 'sqlite'>> : never;
|
|
23
|
+
export interface SQLiteSelectConfig {
|
|
24
|
+
withList?: Subquery[];
|
|
25
|
+
fields: Record<string, unknown>;
|
|
26
|
+
fieldsFlat?: SelectedFieldsOrdered;
|
|
27
|
+
where?: SQL;
|
|
28
|
+
having?: SQL;
|
|
29
|
+
table: SQLiteTable | Subquery | SQLiteViewBase | SQL;
|
|
30
|
+
limit?: number | Placeholder;
|
|
31
|
+
offset?: number | Placeholder;
|
|
32
|
+
joins?: Join[];
|
|
33
|
+
orderBy?: (SQLiteColumn | SQL | SQL.Aliased)[];
|
|
34
|
+
groupBy?: (SQLiteColumn | SQL | SQL.Aliased)[];
|
|
35
|
+
distinct?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export type JoinFn<THKT extends SQLiteSelectHKTBase, TTableName extends string | undefined, TResultType extends 'sync' | 'async', TRunResult, TSelectMode extends SelectMode, TJoinType extends JoinType, TSelection, TNullabilityMap extends Record<string, JoinNullability>> = <TJoinedTable extends SQLiteTable | Subquery | SQLiteViewBase | SQL, TJoinedName extends GetSelectTableName<TJoinedTable> = GetSelectTableName<TJoinedTable>>(table: TJoinedTable, on: ((aliases: TSelection) => SQL | undefined) | SQL | undefined) => SQLiteSelectKind<THKT, TTableName, TResultType, TRunResult, AppendToResult<TTableName, TSelection, TJoinedName, TJoinedTable extends SQLiteTable ? TJoinedTable['_']['columns'] : TJoinedTable extends Subquery | View ? Assume<TJoinedTable['_']['selectedFields'], SelectedFields> : never, TSelectMode>, TSelectMode extends 'partial' ? TSelectMode : 'multiple', AppendToNullabilityMap<TNullabilityMap, TJoinedName, TJoinType>>;
|
|
38
|
+
export type SelectedFieldsFlat = SelectFieldsFlatBase<SQLiteColumn>;
|
|
39
|
+
export type SelectedFields = SelectFieldsBase<SQLiteColumn, SQLiteTable>;
|
|
40
|
+
export type SelectedFieldsOrdered = SelectFieldsOrderedBase<SQLiteColumn>;
|
|
41
|
+
export interface SQLiteSelectHKTBase {
|
|
42
|
+
tableName: string | undefined;
|
|
43
|
+
resultType: 'sync' | 'async';
|
|
44
|
+
runResult: unknown;
|
|
45
|
+
selection: unknown;
|
|
46
|
+
selectMode: SelectMode;
|
|
47
|
+
nullabilityMap: unknown;
|
|
48
|
+
_type: unknown;
|
|
49
|
+
}
|
|
50
|
+
export type SQLiteSelectKind<T extends SQLiteSelectHKTBase, TTableName extends string | undefined, TResultType extends 'sync' | 'async', TRunResult, TSelection, TSelectMode extends SelectMode, TNullabilityMap extends Record<string, JoinNullability>> = (T & {
|
|
51
|
+
tableName: TTableName;
|
|
52
|
+
resultType: TResultType;
|
|
53
|
+
runResult: TRunResult;
|
|
54
|
+
selection: TSelection;
|
|
55
|
+
selectMode: TSelectMode;
|
|
56
|
+
nullabilityMap: TNullabilityMap;
|
|
57
|
+
})['_type'];
|
|
58
|
+
export interface SQLiteSelectQueryBuilderHKT extends SQLiteSelectHKTBase {
|
|
59
|
+
_type: SQLiteSelectQueryBuilder<this, this['tableName'], this['resultType'], this['runResult'], Assume<this['selection'], ColumnsSelection>, this['selectMode'], Assume<this['nullabilityMap'], Record<string, JoinNullability>>>;
|
|
60
|
+
}
|
|
61
|
+
export interface SQLiteSelectHKT extends SQLiteSelectHKTBase {
|
|
62
|
+
_type: SQLiteSelect<this['tableName'], this['resultType'], this['runResult'], Assume<this['selection'], ColumnsSelection>, this['selectMode'], Assume<this['nullabilityMap'], Record<string, JoinNullability>>>;
|
|
63
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { Placeholder, SQL } from '../../sql/index.js';
|
|
2
|
+
import type { Assume } from '../../utils.js';
|
|
3
|
+
import type { SQLiteColumn } from '../columns/index.js';
|
|
4
|
+
import type { SQLiteTable, SQLiteTableWithColumns } from '../table.js';
|
|
5
|
+
import type { SelectedFields as SelectFieldsBase, SelectedFieldsFlat as SelectFieldsFlatBase, SelectedFieldsOrdered as SelectFieldsOrderedBase } from '../../operations.js';
|
|
6
|
+
import type { AppendToNullabilityMap, AppendToResult, GetSelectTableName, JoinNullability, JoinType, MapColumnsToTableAlias, SelectMode } from '../../query-builders/select.types.js';
|
|
7
|
+
import type { Subquery } from '../../subquery.js';
|
|
8
|
+
import type { Table, UpdateTableConfig } from '../../table.js';
|
|
9
|
+
import { type ColumnsSelection, type View } from '../../view.js';
|
|
10
|
+
import type { SQLiteViewBase, SQLiteViewWithSelection } from '../view.js';
|
|
11
|
+
import type { SQLiteSelect, SQLiteSelectQueryBuilder } from './select.js';
|
|
12
|
+
export interface Join {
|
|
13
|
+
on: SQL | undefined;
|
|
14
|
+
table: SQLiteTable | Subquery | SQLiteViewBase | SQL;
|
|
15
|
+
alias: string | undefined;
|
|
16
|
+
joinType: JoinType;
|
|
17
|
+
}
|
|
18
|
+
export type AnySQLiteSelect = SQLiteSelect<any, any, any, any, any, any>;
|
|
19
|
+
export type BuildAliasTable<TTable extends SQLiteTable | View, TAlias extends string> = TTable extends Table ? SQLiteTableWithColumns<UpdateTableConfig<TTable['_']['config'], {
|
|
20
|
+
name: TAlias;
|
|
21
|
+
columns: MapColumnsToTableAlias<TTable['_']['columns'], TAlias, 'sqlite'>;
|
|
22
|
+
}>> : TTable extends View ? SQLiteViewWithSelection<TAlias, TTable['_']['existing'], MapColumnsToTableAlias<TTable['_']['selectedFields'], TAlias, 'sqlite'>> : never;
|
|
23
|
+
export interface SQLiteSelectConfig {
|
|
24
|
+
withList?: Subquery[];
|
|
25
|
+
fields: Record<string, unknown>;
|
|
26
|
+
fieldsFlat?: SelectedFieldsOrdered;
|
|
27
|
+
where?: SQL;
|
|
28
|
+
having?: SQL;
|
|
29
|
+
table: SQLiteTable | Subquery | SQLiteViewBase | SQL;
|
|
30
|
+
limit?: number | Placeholder;
|
|
31
|
+
offset?: number | Placeholder;
|
|
32
|
+
joins?: Join[];
|
|
33
|
+
orderBy?: (SQLiteColumn | SQL | SQL.Aliased)[];
|
|
34
|
+
groupBy?: (SQLiteColumn | SQL | SQL.Aliased)[];
|
|
35
|
+
distinct?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export type JoinFn<THKT extends SQLiteSelectHKTBase, TTableName extends string | undefined, TResultType extends 'sync' | 'async', TRunResult, TSelectMode extends SelectMode, TJoinType extends JoinType, TSelection, TNullabilityMap extends Record<string, JoinNullability>> = <TJoinedTable extends SQLiteTable | Subquery | SQLiteViewBase | SQL, TJoinedName extends GetSelectTableName<TJoinedTable> = GetSelectTableName<TJoinedTable>>(table: TJoinedTable, on: ((aliases: TSelection) => SQL | undefined) | SQL | undefined) => SQLiteSelectKind<THKT, TTableName, TResultType, TRunResult, AppendToResult<TTableName, TSelection, TJoinedName, TJoinedTable extends SQLiteTable ? TJoinedTable['_']['columns'] : TJoinedTable extends Subquery | View ? Assume<TJoinedTable['_']['selectedFields'], SelectedFields> : never, TSelectMode>, TSelectMode extends 'partial' ? TSelectMode : 'multiple', AppendToNullabilityMap<TNullabilityMap, TJoinedName, TJoinType>>;
|
|
38
|
+
export type SelectedFieldsFlat = SelectFieldsFlatBase<SQLiteColumn>;
|
|
39
|
+
export type SelectedFields = SelectFieldsBase<SQLiteColumn, SQLiteTable>;
|
|
40
|
+
export type SelectedFieldsOrdered = SelectFieldsOrderedBase<SQLiteColumn>;
|
|
41
|
+
export interface SQLiteSelectHKTBase {
|
|
42
|
+
tableName: string | undefined;
|
|
43
|
+
resultType: 'sync' | 'async';
|
|
44
|
+
runResult: unknown;
|
|
45
|
+
selection: unknown;
|
|
46
|
+
selectMode: SelectMode;
|
|
47
|
+
nullabilityMap: unknown;
|
|
48
|
+
_type: unknown;
|
|
49
|
+
}
|
|
50
|
+
export type SQLiteSelectKind<T extends SQLiteSelectHKTBase, TTableName extends string | undefined, TResultType extends 'sync' | 'async', TRunResult, TSelection, TSelectMode extends SelectMode, TNullabilityMap extends Record<string, JoinNullability>> = (T & {
|
|
51
|
+
tableName: TTableName;
|
|
52
|
+
resultType: TResultType;
|
|
53
|
+
runResult: TRunResult;
|
|
54
|
+
selection: TSelection;
|
|
55
|
+
selectMode: TSelectMode;
|
|
56
|
+
nullabilityMap: TNullabilityMap;
|
|
57
|
+
})['_type'];
|
|
58
|
+
export interface SQLiteSelectQueryBuilderHKT extends SQLiteSelectHKTBase {
|
|
59
|
+
_type: SQLiteSelectQueryBuilder<this, this['tableName'], this['resultType'], this['runResult'], Assume<this['selection'], ColumnsSelection>, this['selectMode'], Assume<this['nullabilityMap'], Record<string, JoinNullability>>>;
|
|
60
|
+
}
|
|
61
|
+
export interface SQLiteSelectHKT extends SQLiteSelectHKTBase {
|
|
62
|
+
_type: SQLiteSelect<this['tableName'], this['resultType'], this['runResult'], Assume<this['selection'], ColumnsSelection>, this['selectMode'], Assume<this['nullabilityMap'], Record<string, JoinNullability>>>;
|
|
63
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { Placeholder, SQL } from '../../sql';
|
|
2
|
-
import type { Assume } from '../../utils';
|
|
3
|
-
import type { SQLiteColumn } from '../columns';
|
|
4
|
-
import type { SQLiteTable, SQLiteTableWithColumns } from '../table';
|
|
5
|
-
import type { SelectedFields as SelectFieldsBase, SelectedFieldsFlat as SelectFieldsFlatBase, SelectedFieldsOrdered as SelectFieldsOrderedBase } from '../../operations';
|
|
6
|
-
import type { AppendToNullabilityMap, AppendToResult, GetSelectTableName, JoinNullability, JoinType, MapColumnsToTableAlias, SelectMode } from '../../query-builders/select.types';
|
|
7
|
-
import type { Subquery } from '../../subquery';
|
|
8
|
-
import type { Table, UpdateTableConfig } from '../../table';
|
|
9
|
-
import { type ColumnsSelection, type View } from '../../view';
|
|
10
|
-
import type { SQLiteViewBase, SQLiteViewWithSelection } from '../view';
|
|
11
|
-
import type { SQLiteSelect, SQLiteSelectQueryBuilder } from './select';
|
|
1
|
+
import type { Placeholder, SQL } from '../../sql/index.js';
|
|
2
|
+
import type { Assume } from '../../utils.js';
|
|
3
|
+
import type { SQLiteColumn } from '../columns/index.js';
|
|
4
|
+
import type { SQLiteTable, SQLiteTableWithColumns } from '../table.js';
|
|
5
|
+
import type { SelectedFields as SelectFieldsBase, SelectedFieldsFlat as SelectFieldsFlatBase, SelectedFieldsOrdered as SelectFieldsOrderedBase } from '../../operations.js';
|
|
6
|
+
import type { AppendToNullabilityMap, AppendToResult, GetSelectTableName, JoinNullability, JoinType, MapColumnsToTableAlias, SelectMode } from '../../query-builders/select.types.js';
|
|
7
|
+
import type { Subquery } from '../../subquery.js';
|
|
8
|
+
import type { Table, UpdateTableConfig } from '../../table.js';
|
|
9
|
+
import { type ColumnsSelection, type View } from '../../view.js';
|
|
10
|
+
import type { SQLiteViewBase, SQLiteViewWithSelection } from '../view.js';
|
|
11
|
+
import type { SQLiteSelect, SQLiteSelectQueryBuilder } from './select.js';
|
|
12
12
|
export interface Join {
|
|
13
13
|
on: SQL | undefined;
|
|
14
14
|
table: SQLiteTable | Subquery | SQLiteViewBase | SQL;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { GetColumnData } from '../../column.js';
|
|
2
|
+
import { entityKind } from '../../entity.js';
|
|
3
|
+
import type { SelectResultFields } from '../../query-builders/select.types.js';
|
|
4
|
+
import { QueryPromise } from '../../query-promise.js';
|
|
5
|
+
import type { Query, SQL, SQLWrapper } from '../../sql/index.js';
|
|
6
|
+
import type { SQLiteDialect } from '../dialect.js';
|
|
7
|
+
import type { PreparedQuery, SQLiteSession } from '../session.js';
|
|
8
|
+
import { SQLiteTable } from '../table.js';
|
|
9
|
+
import type { InferModel } from '../../table.js';
|
|
10
|
+
import { type DrizzleTypeError, type UpdateSet } from '../../utils.js';
|
|
11
|
+
import type { SelectedFields, SelectedFieldsOrdered } from './select.types.js';
|
|
12
|
+
export interface SQLiteUpdateConfig {
|
|
13
|
+
where?: SQL | undefined;
|
|
14
|
+
set: UpdateSet;
|
|
15
|
+
table: SQLiteTable;
|
|
16
|
+
returning?: SelectedFieldsOrdered;
|
|
17
|
+
}
|
|
18
|
+
export type SQLiteUpdateSetSource<TTable extends SQLiteTable> = {
|
|
19
|
+
[Key in keyof TTable['_']['columns']]?: GetColumnData<TTable['_']['columns'][Key], 'query'> | SQL;
|
|
20
|
+
} & {};
|
|
21
|
+
export declare class SQLiteUpdateBuilder<TTable extends SQLiteTable, TResultType extends 'sync' | 'async', TRunResult> {
|
|
22
|
+
protected table: TTable;
|
|
23
|
+
protected session: SQLiteSession<any, any, any, any>;
|
|
24
|
+
protected dialect: SQLiteDialect;
|
|
25
|
+
static readonly [entityKind]: string;
|
|
26
|
+
readonly _: {
|
|
27
|
+
readonly table: TTable;
|
|
28
|
+
};
|
|
29
|
+
constructor(table: TTable, session: SQLiteSession<any, any, any, any>, dialect: SQLiteDialect);
|
|
30
|
+
set(values: SQLiteUpdateSetSource<TTable>): SQLiteUpdate<TTable, TResultType, TRunResult>;
|
|
31
|
+
}
|
|
32
|
+
export interface SQLiteUpdate<TTable extends SQLiteTable, TResultType extends 'sync' | 'async', TRunResult, TReturning = undefined> extends SQLWrapper, QueryPromise<TReturning extends undefined ? TRunResult : TReturning[]> {
|
|
33
|
+
}
|
|
34
|
+
export declare class SQLiteUpdate<TTable extends SQLiteTable, TResultType extends 'sync' | 'async', TRunResult, TReturning = undefined> extends QueryPromise<TReturning extends undefined ? TRunResult : TReturning[]> implements SQLWrapper {
|
|
35
|
+
private session;
|
|
36
|
+
private dialect;
|
|
37
|
+
static readonly [entityKind]: string;
|
|
38
|
+
readonly _: {
|
|
39
|
+
readonly table: TTable;
|
|
40
|
+
};
|
|
41
|
+
private config;
|
|
42
|
+
constructor(table: TTable, set: UpdateSet, session: SQLiteSession<any, any, any, any>, dialect: SQLiteDialect);
|
|
43
|
+
where(where: SQL | undefined): Omit<this, 'where'>;
|
|
44
|
+
returning(): SQLiteUpdate<TTable, TResultType, TRunResult, InferModel<TTable>>;
|
|
45
|
+
returning<TSelectedFields extends SelectedFields>(fields: TSelectedFields): SQLiteUpdate<TTable, TResultType, TRunResult, SelectResultFields<TSelectedFields>>;
|
|
46
|
+
toSQL(): {
|
|
47
|
+
sql: Query['sql'];
|
|
48
|
+
params: Query['params'];
|
|
49
|
+
};
|
|
50
|
+
prepare(isOneTimeQuery?: boolean): PreparedQuery<{
|
|
51
|
+
type: TResultType;
|
|
52
|
+
run: TRunResult;
|
|
53
|
+
all: TReturning extends undefined ? DrizzleTypeError<'.all() cannot be used without .returning()'> : TReturning[];
|
|
54
|
+
get: TReturning extends undefined ? DrizzleTypeError<'.get() cannot be used without .returning()'> : TReturning;
|
|
55
|
+
values: TReturning extends undefined ? DrizzleTypeError<'.values() cannot be used without .returning()'> : any[][];
|
|
56
|
+
execute: TReturning extends undefined ? TRunResult : TReturning[];
|
|
57
|
+
}>;
|
|
58
|
+
run: ReturnType<this['prepare']>['run'];
|
|
59
|
+
all: ReturnType<this['prepare']>['all'];
|
|
60
|
+
get: ReturnType<this['prepare']>['get'];
|
|
61
|
+
values: ReturnType<this['prepare']>['values'];
|
|
62
|
+
execute(): Promise<TReturning extends undefined ? TRunResult : TReturning[]>;
|
|
63
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { GetColumnData } from '../../column.js';
|
|
2
|
+
import { entityKind } from '../../entity.js';
|
|
3
|
+
import type { SelectResultFields } from '../../query-builders/select.types.js';
|
|
4
|
+
import { QueryPromise } from '../../query-promise.js';
|
|
5
|
+
import type { Query, SQL, SQLWrapper } from '../../sql/index.js';
|
|
6
|
+
import type { SQLiteDialect } from '../dialect.js';
|
|
7
|
+
import type { PreparedQuery, SQLiteSession } from '../session.js';
|
|
8
|
+
import { SQLiteTable } from '../table.js';
|
|
9
|
+
import type { InferModel } from '../../table.js';
|
|
10
|
+
import { type DrizzleTypeError, type UpdateSet } from '../../utils.js';
|
|
11
|
+
import type { SelectedFields, SelectedFieldsOrdered } from './select.types.js';
|
|
12
|
+
export interface SQLiteUpdateConfig {
|
|
13
|
+
where?: SQL | undefined;
|
|
14
|
+
set: UpdateSet;
|
|
15
|
+
table: SQLiteTable;
|
|
16
|
+
returning?: SelectedFieldsOrdered;
|
|
17
|
+
}
|
|
18
|
+
export type SQLiteUpdateSetSource<TTable extends SQLiteTable> = {
|
|
19
|
+
[Key in keyof TTable['_']['columns']]?: GetColumnData<TTable['_']['columns'][Key], 'query'> | SQL;
|
|
20
|
+
} & {};
|
|
21
|
+
export declare class SQLiteUpdateBuilder<TTable extends SQLiteTable, TResultType extends 'sync' | 'async', TRunResult> {
|
|
22
|
+
protected table: TTable;
|
|
23
|
+
protected session: SQLiteSession<any, any, any, any>;
|
|
24
|
+
protected dialect: SQLiteDialect;
|
|
25
|
+
static readonly [entityKind]: string;
|
|
26
|
+
readonly _: {
|
|
27
|
+
readonly table: TTable;
|
|
28
|
+
};
|
|
29
|
+
constructor(table: TTable, session: SQLiteSession<any, any, any, any>, dialect: SQLiteDialect);
|
|
30
|
+
set(values: SQLiteUpdateSetSource<TTable>): SQLiteUpdate<TTable, TResultType, TRunResult>;
|
|
31
|
+
}
|
|
32
|
+
export interface SQLiteUpdate<TTable extends SQLiteTable, TResultType extends 'sync' | 'async', TRunResult, TReturning = undefined> extends SQLWrapper, QueryPromise<TReturning extends undefined ? TRunResult : TReturning[]> {
|
|
33
|
+
}
|
|
34
|
+
export declare class SQLiteUpdate<TTable extends SQLiteTable, TResultType extends 'sync' | 'async', TRunResult, TReturning = undefined> extends QueryPromise<TReturning extends undefined ? TRunResult : TReturning[]> implements SQLWrapper {
|
|
35
|
+
private session;
|
|
36
|
+
private dialect;
|
|
37
|
+
static readonly [entityKind]: string;
|
|
38
|
+
readonly _: {
|
|
39
|
+
readonly table: TTable;
|
|
40
|
+
};
|
|
41
|
+
private config;
|
|
42
|
+
constructor(table: TTable, set: UpdateSet, session: SQLiteSession<any, any, any, any>, dialect: SQLiteDialect);
|
|
43
|
+
where(where: SQL | undefined): Omit<this, 'where'>;
|
|
44
|
+
returning(): SQLiteUpdate<TTable, TResultType, TRunResult, InferModel<TTable>>;
|
|
45
|
+
returning<TSelectedFields extends SelectedFields>(fields: TSelectedFields): SQLiteUpdate<TTable, TResultType, TRunResult, SelectResultFields<TSelectedFields>>;
|
|
46
|
+
toSQL(): {
|
|
47
|
+
sql: Query['sql'];
|
|
48
|
+
params: Query['params'];
|
|
49
|
+
};
|
|
50
|
+
prepare(isOneTimeQuery?: boolean): PreparedQuery<{
|
|
51
|
+
type: TResultType;
|
|
52
|
+
run: TRunResult;
|
|
53
|
+
all: TReturning extends undefined ? DrizzleTypeError<'.all() cannot be used without .returning()'> : TReturning[];
|
|
54
|
+
get: TReturning extends undefined ? DrizzleTypeError<'.get() cannot be used without .returning()'> : TReturning;
|
|
55
|
+
values: TReturning extends undefined ? DrizzleTypeError<'.values() cannot be used without .returning()'> : any[][];
|
|
56
|
+
execute: TReturning extends undefined ? TRunResult : TReturning[];
|
|
57
|
+
}>;
|
|
58
|
+
run: ReturnType<this['prepare']>['run'];
|
|
59
|
+
all: ReturnType<this['prepare']>['all'];
|
|
60
|
+
get: ReturnType<this['prepare']>['get'];
|
|
61
|
+
values: ReturnType<this['prepare']>['values'];
|
|
62
|
+
execute(): Promise<TReturning extends undefined ? TRunResult : TReturning[]>;
|
|
63
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { GetColumnData } from '../../column';
|
|
2
|
-
import { entityKind } from '../../entity';
|
|
3
|
-
import type { SelectResultFields } from '../../query-builders/select.types';
|
|
4
|
-
import { QueryPromise } from '../../query-promise';
|
|
5
|
-
import type { Query, SQL, SQLWrapper } from '../../sql';
|
|
6
|
-
import type { SQLiteDialect } from '../dialect';
|
|
7
|
-
import type { PreparedQuery, SQLiteSession } from '../session';
|
|
8
|
-
import { SQLiteTable } from '../table';
|
|
9
|
-
import type { InferModel } from '../../table';
|
|
10
|
-
import { type DrizzleTypeError, type UpdateSet } from '../../utils';
|
|
11
|
-
import type { SelectedFields, SelectedFieldsOrdered } from './select.types';
|
|
1
|
+
import type { GetColumnData } from '../../column.js';
|
|
2
|
+
import { entityKind } from '../../entity.js';
|
|
3
|
+
import type { SelectResultFields } from '../../query-builders/select.types.js';
|
|
4
|
+
import { QueryPromise } from '../../query-promise.js';
|
|
5
|
+
import type { Query, SQL, SQLWrapper } from '../../sql/index.js';
|
|
6
|
+
import type { SQLiteDialect } from '../dialect.js';
|
|
7
|
+
import type { PreparedQuery, SQLiteSession } from '../session.js';
|
|
8
|
+
import { SQLiteTable } from '../table.js';
|
|
9
|
+
import type { InferModel } from '../../table.js';
|
|
10
|
+
import { type DrizzleTypeError, type UpdateSet } from '../../utils.js';
|
|
11
|
+
import type { SelectedFields, SelectedFieldsOrdered } from './select.types.js';
|
|
12
12
|
export interface SQLiteUpdateConfig {
|
|
13
13
|
where?: SQL | undefined;
|
|
14
14
|
set: UpdateSet;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { entityKind } from '../entity.js';
|
|
2
|
+
import { type TablesRelationalConfig } from '../relations.js';
|
|
3
|
+
import type { Query, SQL } from '../sql/index.js';
|
|
4
|
+
import type { SQLiteAsyncDialect, SQLiteSyncDialect } from './dialect.js';
|
|
5
|
+
import { QueryPromise } from '../index.js';
|
|
6
|
+
import { BaseSQLiteDatabase } from './db.js';
|
|
7
|
+
import type { SelectedFieldsOrdered } from './query-builders/select.types.js';
|
|
8
|
+
export interface PreparedQueryConfig {
|
|
9
|
+
type: 'sync' | 'async';
|
|
10
|
+
run: unknown;
|
|
11
|
+
all: unknown;
|
|
12
|
+
get: unknown;
|
|
13
|
+
values: unknown;
|
|
14
|
+
execute: unknown;
|
|
15
|
+
}
|
|
16
|
+
export declare class ExecuteResultSync<T> extends QueryPromise<T> {
|
|
17
|
+
private resultCb;
|
|
18
|
+
static readonly [entityKind]: string;
|
|
19
|
+
constructor(resultCb: () => T);
|
|
20
|
+
execute(): Promise<T>;
|
|
21
|
+
sync(): T;
|
|
22
|
+
}
|
|
23
|
+
export type ExecuteResult<TType extends 'sync' | 'async', TResult> = TType extends 'async' ? Promise<TResult> : ExecuteResultSync<TResult>;
|
|
24
|
+
export declare abstract class PreparedQuery<T extends PreparedQueryConfig> {
|
|
25
|
+
private mode;
|
|
26
|
+
private executeMethod;
|
|
27
|
+
static readonly [entityKind]: string;
|
|
28
|
+
constructor(mode: 'sync' | 'async', executeMethod: SQLiteExecuteMethod);
|
|
29
|
+
abstract run(placeholderValues?: Record<string, unknown>): Result<T['type'], T['run']>;
|
|
30
|
+
abstract all(placeholderValues?: Record<string, unknown>): Result<T['type'], T['all']>;
|
|
31
|
+
abstract get(placeholderValues?: Record<string, unknown>): Result<T['type'], T['get']>;
|
|
32
|
+
abstract values(placeholderValues?: Record<string, unknown>): Result<T['type'], T['values']>;
|
|
33
|
+
execute(placeholderValues?: Record<string, unknown>): ExecuteResult<T['type'], T['execute']>;
|
|
34
|
+
}
|
|
35
|
+
export interface SQLiteTransactionConfig {
|
|
36
|
+
behavior?: 'deferred' | 'immediate' | 'exclusive';
|
|
37
|
+
}
|
|
38
|
+
export type SQLiteExecuteMethod = 'run' | 'all' | 'get';
|
|
39
|
+
export declare abstract class SQLiteSession<TResultKind extends 'sync' | 'async', TRunResult, TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> {
|
|
40
|
+
static readonly [entityKind]: string;
|
|
41
|
+
constructor(
|
|
42
|
+
/** @internal */
|
|
43
|
+
dialect: {
|
|
44
|
+
sync: SQLiteSyncDialect;
|
|
45
|
+
async: SQLiteAsyncDialect;
|
|
46
|
+
}[TResultKind]);
|
|
47
|
+
abstract prepareQuery(query: Query, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, customResultMapper?: (rows: unknown[][], mapColumnValue?: (value: unknown) => unknown) => unknown): PreparedQuery<PreparedQueryConfig & {
|
|
48
|
+
type: TResultKind;
|
|
49
|
+
}>;
|
|
50
|
+
prepareOneTimeQuery(query: Query, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod): PreparedQuery<PreparedQueryConfig & {
|
|
51
|
+
type: TResultKind;
|
|
52
|
+
}>;
|
|
53
|
+
abstract transaction<T>(transaction: (tx: SQLiteTransaction<TResultKind, TRunResult, TFullSchema, TSchema>) => Result<TResultKind, T>, config?: SQLiteTransactionConfig): Result<TResultKind, T>;
|
|
54
|
+
run(query: SQL): Result<TResultKind, TRunResult>;
|
|
55
|
+
all<T = unknown>(query: SQL): Result<TResultKind, T[]>;
|
|
56
|
+
get<T = unknown>(query: SQL): Result<TResultKind, T>;
|
|
57
|
+
values<T extends any[] = unknown[]>(query: SQL): Result<TResultKind, T[]>;
|
|
58
|
+
}
|
|
59
|
+
interface ResultHKT {
|
|
60
|
+
readonly $brand: 'SQLiteResultHKT';
|
|
61
|
+
readonly config: unknown;
|
|
62
|
+
readonly type: unknown;
|
|
63
|
+
}
|
|
64
|
+
interface SyncResultHKT extends ResultHKT {
|
|
65
|
+
readonly type: this['config'];
|
|
66
|
+
}
|
|
67
|
+
interface AsyncResultHKT extends ResultHKT {
|
|
68
|
+
readonly type: Promise<this['config']>;
|
|
69
|
+
}
|
|
70
|
+
export type Result<TKind extends 'sync' | 'async', TResult> = (('sync' extends TKind ? SyncResultHKT : AsyncResultHKT) & {
|
|
71
|
+
readonly config: TResult;
|
|
72
|
+
})['type'];
|
|
73
|
+
export declare abstract class SQLiteTransaction<TResultType extends 'sync' | 'async', TRunResult, TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> extends BaseSQLiteDatabase<TResultType, TRunResult, TFullSchema, TSchema> {
|
|
74
|
+
protected schema: {
|
|
75
|
+
fullSchema: Record<string, unknown>;
|
|
76
|
+
schema: TSchema;
|
|
77
|
+
tableNamesMap: Record<string, string>;
|
|
78
|
+
} | undefined;
|
|
79
|
+
protected readonly nestedIndex: number;
|
|
80
|
+
static readonly [entityKind]: string;
|
|
81
|
+
constructor(resultType: TResultType, dialect: {
|
|
82
|
+
sync: SQLiteSyncDialect;
|
|
83
|
+
async: SQLiteAsyncDialect;
|
|
84
|
+
}[TResultType], session: SQLiteSession<TResultType, TRunResult, TFullSchema, TSchema>, schema: {
|
|
85
|
+
fullSchema: Record<string, unknown>;
|
|
86
|
+
schema: TSchema;
|
|
87
|
+
tableNamesMap: Record<string, string>;
|
|
88
|
+
} | undefined, nestedIndex?: number);
|
|
89
|
+
rollback(): never;
|
|
90
|
+
}
|
|
91
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { entityKind } from '../entity.js';
|
|
2
|
+
import { type TablesRelationalConfig } from '../relations.js';
|
|
3
|
+
import type { Query, SQL } from '../sql/index.js';
|
|
4
|
+
import type { SQLiteAsyncDialect, SQLiteSyncDialect } from './dialect.js';
|
|
5
|
+
import { QueryPromise } from '../index.js';
|
|
6
|
+
import { BaseSQLiteDatabase } from './db.js';
|
|
7
|
+
import type { SelectedFieldsOrdered } from './query-builders/select.types.js';
|
|
8
|
+
export interface PreparedQueryConfig {
|
|
9
|
+
type: 'sync' | 'async';
|
|
10
|
+
run: unknown;
|
|
11
|
+
all: unknown;
|
|
12
|
+
get: unknown;
|
|
13
|
+
values: unknown;
|
|
14
|
+
execute: unknown;
|
|
15
|
+
}
|
|
16
|
+
export declare class ExecuteResultSync<T> extends QueryPromise<T> {
|
|
17
|
+
private resultCb;
|
|
18
|
+
static readonly [entityKind]: string;
|
|
19
|
+
constructor(resultCb: () => T);
|
|
20
|
+
execute(): Promise<T>;
|
|
21
|
+
sync(): T;
|
|
22
|
+
}
|
|
23
|
+
export type ExecuteResult<TType extends 'sync' | 'async', TResult> = TType extends 'async' ? Promise<TResult> : ExecuteResultSync<TResult>;
|
|
24
|
+
export declare abstract class PreparedQuery<T extends PreparedQueryConfig> {
|
|
25
|
+
private mode;
|
|
26
|
+
private executeMethod;
|
|
27
|
+
static readonly [entityKind]: string;
|
|
28
|
+
constructor(mode: 'sync' | 'async', executeMethod: SQLiteExecuteMethod);
|
|
29
|
+
abstract run(placeholderValues?: Record<string, unknown>): Result<T['type'], T['run']>;
|
|
30
|
+
abstract all(placeholderValues?: Record<string, unknown>): Result<T['type'], T['all']>;
|
|
31
|
+
abstract get(placeholderValues?: Record<string, unknown>): Result<T['type'], T['get']>;
|
|
32
|
+
abstract values(placeholderValues?: Record<string, unknown>): Result<T['type'], T['values']>;
|
|
33
|
+
execute(placeholderValues?: Record<string, unknown>): ExecuteResult<T['type'], T['execute']>;
|
|
34
|
+
}
|
|
35
|
+
export interface SQLiteTransactionConfig {
|
|
36
|
+
behavior?: 'deferred' | 'immediate' | 'exclusive';
|
|
37
|
+
}
|
|
38
|
+
export type SQLiteExecuteMethod = 'run' | 'all' | 'get';
|
|
39
|
+
export declare abstract class SQLiteSession<TResultKind extends 'sync' | 'async', TRunResult, TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> {
|
|
40
|
+
static readonly [entityKind]: string;
|
|
41
|
+
constructor(
|
|
42
|
+
/** @internal */
|
|
43
|
+
dialect: {
|
|
44
|
+
sync: SQLiteSyncDialect;
|
|
45
|
+
async: SQLiteAsyncDialect;
|
|
46
|
+
}[TResultKind]);
|
|
47
|
+
abstract prepareQuery(query: Query, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, customResultMapper?: (rows: unknown[][], mapColumnValue?: (value: unknown) => unknown) => unknown): PreparedQuery<PreparedQueryConfig & {
|
|
48
|
+
type: TResultKind;
|
|
49
|
+
}>;
|
|
50
|
+
prepareOneTimeQuery(query: Query, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod): PreparedQuery<PreparedQueryConfig & {
|
|
51
|
+
type: TResultKind;
|
|
52
|
+
}>;
|
|
53
|
+
abstract transaction<T>(transaction: (tx: SQLiteTransaction<TResultKind, TRunResult, TFullSchema, TSchema>) => Result<TResultKind, T>, config?: SQLiteTransactionConfig): Result<TResultKind, T>;
|
|
54
|
+
run(query: SQL): Result<TResultKind, TRunResult>;
|
|
55
|
+
all<T = unknown>(query: SQL): Result<TResultKind, T[]>;
|
|
56
|
+
get<T = unknown>(query: SQL): Result<TResultKind, T>;
|
|
57
|
+
values<T extends any[] = unknown[]>(query: SQL): Result<TResultKind, T[]>;
|
|
58
|
+
}
|
|
59
|
+
interface ResultHKT {
|
|
60
|
+
readonly $brand: 'SQLiteResultHKT';
|
|
61
|
+
readonly config: unknown;
|
|
62
|
+
readonly type: unknown;
|
|
63
|
+
}
|
|
64
|
+
interface SyncResultHKT extends ResultHKT {
|
|
65
|
+
readonly type: this['config'];
|
|
66
|
+
}
|
|
67
|
+
interface AsyncResultHKT extends ResultHKT {
|
|
68
|
+
readonly type: Promise<this['config']>;
|
|
69
|
+
}
|
|
70
|
+
export type Result<TKind extends 'sync' | 'async', TResult> = (('sync' extends TKind ? SyncResultHKT : AsyncResultHKT) & {
|
|
71
|
+
readonly config: TResult;
|
|
72
|
+
})['type'];
|
|
73
|
+
export declare abstract class SQLiteTransaction<TResultType extends 'sync' | 'async', TRunResult, TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> extends BaseSQLiteDatabase<TResultType, TRunResult, TFullSchema, TSchema> {
|
|
74
|
+
protected schema: {
|
|
75
|
+
fullSchema: Record<string, unknown>;
|
|
76
|
+
schema: TSchema;
|
|
77
|
+
tableNamesMap: Record<string, string>;
|
|
78
|
+
} | undefined;
|
|
79
|
+
protected readonly nestedIndex: number;
|
|
80
|
+
static readonly [entityKind]: string;
|
|
81
|
+
constructor(resultType: TResultType, dialect: {
|
|
82
|
+
sync: SQLiteSyncDialect;
|
|
83
|
+
async: SQLiteAsyncDialect;
|
|
84
|
+
}[TResultType], session: SQLiteSession<TResultType, TRunResult, TFullSchema, TSchema>, schema: {
|
|
85
|
+
fullSchema: Record<string, unknown>;
|
|
86
|
+
schema: TSchema;
|
|
87
|
+
tableNamesMap: Record<string, string>;
|
|
88
|
+
} | undefined, nestedIndex?: number);
|
|
89
|
+
rollback(): never;
|
|
90
|
+
}
|
|
91
|
+
export {};
|