drizzle-orm 1.0.0-beta.1-84d9a79 → 1.0.0-beta.1-d407048
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/aws-data-api/common/index.d.cts +1 -1
- package/aws-data-api/common/index.d.ts +1 -1
- package/aws-data-api/pg/driver.cjs +1 -1
- package/aws-data-api/pg/driver.cjs.map +1 -1
- package/aws-data-api/pg/driver.js +1 -1
- package/aws-data-api/pg/driver.js.map +1 -1
- package/aws-data-api/pg/session.cjs.map +1 -1
- package/aws-data-api/pg/session.d.cts +6 -6
- package/aws-data-api/pg/session.d.ts +6 -6
- package/aws-data-api/pg/session.js.map +1 -1
- package/better-sqlite3/driver.cjs +1 -1
- package/better-sqlite3/driver.cjs.map +1 -1
- package/better-sqlite3/driver.js +1 -1
- package/better-sqlite3/driver.js.map +1 -1
- package/better-sqlite3/session.cjs.map +1 -1
- package/better-sqlite3/session.d.cts +6 -6
- package/better-sqlite3/session.d.ts +6 -6
- package/better-sqlite3/session.js.map +1 -1
- package/bun-sql/driver.cjs +1 -1
- package/bun-sql/driver.cjs.map +1 -1
- package/bun-sql/driver.js +1 -1
- package/bun-sql/driver.js.map +1 -1
- package/bun-sql/migrator.cjs.map +1 -1
- package/bun-sql/migrator.d.cts +2 -2
- package/bun-sql/migrator.d.ts +2 -2
- package/bun-sql/migrator.js.map +1 -1
- package/bun-sql/session.cjs.map +1 -1
- package/bun-sql/session.d.cts +7 -7
- package/bun-sql/session.d.ts +7 -7
- package/bun-sql/session.js.map +1 -1
- package/bun-sqlite/driver.cjs +1 -1
- package/bun-sqlite/driver.cjs.map +1 -1
- package/bun-sqlite/driver.js +1 -1
- package/bun-sqlite/driver.js.map +1 -1
- package/bun-sqlite/session.cjs.map +1 -1
- package/bun-sqlite/session.d.cts +6 -6
- package/bun-sqlite/session.d.ts +6 -6
- package/bun-sqlite/session.js.map +1 -1
- package/column-builder.cjs +9 -2
- package/column-builder.cjs.map +1 -1
- package/column-builder.d.cts +50 -65
- package/column-builder.d.ts +50 -65
- package/column-builder.js +7 -1
- package/column-builder.js.map +1 -1
- package/column.cjs +37 -21
- package/column.cjs.map +1 -1
- package/column.d.cts +20 -32
- package/column.d.ts +20 -32
- package/column.js +35 -20
- package/column.js.map +1 -1
- package/d1/driver.cjs +1 -1
- package/d1/driver.cjs.map +1 -1
- package/d1/driver.js +1 -1
- package/d1/driver.js.map +1 -1
- package/d1/session.cjs.map +1 -1
- package/d1/session.d.cts +6 -6
- package/d1/session.d.ts +6 -6
- package/d1/session.js.map +1 -1
- package/durable-sqlite/driver.cjs +1 -1
- package/durable-sqlite/driver.cjs.map +1 -1
- package/durable-sqlite/driver.js +1 -1
- package/durable-sqlite/driver.js.map +1 -1
- package/durable-sqlite/session.cjs.map +1 -1
- package/durable-sqlite/session.d.cts +6 -6
- package/durable-sqlite/session.d.ts +6 -6
- package/durable-sqlite/session.js.map +1 -1
- package/expo-sqlite/driver.cjs +1 -1
- package/expo-sqlite/driver.cjs.map +1 -1
- package/expo-sqlite/driver.js +1 -1
- package/expo-sqlite/driver.js.map +1 -1
- package/expo-sqlite/session.cjs.map +1 -1
- package/expo-sqlite/session.d.cts +6 -6
- package/expo-sqlite/session.d.ts +6 -6
- package/expo-sqlite/session.js.map +1 -1
- package/gel/driver.cjs +1 -1
- package/gel/driver.cjs.map +1 -1
- package/gel/driver.d.cts +2 -2
- package/gel/driver.d.ts +2 -2
- package/gel/driver.js +1 -1
- package/gel/driver.js.map +1 -1
- package/gel/session.cjs.map +1 -1
- package/gel/session.d.cts +6 -6
- package/gel/session.d.ts +6 -6
- package/gel/session.js.map +1 -1
- package/gel-core/columns/bigint.cjs +1 -1
- package/gel-core/columns/bigint.cjs.map +1 -1
- package/gel-core/columns/bigint.d.cts +7 -12
- package/gel-core/columns/bigint.d.ts +7 -12
- package/gel-core/columns/bigint.js +1 -1
- package/gel-core/columns/bigint.js.map +1 -1
- package/gel-core/columns/bigintT.cjs +1 -1
- package/gel-core/columns/bigintT.cjs.map +1 -1
- package/gel-core/columns/bigintT.d.cts +7 -12
- package/gel-core/columns/bigintT.d.ts +7 -12
- package/gel-core/columns/bigintT.js +1 -1
- package/gel-core/columns/bigintT.js.map +1 -1
- package/gel-core/columns/boolean.cjs.map +1 -1
- package/gel-core/columns/boolean.d.cts +6 -11
- package/gel-core/columns/boolean.d.ts +6 -11
- package/gel-core/columns/boolean.js.map +1 -1
- package/gel-core/columns/bytes.cjs +1 -1
- package/gel-core/columns/bytes.cjs.map +1 -1
- package/gel-core/columns/bytes.d.cts +7 -12
- package/gel-core/columns/bytes.d.ts +7 -12
- package/gel-core/columns/bytes.js +1 -1
- package/gel-core/columns/bytes.js.map +1 -1
- package/gel-core/columns/common.cjs +9 -9
- package/gel-core/columns/common.cjs.map +1 -1
- package/gel-core/columns/common.d.cts +24 -41
- package/gel-core/columns/common.d.ts +24 -41
- package/gel-core/columns/common.js +9 -9
- package/gel-core/columns/common.js.map +1 -1
- package/gel-core/columns/custom.cjs.map +1 -1
- package/gel-core/columns/custom.d.cts +10 -14
- package/gel-core/columns/custom.d.ts +10 -14
- package/gel-core/columns/custom.js.map +1 -1
- package/gel-core/columns/date-duration.cjs +1 -1
- package/gel-core/columns/date-duration.cjs.map +1 -1
- package/gel-core/columns/date-duration.d.cts +7 -12
- package/gel-core/columns/date-duration.d.ts +7 -12
- package/gel-core/columns/date-duration.js +1 -1
- package/gel-core/columns/date-duration.js.map +1 -1
- package/gel-core/columns/date.common.cjs.map +1 -1
- package/gel-core/columns/date.common.d.cts +2 -2
- package/gel-core/columns/date.common.d.ts +2 -2
- package/gel-core/columns/date.common.js.map +1 -1
- package/gel-core/columns/decimal.cjs +1 -1
- package/gel-core/columns/decimal.cjs.map +1 -1
- package/gel-core/columns/decimal.d.cts +8 -13
- package/gel-core/columns/decimal.d.ts +8 -13
- package/gel-core/columns/decimal.js +1 -1
- package/gel-core/columns/decimal.js.map +1 -1
- package/gel-core/columns/double-precision.cjs +1 -1
- package/gel-core/columns/double-precision.cjs.map +1 -1
- package/gel-core/columns/double-precision.d.cts +7 -12
- package/gel-core/columns/double-precision.d.ts +7 -12
- package/gel-core/columns/double-precision.js +1 -1
- package/gel-core/columns/double-precision.js.map +1 -1
- package/gel-core/columns/duration.cjs +1 -1
- package/gel-core/columns/duration.cjs.map +1 -1
- package/gel-core/columns/duration.d.cts +7 -12
- package/gel-core/columns/duration.d.ts +7 -12
- package/gel-core/columns/duration.js +1 -1
- package/gel-core/columns/duration.js.map +1 -1
- package/gel-core/columns/int.common.cjs.map +1 -1
- package/gel-core/columns/int.common.d.cts +2 -2
- package/gel-core/columns/int.common.d.ts +2 -2
- package/gel-core/columns/int.common.js.map +1 -1
- package/gel-core/columns/integer.cjs +1 -1
- package/gel-core/columns/integer.cjs.map +1 -1
- package/gel-core/columns/integer.d.cts +7 -12
- package/gel-core/columns/integer.d.ts +7 -12
- package/gel-core/columns/integer.js +1 -1
- package/gel-core/columns/integer.js.map +1 -1
- package/gel-core/columns/json.cjs +1 -1
- package/gel-core/columns/json.cjs.map +1 -1
- package/gel-core/columns/json.d.cts +8 -13
- package/gel-core/columns/json.d.ts +8 -13
- package/gel-core/columns/json.js +1 -1
- package/gel-core/columns/json.js.map +1 -1
- package/gel-core/columns/localdate.cjs +1 -1
- package/gel-core/columns/localdate.cjs.map +1 -1
- package/gel-core/columns/localdate.d.cts +7 -12
- package/gel-core/columns/localdate.d.ts +7 -12
- package/gel-core/columns/localdate.js +1 -1
- package/gel-core/columns/localdate.js.map +1 -1
- package/gel-core/columns/localtime.cjs +1 -1
- package/gel-core/columns/localtime.cjs.map +1 -1
- package/gel-core/columns/localtime.d.cts +7 -12
- package/gel-core/columns/localtime.d.ts +7 -12
- package/gel-core/columns/localtime.js +1 -1
- package/gel-core/columns/localtime.js.map +1 -1
- package/gel-core/columns/real.cjs +1 -1
- package/gel-core/columns/real.cjs.map +1 -1
- package/gel-core/columns/real.d.cts +8 -13
- package/gel-core/columns/real.d.ts +8 -13
- package/gel-core/columns/real.js +1 -1
- package/gel-core/columns/real.js.map +1 -1
- package/gel-core/columns/relative-duration.cjs +1 -1
- package/gel-core/columns/relative-duration.cjs.map +1 -1
- package/gel-core/columns/relative-duration.d.cts +7 -12
- package/gel-core/columns/relative-duration.d.ts +7 -12
- package/gel-core/columns/relative-duration.js +1 -1
- package/gel-core/columns/relative-duration.js.map +1 -1
- package/gel-core/columns/smallint.cjs +1 -1
- package/gel-core/columns/smallint.cjs.map +1 -1
- package/gel-core/columns/smallint.d.cts +7 -12
- package/gel-core/columns/smallint.d.ts +7 -12
- package/gel-core/columns/smallint.js +1 -1
- package/gel-core/columns/smallint.js.map +1 -1
- package/gel-core/columns/text.cjs.map +1 -1
- package/gel-core/columns/text.d.cts +6 -12
- package/gel-core/columns/text.d.ts +6 -12
- package/gel-core/columns/text.js.map +1 -1
- package/gel-core/columns/timestamp.cjs +1 -1
- package/gel-core/columns/timestamp.cjs.map +1 -1
- package/gel-core/columns/timestamp.d.cts +8 -13
- package/gel-core/columns/timestamp.d.ts +8 -13
- package/gel-core/columns/timestamp.js +1 -1
- package/gel-core/columns/timestamp.js.map +1 -1
- package/gel-core/columns/timestamptz.cjs +1 -1
- package/gel-core/columns/timestamptz.cjs.map +1 -1
- package/gel-core/columns/timestamptz.d.cts +8 -13
- package/gel-core/columns/timestamptz.d.ts +8 -13
- package/gel-core/columns/timestamptz.js +1 -1
- package/gel-core/columns/timestamptz.js.map +1 -1
- package/gel-core/columns/uuid.cjs +1 -1
- package/gel-core/columns/uuid.cjs.map +1 -1
- package/gel-core/columns/uuid.d.cts +7 -12
- package/gel-core/columns/uuid.d.ts +7 -12
- package/gel-core/columns/uuid.js +1 -1
- package/gel-core/columns/uuid.js.map +1 -1
- package/gel-core/db.cjs +10 -15
- package/gel-core/db.cjs.map +1 -1
- package/gel-core/db.d.cts +8 -8
- package/gel-core/db.d.ts +8 -8
- package/gel-core/db.js +10 -15
- package/gel-core/db.js.map +1 -1
- package/gel-core/dialect.cjs +13 -13
- package/gel-core/dialect.cjs.map +1 -1
- package/gel-core/dialect.d.cts +1 -3
- package/gel-core/dialect.d.ts +1 -3
- package/gel-core/dialect.js +14 -14
- package/gel-core/dialect.js.map +1 -1
- package/gel-core/query-builders/delete.cjs.map +1 -1
- package/gel-core/query-builders/delete.js.map +1 -1
- package/gel-core/query-builders/insert.cjs +1 -1
- package/gel-core/query-builders/insert.cjs.map +1 -1
- package/gel-core/query-builders/insert.d.cts +2 -2
- package/gel-core/query-builders/insert.d.ts +2 -2
- package/gel-core/query-builders/insert.js +2 -2
- package/gel-core/query-builders/insert.js.map +1 -1
- package/gel-core/query-builders/query.cjs +2 -12
- package/gel-core/query-builders/query.cjs.map +1 -1
- package/gel-core/query-builders/query.d.cts +2 -6
- package/gel-core/query-builders/query.d.ts +2 -6
- package/gel-core/query-builders/query.js +2 -12
- package/gel-core/query-builders/query.js.map +1 -1
- package/gel-core/query-builders/select.types.cjs.map +1 -1
- package/gel-core/query-builders/select.types.d.cts +1 -1
- package/gel-core/query-builders/select.types.d.ts +1 -1
- package/gel-core/query-builders/update.cjs.map +1 -1
- package/gel-core/query-builders/update.d.cts +3 -3
- package/gel-core/query-builders/update.d.ts +3 -3
- package/gel-core/query-builders/update.js.map +1 -1
- package/gel-core/session.cjs.map +1 -1
- package/gel-core/session.d.cts +7 -7
- package/gel-core/session.d.ts +7 -7
- package/gel-core/session.js.map +1 -1
- package/gel-core/table.cjs.map +1 -1
- package/gel-core/table.d.cts +9 -11
- package/gel-core/table.d.ts +9 -11
- package/gel-core/table.js +3 -1
- package/gel-core/table.js.map +1 -1
- package/gel-core/utils.d.cts +1 -1
- package/gel-core/utils.d.ts +1 -1
- package/gel-core/view.cjs.map +1 -1
- package/gel-core/view.d.cts +3 -4
- package/gel-core/view.d.ts +3 -4
- package/gel-core/view.js.map +1 -1
- package/libsql/driver-core.cjs +1 -1
- package/libsql/driver-core.cjs.map +1 -1
- package/libsql/driver-core.js +1 -1
- package/libsql/driver-core.js.map +1 -1
- package/libsql/session.cjs.map +1 -1
- package/libsql/session.d.cts +6 -6
- package/libsql/session.d.ts +6 -6
- package/libsql/session.js.map +1 -1
- package/mysql-core/columns/bigint.cjs +2 -2
- package/mysql-core/columns/bigint.cjs.map +1 -1
- package/mysql-core/columns/bigint.d.cts +19 -25
- package/mysql-core/columns/bigint.d.ts +19 -25
- package/mysql-core/columns/bigint.js +2 -2
- package/mysql-core/columns/bigint.js.map +1 -1
- package/mysql-core/columns/binary.cjs +5 -4
- package/mysql-core/columns/binary.cjs.map +1 -1
- package/mysql-core/columns/binary.d.cts +13 -14
- package/mysql-core/columns/binary.d.ts +13 -14
- package/mysql-core/columns/binary.js +5 -4
- package/mysql-core/columns/binary.js.map +1 -1
- package/mysql-core/columns/boolean.cjs.map +1 -1
- package/mysql-core/columns/boolean.d.cts +6 -11
- package/mysql-core/columns/boolean.d.ts +6 -11
- package/mysql-core/columns/boolean.js.map +1 -1
- package/mysql-core/columns/char.cjs +5 -4
- package/mysql-core/columns/char.cjs.map +1 -1
- package/mysql-core/columns/char.d.cts +18 -23
- package/mysql-core/columns/char.d.ts +18 -23
- package/mysql-core/columns/char.js +5 -4
- package/mysql-core/columns/char.js.map +1 -1
- package/mysql-core/columns/common.cjs +3 -1
- package/mysql-core/columns/common.cjs.map +1 -1
- package/mysql-core/columns/common.d.cts +10 -18
- package/mysql-core/columns/common.d.ts +10 -18
- package/mysql-core/columns/common.js +3 -1
- package/mysql-core/columns/common.js.map +1 -1
- package/mysql-core/columns/custom.cjs.map +1 -1
- package/mysql-core/columns/custom.d.cts +9 -14
- package/mysql-core/columns/custom.d.ts +9 -14
- package/mysql-core/columns/custom.js.map +1 -1
- package/mysql-core/columns/date.cjs +2 -2
- package/mysql-core/columns/date.cjs.map +1 -1
- package/mysql-core/columns/date.common.cjs +1 -1
- package/mysql-core/columns/date.common.cjs.map +1 -1
- package/mysql-core/columns/date.common.d.cts +3 -3
- package/mysql-core/columns/date.common.d.ts +3 -3
- package/mysql-core/columns/date.common.js +1 -1
- package/mysql-core/columns/date.common.js.map +1 -1
- package/mysql-core/columns/date.d.cts +16 -24
- package/mysql-core/columns/date.d.ts +16 -24
- package/mysql-core/columns/date.js +2 -2
- package/mysql-core/columns/date.js.map +1 -1
- package/mysql-core/columns/datetime.cjs +2 -2
- package/mysql-core/columns/datetime.cjs.map +1 -1
- package/mysql-core/columns/datetime.d.cts +16 -24
- package/mysql-core/columns/datetime.d.ts +16 -24
- package/mysql-core/columns/datetime.js +2 -2
- package/mysql-core/columns/datetime.js.map +1 -1
- package/mysql-core/columns/decimal.cjs +3 -3
- package/mysql-core/columns/decimal.cjs.map +1 -1
- package/mysql-core/columns/decimal.d.cts +22 -33
- package/mysql-core/columns/decimal.d.ts +22 -33
- package/mysql-core/columns/decimal.js +3 -3
- package/mysql-core/columns/decimal.js.map +1 -1
- package/mysql-core/columns/double.cjs +1 -1
- package/mysql-core/columns/double.cjs.map +1 -1
- package/mysql-core/columns/double.d.cts +11 -15
- package/mysql-core/columns/double.d.ts +11 -15
- package/mysql-core/columns/double.js +1 -1
- package/mysql-core/columns/double.js.map +1 -1
- package/mysql-core/columns/enum.cjs +2 -2
- package/mysql-core/columns/enum.cjs.map +1 -1
- package/mysql-core/columns/enum.d.cts +18 -23
- package/mysql-core/columns/enum.d.ts +18 -23
- package/mysql-core/columns/enum.js +2 -2
- package/mysql-core/columns/enum.js.map +1 -1
- package/mysql-core/columns/float.cjs +1 -1
- package/mysql-core/columns/float.cjs.map +1 -1
- package/mysql-core/columns/float.d.cts +11 -15
- package/mysql-core/columns/float.d.ts +11 -15
- package/mysql-core/columns/float.js +1 -1
- package/mysql-core/columns/float.js.map +1 -1
- package/mysql-core/columns/int.cjs +1 -1
- package/mysql-core/columns/int.cjs.map +1 -1
- package/mysql-core/columns/int.d.cts +11 -15
- package/mysql-core/columns/int.d.ts +11 -15
- package/mysql-core/columns/int.js +1 -1
- package/mysql-core/columns/int.js.map +1 -1
- package/mysql-core/columns/json.cjs +1 -1
- package/mysql-core/columns/json.cjs.map +1 -1
- package/mysql-core/columns/json.d.cts +7 -12
- package/mysql-core/columns/json.d.ts +7 -12
- package/mysql-core/columns/json.js +1 -1
- package/mysql-core/columns/json.js.map +1 -1
- package/mysql-core/columns/mediumint.cjs +1 -1
- package/mysql-core/columns/mediumint.cjs.map +1 -1
- package/mysql-core/columns/mediumint.d.cts +9 -13
- package/mysql-core/columns/mediumint.d.ts +9 -13
- package/mysql-core/columns/mediumint.js +1 -1
- package/mysql-core/columns/mediumint.js.map +1 -1
- package/mysql-core/columns/real.cjs +1 -1
- package/mysql-core/columns/real.cjs.map +1 -1
- package/mysql-core/columns/real.d.cts +8 -13
- package/mysql-core/columns/real.d.ts +8 -13
- package/mysql-core/columns/real.js +1 -1
- package/mysql-core/columns/real.js.map +1 -1
- package/mysql-core/columns/serial.cjs +1 -1
- package/mysql-core/columns/serial.cjs.map +1 -1
- package/mysql-core/columns/serial.d.cts +11 -12
- package/mysql-core/columns/serial.d.ts +11 -12
- package/mysql-core/columns/serial.js +1 -1
- package/mysql-core/columns/serial.js.map +1 -1
- package/mysql-core/columns/smallint.cjs +1 -1
- package/mysql-core/columns/smallint.cjs.map +1 -1
- package/mysql-core/columns/smallint.d.cts +9 -13
- package/mysql-core/columns/smallint.d.ts +9 -13
- package/mysql-core/columns/smallint.js +1 -1
- package/mysql-core/columns/smallint.js.map +1 -1
- package/mysql-core/columns/text.cjs +19 -1
- package/mysql-core/columns/text.cjs.map +1 -1
- package/mysql-core/columns/text.d.cts +17 -23
- package/mysql-core/columns/text.d.ts +17 -23
- package/mysql-core/columns/text.js +19 -1
- package/mysql-core/columns/text.js.map +1 -1
- package/mysql-core/columns/time.cjs +1 -1
- package/mysql-core/columns/time.cjs.map +1 -1
- package/mysql-core/columns/time.d.cts +8 -13
- package/mysql-core/columns/time.d.ts +8 -13
- package/mysql-core/columns/time.js +1 -1
- package/mysql-core/columns/time.js.map +1 -1
- package/mysql-core/columns/timestamp.cjs +2 -2
- package/mysql-core/columns/timestamp.cjs.map +1 -1
- package/mysql-core/columns/timestamp.d.cts +14 -22
- package/mysql-core/columns/timestamp.d.ts +14 -22
- package/mysql-core/columns/timestamp.js +2 -2
- package/mysql-core/columns/timestamp.js.map +1 -1
- package/mysql-core/columns/tinyint.cjs +1 -1
- package/mysql-core/columns/tinyint.cjs.map +1 -1
- package/mysql-core/columns/tinyint.d.cts +9 -13
- package/mysql-core/columns/tinyint.d.ts +9 -13
- package/mysql-core/columns/tinyint.js +1 -1
- package/mysql-core/columns/tinyint.js.map +1 -1
- package/mysql-core/columns/varbinary.cjs +2 -3
- package/mysql-core/columns/varbinary.cjs.map +1 -1
- package/mysql-core/columns/varbinary.d.cts +7 -12
- package/mysql-core/columns/varbinary.d.ts +7 -12
- package/mysql-core/columns/varbinary.js +2 -3
- package/mysql-core/columns/varbinary.js.map +1 -1
- package/mysql-core/columns/varchar.cjs +2 -3
- package/mysql-core/columns/varchar.cjs.map +1 -1
- package/mysql-core/columns/varchar.d.cts +12 -21
- package/mysql-core/columns/varchar.d.ts +12 -21
- package/mysql-core/columns/varchar.js +2 -3
- package/mysql-core/columns/varchar.js.map +1 -1
- package/mysql-core/columns/year.cjs +1 -1
- package/mysql-core/columns/year.cjs.map +1 -1
- package/mysql-core/columns/year.d.cts +7 -12
- package/mysql-core/columns/year.d.ts +7 -12
- package/mysql-core/columns/year.js +1 -1
- package/mysql-core/columns/year.js.map +1 -1
- package/mysql-core/db.cjs +10 -29
- package/mysql-core/db.cjs.map +1 -1
- package/mysql-core/db.d.cts +7 -7
- package/mysql-core/db.d.ts +7 -7
- package/mysql-core/db.js +10 -29
- package/mysql-core/db.js.map +1 -1
- package/mysql-core/dialect.cjs +8 -12
- package/mysql-core/dialect.cjs.map +1 -1
- package/mysql-core/dialect.d.cts +1 -3
- package/mysql-core/dialect.d.ts +1 -3
- package/mysql-core/dialect.js +9 -13
- package/mysql-core/dialect.js.map +1 -1
- package/mysql-core/query-builders/insert.cjs +1 -1
- package/mysql-core/query-builders/insert.cjs.map +1 -1
- package/mysql-core/query-builders/insert.d.cts +5 -5
- package/mysql-core/query-builders/insert.d.ts +5 -5
- package/mysql-core/query-builders/insert.js +2 -2
- package/mysql-core/query-builders/insert.js.map +1 -1
- package/mysql-core/query-builders/query.cjs +2 -12
- package/mysql-core/query-builders/query.cjs.map +1 -1
- package/mysql-core/query-builders/query.d.cts +2 -6
- package/mysql-core/query-builders/query.d.ts +2 -6
- package/mysql-core/query-builders/query.js +2 -12
- package/mysql-core/query-builders/query.js.map +1 -1
- package/mysql-core/query-builders/select.types.cjs.map +1 -1
- package/mysql-core/query-builders/select.types.d.cts +1 -1
- package/mysql-core/query-builders/select.types.d.ts +1 -1
- package/mysql-core/query-builders/update.cjs.map +1 -1
- package/mysql-core/query-builders/update.d.cts +3 -2
- package/mysql-core/query-builders/update.d.ts +3 -2
- package/mysql-core/query-builders/update.js.map +1 -1
- package/mysql-core/session.cjs.map +1 -1
- package/mysql-core/session.d.cts +7 -7
- package/mysql-core/session.d.ts +7 -7
- package/mysql-core/session.js.map +1 -1
- package/mysql-core/table.cjs.map +1 -1
- package/mysql-core/table.d.cts +10 -13
- package/mysql-core/table.d.ts +10 -13
- package/mysql-core/table.js +3 -1
- package/mysql-core/table.js.map +1 -1
- package/mysql-core/utils.d.cts +1 -1
- package/mysql-core/utils.d.ts +1 -1
- package/mysql-core/view.cjs.map +1 -1
- package/mysql-core/view.d.cts +3 -4
- package/mysql-core/view.d.ts +3 -4
- package/mysql-core/view.js.map +1 -1
- package/mysql-proxy/driver.cjs +1 -1
- package/mysql-proxy/driver.cjs.map +1 -1
- package/mysql-proxy/driver.js +1 -1
- package/mysql-proxy/driver.js.map +1 -1
- package/mysql-proxy/session.cjs.map +1 -1
- package/mysql-proxy/session.d.cts +6 -6
- package/mysql-proxy/session.d.ts +6 -6
- package/mysql-proxy/session.js.map +1 -1
- package/mysql2/driver.cjs +1 -1
- package/mysql2/driver.cjs.map +1 -1
- package/mysql2/driver.d.cts +2 -2
- package/mysql2/driver.d.ts +2 -2
- package/mysql2/driver.js +1 -1
- package/mysql2/driver.js.map +1 -1
- package/mysql2/session.cjs.map +1 -1
- package/mysql2/session.d.cts +6 -6
- package/mysql2/session.d.ts +6 -6
- package/mysql2/session.js.map +1 -1
- package/neon/neon-auth.d.cts +18 -25
- package/neon/neon-auth.d.ts +18 -25
- package/neon-http/driver.cjs +1 -1
- package/neon-http/driver.cjs.map +1 -1
- package/neon-http/driver.d.cts +2 -2
- package/neon-http/driver.d.ts +2 -2
- package/neon-http/driver.js +1 -1
- package/neon-http/driver.js.map +1 -1
- package/neon-http/session.cjs.map +1 -1
- package/neon-http/session.d.cts +5 -5
- package/neon-http/session.d.ts +5 -5
- package/neon-http/session.js.map +1 -1
- package/neon-serverless/driver.cjs +1 -1
- package/neon-serverless/driver.cjs.map +1 -1
- package/neon-serverless/driver.d.cts +2 -2
- package/neon-serverless/driver.d.ts +2 -2
- package/neon-serverless/driver.js +1 -1
- package/neon-serverless/driver.js.map +1 -1
- package/neon-serverless/session.cjs.map +1 -1
- package/neon-serverless/session.d.cts +6 -6
- package/neon-serverless/session.d.ts +6 -6
- package/neon-serverless/session.js.map +1 -1
- package/node-postgres/driver.cjs +1 -1
- package/node-postgres/driver.cjs.map +1 -1
- package/node-postgres/driver.d.cts +2 -2
- package/node-postgres/driver.d.ts +2 -2
- package/node-postgres/driver.js +1 -1
- package/node-postgres/driver.js.map +1 -1
- package/node-postgres/session.cjs.map +1 -1
- package/node-postgres/session.d.cts +6 -6
- package/node-postgres/session.d.ts +6 -6
- package/node-postgres/session.js.map +1 -1
- package/op-sqlite/driver.cjs +1 -1
- package/op-sqlite/driver.cjs.map +1 -1
- package/op-sqlite/driver.js +1 -1
- package/op-sqlite/driver.js.map +1 -1
- package/op-sqlite/session.cjs.map +1 -1
- package/op-sqlite/session.d.cts +6 -6
- package/op-sqlite/session.d.ts +6 -6
- package/op-sqlite/session.js.map +1 -1
- package/operations.cjs.map +1 -1
- package/operations.d.cts +3 -3
- package/operations.d.ts +3 -3
- package/package.json +122 -155
- package/pg-core/columns/bigint.cjs +3 -6
- package/pg-core/columns/bigint.cjs.map +1 -1
- package/pg-core/columns/bigint.d.cts +14 -21
- package/pg-core/columns/bigint.d.ts +14 -21
- package/pg-core/columns/bigint.js +3 -6
- package/pg-core/columns/bigint.js.map +1 -1
- package/pg-core/columns/bigserial.cjs +2 -2
- package/pg-core/columns/bigserial.cjs.map +1 -1
- package/pg-core/columns/bigserial.d.cts +16 -19
- package/pg-core/columns/bigserial.d.ts +16 -19
- package/pg-core/columns/bigserial.js +2 -2
- package/pg-core/columns/bigserial.js.map +1 -1
- package/pg-core/columns/boolean.cjs.map +1 -1
- package/pg-core/columns/boolean.d.cts +6 -11
- package/pg-core/columns/boolean.d.ts +6 -11
- package/pg-core/columns/boolean.js.map +1 -1
- package/pg-core/columns/bytea.cjs +1 -1
- package/pg-core/columns/bytea.cjs.map +1 -1
- package/pg-core/columns/bytea.d.cts +7 -12
- package/pg-core/columns/bytea.d.ts +7 -12
- package/pg-core/columns/bytea.js +1 -1
- package/pg-core/columns/bytea.js.map +1 -1
- package/pg-core/columns/char.cjs +5 -4
- package/pg-core/columns/char.cjs.map +1 -1
- package/pg-core/columns/char.d.cts +18 -29
- package/pg-core/columns/char.d.ts +18 -29
- package/pg-core/columns/char.js +5 -4
- package/pg-core/columns/char.js.map +1 -1
- package/pg-core/columns/cidr.cjs +1 -1
- package/pg-core/columns/cidr.cjs.map +1 -1
- package/pg-core/columns/cidr.d.cts +7 -12
- package/pg-core/columns/cidr.d.ts +7 -12
- package/pg-core/columns/cidr.js +1 -1
- package/pg-core/columns/cidr.js.map +1 -1
- package/pg-core/columns/common.cjs +9 -9
- package/pg-core/columns/common.cjs.map +1 -1
- package/pg-core/columns/common.d.cts +24 -41
- package/pg-core/columns/common.d.ts +24 -41
- package/pg-core/columns/common.js +9 -9
- package/pg-core/columns/common.js.map +1 -1
- package/pg-core/columns/custom.cjs.map +1 -1
- package/pg-core/columns/custom.d.cts +11 -18
- package/pg-core/columns/custom.d.ts +11 -18
- package/pg-core/columns/custom.js.map +1 -1
- package/pg-core/columns/date.cjs +2 -2
- package/pg-core/columns/date.cjs.map +1 -1
- package/pg-core/columns/date.common.cjs.map +1 -1
- package/pg-core/columns/date.common.d.cts +2 -2
- package/pg-core/columns/date.common.d.ts +2 -2
- package/pg-core/columns/date.common.js.map +1 -1
- package/pg-core/columns/date.d.cts +14 -22
- package/pg-core/columns/date.d.ts +14 -22
- package/pg-core/columns/date.js +2 -2
- package/pg-core/columns/date.js.map +1 -1
- package/pg-core/columns/double-precision.cjs +1 -1
- package/pg-core/columns/double-precision.cjs.map +1 -1
- package/pg-core/columns/double-precision.d.cts +7 -12
- package/pg-core/columns/double-precision.d.ts +7 -12
- package/pg-core/columns/double-precision.js +1 -1
- package/pg-core/columns/double-precision.js.map +1 -1
- package/pg-core/columns/enum.cjs +2 -2
- package/pg-core/columns/enum.cjs.map +1 -1
- package/pg-core/columns/enum.d.cts +23 -40
- package/pg-core/columns/enum.d.ts +23 -40
- package/pg-core/columns/enum.js +2 -2
- package/pg-core/columns/enum.js.map +1 -1
- package/pg-core/columns/inet.cjs +1 -1
- package/pg-core/columns/inet.cjs.map +1 -1
- package/pg-core/columns/inet.d.cts +7 -12
- package/pg-core/columns/inet.d.ts +7 -12
- package/pg-core/columns/inet.js +1 -1
- package/pg-core/columns/inet.js.map +1 -1
- package/pg-core/columns/int.common.cjs.map +1 -1
- package/pg-core/columns/int.common.d.cts +2 -2
- package/pg-core/columns/int.common.d.ts +2 -2
- package/pg-core/columns/int.common.js.map +1 -1
- package/pg-core/columns/integer.cjs +1 -1
- package/pg-core/columns/integer.cjs.map +1 -1
- package/pg-core/columns/integer.d.cts +7 -12
- package/pg-core/columns/integer.d.ts +7 -12
- package/pg-core/columns/integer.js +1 -1
- package/pg-core/columns/integer.js.map +1 -1
- package/pg-core/columns/interval.cjs +1 -1
- package/pg-core/columns/interval.cjs.map +1 -1
- package/pg-core/columns/interval.d.cts +8 -13
- package/pg-core/columns/interval.d.ts +8 -13
- package/pg-core/columns/interval.js +1 -1
- package/pg-core/columns/interval.js.map +1 -1
- package/pg-core/columns/json.cjs +1 -1
- package/pg-core/columns/json.cjs.map +1 -1
- package/pg-core/columns/json.d.cts +9 -16
- package/pg-core/columns/json.d.ts +9 -16
- package/pg-core/columns/json.js +1 -1
- package/pg-core/columns/json.js.map +1 -1
- package/pg-core/columns/jsonb.cjs +1 -1
- package/pg-core/columns/jsonb.cjs.map +1 -1
- package/pg-core/columns/jsonb.d.cts +9 -16
- package/pg-core/columns/jsonb.d.ts +9 -16
- package/pg-core/columns/jsonb.js +1 -1
- package/pg-core/columns/jsonb.js.map +1 -1
- package/pg-core/columns/line.cjs +2 -2
- package/pg-core/columns/line.cjs.map +1 -1
- package/pg-core/columns/line.d.cts +14 -22
- package/pg-core/columns/line.d.ts +14 -22
- package/pg-core/columns/line.js +2 -2
- package/pg-core/columns/line.js.map +1 -1
- package/pg-core/columns/macaddr.cjs +1 -1
- package/pg-core/columns/macaddr.cjs.map +1 -1
- package/pg-core/columns/macaddr.d.cts +7 -12
- package/pg-core/columns/macaddr.d.ts +7 -12
- package/pg-core/columns/macaddr.js +1 -1
- package/pg-core/columns/macaddr.js.map +1 -1
- package/pg-core/columns/macaddr8.cjs +1 -1
- package/pg-core/columns/macaddr8.cjs.map +1 -1
- package/pg-core/columns/macaddr8.d.cts +7 -12
- package/pg-core/columns/macaddr8.d.ts +7 -12
- package/pg-core/columns/macaddr8.js +1 -1
- package/pg-core/columns/macaddr8.js.map +1 -1
- package/pg-core/columns/numeric.cjs +2 -2
- package/pg-core/columns/numeric.cjs.map +1 -1
- package/pg-core/columns/numeric.d.cts +23 -39
- package/pg-core/columns/numeric.d.ts +23 -39
- package/pg-core/columns/numeric.js +2 -2
- package/pg-core/columns/numeric.js.map +1 -1
- package/pg-core/columns/point.cjs +2 -2
- package/pg-core/columns/point.cjs.map +1 -1
- package/pg-core/columns/point.d.cts +12 -20
- package/pg-core/columns/point.d.ts +12 -20
- package/pg-core/columns/point.js +2 -2
- package/pg-core/columns/point.js.map +1 -1
- package/pg-core/columns/postgis_extension/geometry.cjs +2 -2
- package/pg-core/columns/postgis_extension/geometry.cjs.map +1 -1
- package/pg-core/columns/postgis_extension/geometry.d.cts +14 -22
- package/pg-core/columns/postgis_extension/geometry.d.ts +14 -22
- package/pg-core/columns/postgis_extension/geometry.js +2 -2
- package/pg-core/columns/postgis_extension/geometry.js.map +1 -1
- package/pg-core/columns/real.cjs +1 -1
- package/pg-core/columns/real.cjs.map +1 -1
- package/pg-core/columns/real.d.cts +9 -16
- package/pg-core/columns/real.d.ts +9 -16
- package/pg-core/columns/real.js +1 -1
- package/pg-core/columns/real.js.map +1 -1
- package/pg-core/columns/serial.cjs +1 -1
- package/pg-core/columns/serial.cjs.map +1 -1
- package/pg-core/columns/serial.d.cts +9 -12
- package/pg-core/columns/serial.d.ts +9 -12
- package/pg-core/columns/serial.js +1 -1
- package/pg-core/columns/serial.js.map +1 -1
- package/pg-core/columns/smallint.cjs +1 -1
- package/pg-core/columns/smallint.cjs.map +1 -1
- package/pg-core/columns/smallint.d.cts +7 -12
- package/pg-core/columns/smallint.d.ts +7 -12
- package/pg-core/columns/smallint.js +1 -1
- package/pg-core/columns/smallint.js.map +1 -1
- package/pg-core/columns/smallserial.cjs +1 -1
- package/pg-core/columns/smallserial.cjs.map +1 -1
- package/pg-core/columns/smallserial.d.cts +9 -12
- package/pg-core/columns/smallserial.d.ts +9 -12
- package/pg-core/columns/smallserial.js +1 -1
- package/pg-core/columns/smallserial.js.map +1 -1
- package/pg-core/columns/text.cjs +7 -3
- package/pg-core/columns/text.cjs.map +1 -1
- package/pg-core/columns/text.d.cts +14 -18
- package/pg-core/columns/text.d.ts +14 -18
- package/pg-core/columns/text.js +7 -3
- package/pg-core/columns/text.js.map +1 -1
- package/pg-core/columns/time.cjs +1 -1
- package/pg-core/columns/time.cjs.map +1 -1
- package/pg-core/columns/time.d.cts +10 -17
- package/pg-core/columns/time.d.ts +10 -17
- package/pg-core/columns/time.js +1 -1
- package/pg-core/columns/time.js.map +1 -1
- package/pg-core/columns/timestamp.cjs +2 -2
- package/pg-core/columns/timestamp.cjs.map +1 -1
- package/pg-core/columns/timestamp.d.cts +17 -29
- package/pg-core/columns/timestamp.d.ts +17 -29
- package/pg-core/columns/timestamp.js +2 -2
- package/pg-core/columns/timestamp.js.map +1 -1
- package/pg-core/columns/uuid.cjs +1 -1
- package/pg-core/columns/uuid.cjs.map +1 -1
- package/pg-core/columns/uuid.d.cts +7 -12
- package/pg-core/columns/uuid.d.ts +7 -12
- package/pg-core/columns/uuid.js +1 -1
- package/pg-core/columns/uuid.js.map +1 -1
- package/pg-core/columns/varchar.cjs +1 -2
- package/pg-core/columns/varchar.cjs.map +1 -1
- package/pg-core/columns/varchar.d.cts +14 -27
- package/pg-core/columns/varchar.d.ts +14 -27
- package/pg-core/columns/varchar.js +1 -2
- package/pg-core/columns/varchar.js.map +1 -1
- package/pg-core/columns/vector_extension/bit.cjs +4 -4
- package/pg-core/columns/vector_extension/bit.cjs.map +1 -1
- package/pg-core/columns/vector_extension/bit.d.cts +12 -25
- package/pg-core/columns/vector_extension/bit.d.ts +12 -25
- package/pg-core/columns/vector_extension/bit.js +4 -4
- package/pg-core/columns/vector_extension/bit.js.map +1 -1
- package/pg-core/columns/vector_extension/halfvec.cjs +4 -4
- package/pg-core/columns/vector_extension/halfvec.cjs.map +1 -1
- package/pg-core/columns/vector_extension/halfvec.d.cts +11 -26
- package/pg-core/columns/vector_extension/halfvec.d.ts +11 -26
- package/pg-core/columns/vector_extension/halfvec.js +4 -4
- package/pg-core/columns/vector_extension/halfvec.js.map +1 -1
- package/pg-core/columns/vector_extension/sparsevec.cjs +1 -1
- package/pg-core/columns/vector_extension/sparsevec.cjs.map +1 -1
- package/pg-core/columns/vector_extension/sparsevec.d.cts +7 -11
- package/pg-core/columns/vector_extension/sparsevec.d.ts +7 -11
- package/pg-core/columns/vector_extension/sparsevec.js +1 -1
- package/pg-core/columns/vector_extension/sparsevec.js.map +1 -1
- package/pg-core/columns/vector_extension/vector.cjs +4 -4
- package/pg-core/columns/vector_extension/vector.cjs.map +1 -1
- package/pg-core/columns/vector_extension/vector.d.cts +11 -26
- package/pg-core/columns/vector_extension/vector.d.ts +11 -26
- package/pg-core/columns/vector_extension/vector.js +4 -4
- package/pg-core/columns/vector_extension/vector.js.map +1 -1
- package/pg-core/db.cjs +10 -15
- package/pg-core/db.cjs.map +1 -1
- package/pg-core/db.d.cts +8 -8
- package/pg-core/db.d.ts +8 -8
- package/pg-core/db.js +10 -15
- package/pg-core/db.js.map +1 -1
- package/pg-core/dialect.cjs +13 -13
- package/pg-core/dialect.cjs.map +1 -1
- package/pg-core/dialect.d.cts +1 -3
- package/pg-core/dialect.d.ts +1 -3
- package/pg-core/dialect.js +14 -14
- package/pg-core/dialect.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 -1
- package/pg-core/query-builders/insert.cjs.map +1 -1
- package/pg-core/query-builders/insert.d.cts +2 -2
- package/pg-core/query-builders/insert.d.ts +2 -2
- package/pg-core/query-builders/insert.js +2 -2
- package/pg-core/query-builders/insert.js.map +1 -1
- package/pg-core/query-builders/query.cjs +2 -12
- package/pg-core/query-builders/query.cjs.map +1 -1
- package/pg-core/query-builders/query.d.cts +2 -6
- package/pg-core/query-builders/query.d.ts +2 -6
- package/pg-core/query-builders/query.js +2 -12
- package/pg-core/query-builders/query.js.map +1 -1
- package/pg-core/query-builders/select.types.cjs.map +1 -1
- package/pg-core/query-builders/select.types.d.cts +1 -1
- package/pg-core/query-builders/select.types.d.ts +1 -1
- package/pg-core/query-builders/update.cjs.map +1 -1
- package/pg-core/query-builders/update.d.cts +3 -3
- package/pg-core/query-builders/update.d.ts +3 -3
- package/pg-core/query-builders/update.js.map +1 -1
- package/pg-core/session.cjs.map +1 -1
- package/pg-core/session.d.cts +7 -7
- package/pg-core/session.d.ts +7 -7
- package/pg-core/session.js.map +1 -1
- package/pg-core/table.cjs.map +1 -1
- package/pg-core/table.d.cts +9 -11
- package/pg-core/table.d.ts +9 -11
- package/pg-core/table.js +3 -1
- package/pg-core/table.js.map +1 -1
- package/pg-core/utils.cjs +3 -1
- package/pg-core/utils.cjs.map +1 -1
- package/pg-core/utils.d.cts +1 -1
- package/pg-core/utils.d.ts +1 -1
- package/pg-core/utils.js +4 -2
- package/pg-core/utils.js.map +1 -1
- package/pg-core/view.cjs.map +1 -1
- package/pg-core/view.d.cts +5 -6
- package/pg-core/view.d.ts +5 -6
- package/pg-core/view.js.map +1 -1
- package/pg-proxy/driver.cjs +1 -1
- package/pg-proxy/driver.cjs.map +1 -1
- package/pg-proxy/driver.js +1 -1
- package/pg-proxy/driver.js.map +1 -1
- package/pg-proxy/session.cjs.map +1 -1
- package/pg-proxy/session.d.cts +6 -6
- package/pg-proxy/session.d.ts +6 -6
- package/pg-proxy/session.js.map +1 -1
- package/pglite/driver.cjs +1 -1
- package/pglite/driver.cjs.map +1 -1
- package/pglite/driver.d.cts +2 -2
- package/pglite/driver.d.ts +2 -2
- package/pglite/driver.js +1 -1
- package/pglite/driver.js.map +1 -1
- package/pglite/session.cjs.map +1 -1
- package/pglite/session.d.cts +6 -6
- package/pglite/session.d.ts +6 -6
- package/pglite/session.js.map +1 -1
- package/planetscale-serverless/driver.cjs +1 -1
- package/planetscale-serverless/driver.cjs.map +1 -1
- package/planetscale-serverless/driver.js +1 -1
- package/planetscale-serverless/driver.js.map +1 -1
- package/planetscale-serverless/session.cjs.map +1 -1
- package/planetscale-serverless/session.d.cts +7 -7
- package/planetscale-serverless/session.d.ts +7 -7
- package/planetscale-serverless/session.js.map +1 -1
- package/postgres-js/driver.cjs +1 -1
- package/postgres-js/driver.cjs.map +1 -1
- package/postgres-js/driver.d.cts +1 -1
- package/postgres-js/driver.d.ts +1 -1
- package/postgres-js/driver.js +1 -1
- package/postgres-js/driver.js.map +1 -1
- package/postgres-js/session.cjs.map +1 -1
- package/postgres-js/session.d.cts +7 -7
- package/postgres-js/session.d.ts +7 -7
- package/postgres-js/session.js.map +1 -1
- package/prisma/mysql/driver.cjs +7 -1
- package/prisma/mysql/driver.cjs.map +1 -1
- package/prisma/mysql/driver.js +7 -1
- package/prisma/mysql/driver.js.map +1 -1
- package/prisma/mysql/session.cjs.map +1 -1
- package/prisma/mysql/session.d.cts +2 -2
- package/prisma/mysql/session.d.ts +2 -2
- 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.map +1 -1
- package/prisma/pg/session.d.cts +2 -2
- package/prisma/pg/session.d.ts +2 -2
- package/prisma/pg/session.js.map +1 -1
- package/prisma/sqlite/driver.cjs +7 -1
- package/prisma/sqlite/driver.cjs.map +1 -1
- package/prisma/sqlite/driver.js +7 -1
- package/prisma/sqlite/driver.js.map +1 -1
- package/prisma/sqlite/session.cjs.map +1 -1
- package/prisma/sqlite/session.d.cts +3 -3
- package/prisma/sqlite/session.d.ts +3 -3
- package/prisma/sqlite/session.js.map +1 -1
- package/query-builders/select.types.cjs.map +1 -1
- package/query-builders/select.types.d.cts +2 -2
- package/query-builders/select.types.d.ts +2 -2
- package/relations.cjs +174 -163
- package/relations.cjs.map +1 -1
- package/relations.d.cts +170 -190
- package/relations.d.ts +170 -190
- package/relations.js +170 -163
- package/relations.js.map +1 -1
- package/singlestore-core/columns/bigint.cjs +2 -2
- package/singlestore-core/columns/bigint.cjs.map +1 -1
- package/singlestore-core/columns/bigint.d.cts +17 -24
- package/singlestore-core/columns/bigint.d.ts +17 -24
- package/singlestore-core/columns/bigint.js +2 -2
- package/singlestore-core/columns/bigint.js.map +1 -1
- package/singlestore-core/columns/binary.cjs +5 -4
- package/singlestore-core/columns/binary.cjs.map +1 -1
- package/singlestore-core/columns/binary.d.cts +13 -15
- package/singlestore-core/columns/binary.d.ts +13 -15
- package/singlestore-core/columns/binary.js +5 -4
- package/singlestore-core/columns/binary.js.map +1 -1
- package/singlestore-core/columns/boolean.cjs.map +1 -1
- package/singlestore-core/columns/boolean.d.cts +6 -12
- package/singlestore-core/columns/boolean.d.ts +6 -12
- package/singlestore-core/columns/boolean.js.map +1 -1
- package/singlestore-core/columns/char.cjs +5 -4
- package/singlestore-core/columns/char.cjs.map +1 -1
- package/singlestore-core/columns/char.d.cts +18 -24
- package/singlestore-core/columns/char.d.ts +18 -24
- package/singlestore-core/columns/char.js +5 -4
- package/singlestore-core/columns/char.js.map +1 -1
- package/singlestore-core/columns/common.cjs +3 -2
- package/singlestore-core/columns/common.cjs.map +1 -1
- package/singlestore-core/columns/common.d.cts +14 -18
- package/singlestore-core/columns/common.d.ts +14 -18
- package/singlestore-core/columns/common.js +3 -2
- package/singlestore-core/columns/common.js.map +1 -1
- package/singlestore-core/columns/custom.cjs.map +1 -1
- package/singlestore-core/columns/custom.d.cts +10 -15
- package/singlestore-core/columns/custom.d.ts +10 -15
- package/singlestore-core/columns/custom.js.map +1 -1
- package/singlestore-core/columns/date.cjs +2 -2
- package/singlestore-core/columns/date.cjs.map +1 -1
- package/singlestore-core/columns/date.common.cjs.map +1 -1
- package/singlestore-core/columns/date.common.d.cts +3 -3
- package/singlestore-core/columns/date.common.d.ts +3 -3
- package/singlestore-core/columns/date.common.js.map +1 -1
- package/singlestore-core/columns/date.d.cts +16 -26
- package/singlestore-core/columns/date.d.ts +16 -26
- package/singlestore-core/columns/date.js +2 -2
- package/singlestore-core/columns/date.js.map +1 -1
- package/singlestore-core/columns/datetime.cjs +3 -5
- package/singlestore-core/columns/datetime.cjs.map +1 -1
- package/singlestore-core/columns/datetime.d.cts +25 -27
- package/singlestore-core/columns/datetime.d.ts +25 -27
- package/singlestore-core/columns/datetime.js +3 -5
- package/singlestore-core/columns/datetime.js.map +1 -1
- package/singlestore-core/columns/decimal.cjs +3 -3
- package/singlestore-core/columns/decimal.cjs.map +1 -1
- package/singlestore-core/columns/decimal.d.cts +22 -36
- package/singlestore-core/columns/decimal.d.ts +22 -36
- package/singlestore-core/columns/decimal.js +3 -3
- package/singlestore-core/columns/decimal.js.map +1 -1
- package/singlestore-core/columns/double.cjs +1 -1
- package/singlestore-core/columns/double.cjs.map +1 -1
- package/singlestore-core/columns/double.d.cts +11 -16
- package/singlestore-core/columns/double.d.ts +11 -16
- package/singlestore-core/columns/double.js +1 -1
- package/singlestore-core/columns/double.js.map +1 -1
- package/singlestore-core/columns/enum.cjs +1 -1
- package/singlestore-core/columns/enum.cjs.map +1 -1
- package/singlestore-core/columns/enum.d.cts +14 -15
- package/singlestore-core/columns/enum.d.ts +14 -15
- package/singlestore-core/columns/enum.js +1 -1
- package/singlestore-core/columns/enum.js.map +1 -1
- package/singlestore-core/columns/float.cjs +1 -1
- package/singlestore-core/columns/float.cjs.map +1 -1
- package/singlestore-core/columns/float.d.cts +11 -16
- package/singlestore-core/columns/float.d.ts +11 -16
- package/singlestore-core/columns/float.js +1 -1
- package/singlestore-core/columns/float.js.map +1 -1
- package/singlestore-core/columns/int.cjs +1 -1
- package/singlestore-core/columns/int.cjs.map +1 -1
- package/singlestore-core/columns/int.d.cts +11 -16
- package/singlestore-core/columns/int.d.ts +11 -16
- package/singlestore-core/columns/int.js +1 -1
- package/singlestore-core/columns/int.js.map +1 -1
- package/singlestore-core/columns/json.cjs +1 -1
- package/singlestore-core/columns/json.cjs.map +1 -1
- package/singlestore-core/columns/json.d.cts +7 -13
- package/singlestore-core/columns/json.d.ts +7 -13
- package/singlestore-core/columns/json.js +1 -1
- package/singlestore-core/columns/json.js.map +1 -1
- package/singlestore-core/columns/mediumint.cjs +1 -1
- package/singlestore-core/columns/mediumint.cjs.map +1 -1
- package/singlestore-core/columns/mediumint.d.cts +9 -14
- package/singlestore-core/columns/mediumint.d.ts +9 -14
- package/singlestore-core/columns/mediumint.js +1 -1
- package/singlestore-core/columns/mediumint.js.map +1 -1
- package/singlestore-core/columns/real.cjs +1 -1
- package/singlestore-core/columns/real.cjs.map +1 -1
- package/singlestore-core/columns/real.d.cts +8 -14
- package/singlestore-core/columns/real.d.ts +8 -14
- package/singlestore-core/columns/real.js +1 -1
- package/singlestore-core/columns/real.js.map +1 -1
- package/singlestore-core/columns/serial.cjs +1 -1
- package/singlestore-core/columns/serial.cjs.map +1 -1
- package/singlestore-core/columns/serial.d.cts +11 -13
- package/singlestore-core/columns/serial.d.ts +11 -13
- package/singlestore-core/columns/serial.js +1 -1
- package/singlestore-core/columns/serial.js.map +1 -1
- package/singlestore-core/columns/smallint.cjs +1 -1
- package/singlestore-core/columns/smallint.cjs.map +1 -1
- package/singlestore-core/columns/smallint.d.cts +9 -14
- package/singlestore-core/columns/smallint.d.ts +9 -14
- package/singlestore-core/columns/smallint.js +1 -1
- package/singlestore-core/columns/smallint.js.map +1 -1
- package/singlestore-core/columns/text.cjs +19 -1
- package/singlestore-core/columns/text.cjs.map +1 -1
- package/singlestore-core/columns/text.d.cts +17 -24
- package/singlestore-core/columns/text.d.ts +17 -24
- package/singlestore-core/columns/text.js +19 -1
- package/singlestore-core/columns/text.js.map +1 -1
- package/singlestore-core/columns/time.cjs +1 -1
- package/singlestore-core/columns/time.cjs.map +1 -1
- package/singlestore-core/columns/time.d.cts +7 -13
- package/singlestore-core/columns/time.d.ts +7 -13
- package/singlestore-core/columns/time.js +1 -1
- package/singlestore-core/columns/time.js.map +1 -1
- package/singlestore-core/columns/timestamp.cjs +2 -2
- package/singlestore-core/columns/timestamp.cjs.map +1 -1
- package/singlestore-core/columns/timestamp.d.cts +14 -24
- package/singlestore-core/columns/timestamp.d.ts +14 -24
- package/singlestore-core/columns/timestamp.js +2 -2
- package/singlestore-core/columns/timestamp.js.map +1 -1
- package/singlestore-core/columns/tinyint.cjs +1 -1
- package/singlestore-core/columns/tinyint.cjs.map +1 -1
- package/singlestore-core/columns/tinyint.d.cts +9 -14
- package/singlestore-core/columns/tinyint.d.ts +9 -14
- package/singlestore-core/columns/tinyint.js +1 -1
- package/singlestore-core/columns/tinyint.js.map +1 -1
- package/singlestore-core/columns/varbinary.cjs +2 -3
- package/singlestore-core/columns/varbinary.cjs.map +1 -1
- package/singlestore-core/columns/varbinary.d.cts +7 -13
- package/singlestore-core/columns/varbinary.d.ts +7 -13
- package/singlestore-core/columns/varbinary.js +2 -3
- package/singlestore-core/columns/varbinary.js.map +1 -1
- package/singlestore-core/columns/varchar.cjs +1 -2
- package/singlestore-core/columns/varchar.cjs.map +1 -1
- package/singlestore-core/columns/varchar.d.cts +12 -24
- package/singlestore-core/columns/varchar.d.ts +12 -24
- package/singlestore-core/columns/varchar.js +1 -2
- package/singlestore-core/columns/varchar.js.map +1 -1
- package/singlestore-core/columns/vector.cjs +5 -5
- package/singlestore-core/columns/vector.cjs.map +1 -1
- package/singlestore-core/columns/vector.d.cts +17 -14
- package/singlestore-core/columns/vector.d.ts +17 -14
- package/singlestore-core/columns/vector.js +5 -5
- package/singlestore-core/columns/vector.js.map +1 -1
- package/singlestore-core/columns/year.cjs +1 -1
- package/singlestore-core/columns/year.cjs.map +1 -1
- package/singlestore-core/columns/year.d.cts +7 -13
- package/singlestore-core/columns/year.d.ts +7 -13
- package/singlestore-core/columns/year.js +1 -1
- package/singlestore-core/columns/year.js.map +1 -1
- package/singlestore-core/dialect.cjs +2 -2
- package/singlestore-core/dialect.cjs.map +1 -1
- package/singlestore-core/dialect.js +2 -2
- package/singlestore-core/dialect.js.map +1 -1
- package/singlestore-core/query-builders/insert.cjs.map +1 -1
- package/singlestore-core/query-builders/insert.d.cts +3 -3
- package/singlestore-core/query-builders/insert.d.ts +3 -3
- package/singlestore-core/query-builders/insert.js.map +1 -1
- package/singlestore-core/query-builders/select.types.cjs.map +1 -1
- package/singlestore-core/query-builders/select.types.d.cts +1 -1
- package/singlestore-core/query-builders/select.types.d.ts +1 -1
- package/singlestore-core/query-builders/update.cjs.map +1 -1
- package/singlestore-core/query-builders/update.d.cts +3 -2
- package/singlestore-core/query-builders/update.d.ts +3 -2
- package/singlestore-core/query-builders/update.js.map +1 -1
- package/singlestore-core/table.cjs.map +1 -1
- package/singlestore-core/table.d.cts +10 -13
- package/singlestore-core/table.d.ts +10 -13
- package/singlestore-core/table.js +3 -1
- package/singlestore-core/table.js.map +1 -1
- package/singlestore-core/utils.d.cts +1 -1
- package/singlestore-core/utils.d.ts +1 -1
- package/singlestore-core/view.cjs.map +1 -1
- package/singlestore-core/view.d.cts +2 -3
- package/singlestore-core/view.d.ts +2 -3
- package/singlestore-core/view.js.map +1 -1
- package/sql/sql.cjs +2 -2
- package/sql/sql.cjs.map +1 -1
- package/sql/sql.js +3 -3
- package/sql/sql.js.map +1 -1
- package/sql-js/driver.cjs +1 -1
- package/sql-js/driver.cjs.map +1 -1
- package/sql-js/driver.js +1 -1
- package/sql-js/driver.js.map +1 -1
- package/sql-js/session.cjs.map +1 -1
- package/sql-js/session.d.cts +6 -6
- package/sql-js/session.d.ts +6 -6
- package/sql-js/session.js.map +1 -1
- package/sqlite-core/columns/blob.cjs +3 -3
- package/sqlite-core/columns/blob.cjs.map +1 -1
- package/sqlite-core/columns/blob.d.cts +20 -31
- package/sqlite-core/columns/blob.d.ts +20 -31
- package/sqlite-core/columns/blob.js +3 -3
- package/sqlite-core/columns/blob.js.map +1 -1
- package/sqlite-core/columns/common.cjs +3 -1
- package/sqlite-core/columns/common.cjs.map +1 -1
- package/sqlite-core/columns/common.d.cts +6 -14
- package/sqlite-core/columns/common.d.ts +6 -14
- package/sqlite-core/columns/common.js +3 -1
- package/sqlite-core/columns/common.js.map +1 -1
- package/sqlite-core/columns/custom.cjs.map +1 -1
- package/sqlite-core/columns/custom.d.cts +10 -14
- package/sqlite-core/columns/custom.d.ts +10 -14
- package/sqlite-core/columns/custom.js.map +1 -1
- package/sqlite-core/columns/integer.cjs +2 -2
- package/sqlite-core/columns/integer.cjs.map +1 -1
- package/sqlite-core/columns/integer.d.cts +28 -44
- package/sqlite-core/columns/integer.d.ts +28 -44
- package/sqlite-core/columns/integer.js +2 -2
- package/sqlite-core/columns/integer.js.map +1 -1
- package/sqlite-core/columns/numeric.cjs +2 -2
- package/sqlite-core/columns/numeric.cjs.map +1 -1
- package/sqlite-core/columns/numeric.d.cts +19 -29
- package/sqlite-core/columns/numeric.d.ts +19 -29
- package/sqlite-core/columns/numeric.js +2 -2
- package/sqlite-core/columns/numeric.js.map +1 -1
- package/sqlite-core/columns/real.cjs +1 -1
- package/sqlite-core/columns/real.cjs.map +1 -1
- package/sqlite-core/columns/real.d.cts +7 -12
- package/sqlite-core/columns/real.d.ts +7 -12
- package/sqlite-core/columns/real.js +1 -1
- package/sqlite-core/columns/real.js.map +1 -1
- package/sqlite-core/columns/text.cjs +2 -3
- package/sqlite-core/columns/text.cjs.map +1 -1
- package/sqlite-core/columns/text.d.cts +20 -35
- package/sqlite-core/columns/text.d.ts +20 -35
- package/sqlite-core/columns/text.js +2 -3
- package/sqlite-core/columns/text.js.map +1 -1
- package/sqlite-core/db.cjs +13 -18
- package/sqlite-core/db.cjs.map +1 -1
- package/sqlite-core/db.d.cts +7 -7
- package/sqlite-core/db.d.ts +7 -7
- package/sqlite-core/db.js +13 -18
- package/sqlite-core/db.js.map +1 -1
- package/sqlite-core/dialect.cjs +8 -12
- package/sqlite-core/dialect.cjs.map +1 -1
- package/sqlite-core/dialect.d.cts +3 -5
- package/sqlite-core/dialect.d.ts +3 -5
- package/sqlite-core/dialect.js +9 -13
- package/sqlite-core/dialect.js.map +1 -1
- package/sqlite-core/query-builders/_query.cjs.map +1 -1
- package/sqlite-core/query-builders/_query.d.cts +3 -3
- package/sqlite-core/query-builders/_query.d.ts +3 -3
- package/sqlite-core/query-builders/_query.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 +1 -1
- package/sqlite-core/query-builders/insert.cjs.map +1 -1
- package/sqlite-core/query-builders/insert.d.cts +8 -7
- package/sqlite-core/query-builders/insert.d.ts +8 -7
- package/sqlite-core/query-builders/insert.js +2 -2
- package/sqlite-core/query-builders/insert.js.map +1 -1
- package/sqlite-core/query-builders/query.cjs +2 -18
- package/sqlite-core/query-builders/query.cjs.map +1 -1
- package/sqlite-core/query-builders/query.d.cts +2 -6
- package/sqlite-core/query-builders/query.d.ts +2 -6
- package/sqlite-core/query-builders/query.js +2 -18
- 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/select.types.cjs.map +1 -1
- package/sqlite-core/query-builders/select.types.d.cts +1 -1
- package/sqlite-core/query-builders/select.types.d.ts +1 -1
- package/sqlite-core/query-builders/update.cjs.map +1 -1
- package/sqlite-core/query-builders/update.d.cts +6 -5
- package/sqlite-core/query-builders/update.d.ts +6 -5
- package/sqlite-core/query-builders/update.js.map +1 -1
- package/sqlite-core/session.cjs.map +1 -1
- package/sqlite-core/session.d.cts +6 -6
- package/sqlite-core/session.d.ts +6 -6
- package/sqlite-core/session.js.map +1 -1
- package/sqlite-core/table.cjs.map +1 -1
- package/sqlite-core/table.d.cts +9 -11
- package/sqlite-core/table.d.ts +9 -11
- package/sqlite-core/table.js +3 -1
- package/sqlite-core/table.js.map +1 -1
- package/sqlite-core/utils.d.cts +1 -1
- package/sqlite-core/utils.d.ts +1 -1
- package/sqlite-core/view.cjs.map +1 -1
- package/sqlite-core/view.d.cts +3 -4
- package/sqlite-core/view.d.ts +3 -4
- package/sqlite-core/view.js.map +1 -1
- package/sqlite-proxy/driver.cjs +1 -1
- package/sqlite-proxy/driver.cjs.map +1 -1
- package/sqlite-proxy/driver.js +1 -1
- package/sqlite-proxy/driver.js.map +1 -1
- package/sqlite-proxy/session.cjs.map +1 -1
- package/sqlite-proxy/session.d.cts +6 -6
- package/sqlite-proxy/session.d.ts +6 -6
- package/sqlite-proxy/session.js.map +1 -1
- package/supabase/rls.d.cts +30 -43
- package/supabase/rls.d.ts +30 -43
- package/table.cjs +13 -12
- package/table.cjs.map +1 -1
- package/table.d.cts +26 -35
- package/table.d.ts +26 -35
- package/table.js +11 -10
- package/table.js.map +1 -1
- package/tidb-serverless/driver.cjs +1 -1
- package/tidb-serverless/driver.cjs.map +1 -1
- package/tidb-serverless/driver.js +1 -1
- package/tidb-serverless/driver.js.map +1 -1
- package/tidb-serverless/session.cjs.map +1 -1
- package/tidb-serverless/session.d.cts +7 -7
- package/tidb-serverless/session.d.ts +7 -7
- package/tidb-serverless/session.js.map +1 -1
- package/utils.cjs +5 -0
- package/utils.cjs.map +1 -1
- package/utils.d.cts +2 -2
- package/utils.d.ts +2 -2
- package/utils.js +5 -0
- package/utils.js.map +1 -1
- package/vercel-postgres/driver.cjs +1 -1
- package/vercel-postgres/driver.cjs.map +1 -1
- package/vercel-postgres/driver.d.cts +2 -2
- package/vercel-postgres/driver.d.ts +2 -2
- package/vercel-postgres/driver.js +1 -1
- package/vercel-postgres/driver.js.map +1 -1
- package/vercel-postgres/session.cjs.map +1 -1
- package/vercel-postgres/session.d.cts +6 -6
- package/vercel-postgres/session.d.ts +6 -6
- 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 +1 -1
- package/xata-http/driver.cjs.map +1 -1
- package/xata-http/driver.d.cts +2 -2
- package/xata-http/driver.d.ts +2 -2
- package/xata-http/driver.js +1 -1
- package/xata-http/driver.js.map +1 -1
- package/xata-http/session.cjs.map +1 -1
- package/xata-http/session.d.cts +6 -6
- package/xata-http/session.d.ts +6 -6
- package/xata-http/session.js.map +1 -1
- package/knex/index.cjs +0 -2
- package/knex/index.cjs.map +0 -1
- package/knex/index.d.cts +0 -9
- package/knex/index.d.ts +0 -9
- package/knex/index.js +0 -1
- package/knex/index.js.map +0 -1
- package/kysely/index.cjs +0 -17
- package/kysely/index.cjs.map +0 -1
- package/kysely/index.d.cts +0 -16
- package/kysely/index.d.ts +0 -16
- package/kysely/index.js +0 -1
- package/kysely/index.js.map +0 -1
|
@@ -1,35 +1,26 @@
|
|
|
1
|
-
import type { ColumnBuilderBaseConfig } from "../../column-builder.js";
|
|
2
1
|
import type { ColumnBaseConfig } from "../../column.js";
|
|
3
2
|
import { entityKind } from "../../entity.js";
|
|
4
|
-
import { type Writable } from "../../utils.js";
|
|
3
|
+
import { type Equal, type Writable } from "../../utils.js";
|
|
5
4
|
import { MySqlColumn, MySqlColumnBuilder } from "./common.js";
|
|
6
|
-
export
|
|
7
|
-
name:
|
|
8
|
-
dataType: 'string';
|
|
9
|
-
columnType: 'MySqlVarChar';
|
|
5
|
+
export declare class MySqlVarCharBuilder<TEnum extends [string, ...string[]]> extends MySqlColumnBuilder<{
|
|
6
|
+
name: string;
|
|
7
|
+
dataType: Equal<TEnum, [string, ...string[]]> extends true ? 'string text' : 'string enum';
|
|
10
8
|
data: TEnum[number];
|
|
11
9
|
driverParam: number | string;
|
|
12
10
|
enumValues: TEnum;
|
|
13
|
-
|
|
14
|
-
}>;
|
|
15
|
-
export declare class MySqlVarCharBuilder<T extends ColumnBuilderBaseConfig<'string', 'MySqlVarChar'> & {
|
|
16
|
-
length?: number | undefined;
|
|
17
|
-
}> extends MySqlColumnBuilder<T, MySqlVarCharConfig<T['enumValues'], T['length']>> {
|
|
11
|
+
}, MySqlVarCharConfig<TEnum>> {
|
|
18
12
|
static readonly [entityKind]: string;
|
|
19
13
|
}
|
|
20
|
-
export declare class MySqlVarChar<T extends ColumnBaseConfig<'string'
|
|
21
|
-
length
|
|
22
|
-
}> extends MySqlColumn<T, MySqlVarCharConfig<T['enumValues']
|
|
23
|
-
length: T['length'];
|
|
24
|
-
}> {
|
|
14
|
+
export declare class MySqlVarChar<T extends ColumnBaseConfig<'string' | 'string enum'> & {
|
|
15
|
+
length: number;
|
|
16
|
+
}> extends MySqlColumn<T, MySqlVarCharConfig<T['enumValues']>> {
|
|
25
17
|
static readonly [entityKind]: string;
|
|
26
|
-
readonly length: number | undefined;
|
|
27
18
|
readonly enumValues: T["enumValues"] | undefined;
|
|
28
19
|
getSQLType(): string;
|
|
29
20
|
}
|
|
30
|
-
export interface MySqlVarCharConfig<TEnum extends string[] | readonly string[] | undefined = string[] | readonly string[] | undefined
|
|
21
|
+
export interface MySqlVarCharConfig<TEnum extends string[] | readonly string[] | undefined = string[] | readonly string[] | undefined> {
|
|
31
22
|
enum?: TEnum;
|
|
32
|
-
length:
|
|
23
|
+
length: number;
|
|
33
24
|
}
|
|
34
|
-
export declare function varchar<U extends string, T extends Readonly<[U, ...U[]]
|
|
35
|
-
export declare function varchar<
|
|
25
|
+
export declare function varchar<U extends string, T extends Readonly<[U, ...U[]]>>(config: MySqlVarCharConfig<T | Writable<T>>): MySqlVarCharBuilder<Writable<T>>;
|
|
26
|
+
export declare function varchar<U extends string, T extends Readonly<[U, ...U[]]>>(name: string, config: MySqlVarCharConfig<T | Writable<T>>): MySqlVarCharBuilder<Writable<T>>;
|
|
@@ -5,7 +5,7 @@ class MySqlVarCharBuilder extends MySqlColumnBuilder {
|
|
|
5
5
|
static [entityKind] = "MySqlVarCharBuilder";
|
|
6
6
|
/** @internal */
|
|
7
7
|
constructor(name, config) {
|
|
8
|
-
super(name, "string", "MySqlVarChar");
|
|
8
|
+
super(name, config.enum?.length ? "string enum" : "string text", "MySqlVarChar");
|
|
9
9
|
this.config.length = config.length;
|
|
10
10
|
this.config.enum = config.enum;
|
|
11
11
|
}
|
|
@@ -19,10 +19,9 @@ class MySqlVarCharBuilder extends MySqlColumnBuilder {
|
|
|
19
19
|
}
|
|
20
20
|
class MySqlVarChar extends MySqlColumn {
|
|
21
21
|
static [entityKind] = "MySqlVarChar";
|
|
22
|
-
length = this.config.length;
|
|
23
22
|
enumValues = this.config.enum;
|
|
24
23
|
getSQLType() {
|
|
25
|
-
return
|
|
24
|
+
return `varchar(${this.length})`;
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
27
|
function varchar(a, b) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/mysql-core/columns/varchar.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../../../src/mysql-core/columns/varchar.ts"],"sourcesContent":["import type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { MySqlTable } from '~/mysql-core/table.ts';\nimport { type Equal, getColumnNameAndConfig, type Writable } from '~/utils.ts';\nimport { MySqlColumn, MySqlColumnBuilder } from './common.ts';\n\nexport class MySqlVarCharBuilder<\n\tTEnum extends [string, ...string[]],\n> extends MySqlColumnBuilder<{\n\tname: string;\n\tdataType: Equal<TEnum, [string, ...string[]]> extends true ? 'string text' : 'string enum';\n\tdata: TEnum[number];\n\tdriverParam: number | string;\n\tenumValues: TEnum;\n}, MySqlVarCharConfig<TEnum>> {\n\tstatic override readonly [entityKind]: string = 'MySqlVarCharBuilder';\n\n\t/** @internal */\n\tconstructor(name: string, config: MySqlVarCharConfig<TEnum>) {\n\t\tsuper(name, config.enum?.length ? 'string enum' : 'string text', 'MySqlVarChar');\n\t\tthis.config.length = config.length;\n\t\tthis.config.enum = config.enum;\n\t}\n\n\t/** @internal */\n\toverride build(table: MySqlTable) {\n\t\treturn new MySqlVarChar(\n\t\t\ttable,\n\t\t\tthis.config as any,\n\t\t);\n\t}\n}\n\nexport class MySqlVarChar<\n\tT extends ColumnBaseConfig<'string' | 'string enum'> & { length: number },\n> extends MySqlColumn<T, MySqlVarCharConfig<T['enumValues']>> {\n\tstatic override readonly [entityKind]: string = 'MySqlVarChar';\n\n\toverride readonly enumValues = this.config.enum;\n\n\tgetSQLType(): string {\n\t\treturn `varchar(${this.length})`;\n\t}\n}\n\nexport interface MySqlVarCharConfig<\n\tTEnum extends string[] | readonly string[] | undefined = string[] | readonly string[] | undefined,\n> {\n\tenum?: TEnum;\n\tlength: number;\n}\n\nexport function varchar<U extends string, T extends Readonly<[U, ...U[]]>>(\n\tconfig: MySqlVarCharConfig<T | Writable<T>>,\n): MySqlVarCharBuilder<Writable<T>>;\nexport function varchar<\n\tU extends string,\n\tT extends Readonly<[U, ...U[]]>,\n>(\n\tname: string,\n\tconfig: MySqlVarCharConfig<T | Writable<T>>,\n): MySqlVarCharBuilder<Writable<T>>;\nexport function varchar(a?: string | MySqlVarCharConfig, b?: MySqlVarCharConfig): any {\n\tconst { name, config } = getColumnNameAndConfig<MySqlVarCharConfig>(a, b);\n\treturn new MySqlVarCharBuilder(name, config as any);\n}\n"],"mappings":"AACA,SAAS,kBAAkB;AAE3B,SAAqB,8BAA6C;AAClE,SAAS,aAAa,0BAA0B;AAEzC,MAAM,4BAEH,mBAMoB;AAAA,EAC7B,QAA0B,UAAU,IAAY;AAAA;AAAA,EAGhD,YAAY,MAAc,QAAmC;AAC5D,UAAM,MAAM,OAAO,MAAM,SAAS,gBAAgB,eAAe,cAAc;AAC/E,SAAK,OAAO,SAAS,OAAO;AAC5B,SAAK,OAAO,OAAO,OAAO;AAAA,EAC3B;AAAA;AAAA,EAGS,MAAM,OAAmB;AACjC,WAAO,IAAI;AAAA,MACV;AAAA,MACA,KAAK;AAAA,IACN;AAAA,EACD;AACD;AAEO,MAAM,qBAEH,YAAoD;AAAA,EAC7D,QAA0B,UAAU,IAAY;AAAA,EAE9B,aAAa,KAAK,OAAO;AAAA,EAE3C,aAAqB;AACpB,WAAO,WAAW,KAAK,MAAM;AAAA,EAC9B;AACD;AAmBO,SAAS,QAAQ,GAAiC,GAA6B;AACrF,QAAM,EAAE,MAAM,OAAO,IAAI,uBAA2C,GAAG,CAAC;AACxE,SAAO,IAAI,oBAAoB,MAAM,MAAa;AACnD;","names":[]}
|
|
@@ -28,7 +28,7 @@ var import_common = require("./common.cjs");
|
|
|
28
28
|
class MySqlYearBuilder extends import_common.MySqlColumnBuilder {
|
|
29
29
|
static [import_entity.entityKind] = "MySqlYearBuilder";
|
|
30
30
|
constructor(name) {
|
|
31
|
-
super(name, "number", "MySqlYear");
|
|
31
|
+
super(name, "number year", "MySqlYear");
|
|
32
32
|
}
|
|
33
33
|
/** @internal */
|
|
34
34
|
build(table) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/mysql-core/columns/year.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../../../src/mysql-core/columns/year.ts"],"sourcesContent":["import type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { MySqlTable } from '~/mysql-core/table.ts';\nimport { MySqlColumn, MySqlColumnBuilder } from './common.ts';\n\nexport class MySqlYearBuilder extends MySqlColumnBuilder<{\n\tname: string;\n\tdataType: 'number year';\n\tdata: number;\n\tdriverParam: number;\n}> {\n\tstatic override readonly [entityKind]: string = 'MySqlYearBuilder';\n\n\tconstructor(name: string) {\n\t\tsuper(name, 'number year', 'MySqlYear');\n\t}\n\n\t/** @internal */\n\toverride build(table: MySqlTable) {\n\t\treturn new MySqlYear(table, this.config as any);\n\t}\n}\n\nexport class MySqlYear<\n\tT extends ColumnBaseConfig<'number year'>,\n> extends MySqlColumn<T> {\n\tstatic override readonly [entityKind]: string = 'MySqlYear';\n\n\tgetSQLType(): string {\n\t\treturn `year`;\n\t}\n}\n\nexport function year(name?: string): MySqlYearBuilder {\n\treturn new MySqlYearBuilder(name ?? '');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAA2B;AAE3B,oBAAgD;AAEzC,MAAM,yBAAyB,iCAKnC;AAAA,EACF,QAA0B,wBAAU,IAAY;AAAA,EAEhD,YAAY,MAAc;AACzB,UAAM,MAAM,eAAe,WAAW;AAAA,EACvC;AAAA;AAAA,EAGS,MAAM,OAAmB;AACjC,WAAO,IAAI,UAAU,OAAO,KAAK,MAAa;AAAA,EAC/C;AACD;AAEO,MAAM,kBAEH,0BAAe;AAAA,EACxB,QAA0B,wBAAU,IAAY;AAAA,EAEhD,aAAqB;AACpB,WAAO;AAAA,EACR;AACD;AAEO,SAAS,KAAK,MAAiC;AACrD,SAAO,IAAI,iBAAiB,QAAQ,EAAE;AACvC;","names":[]}
|
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
import type { ColumnBuilderBaseConfig } from "../../column-builder.cjs";
|
|
2
1
|
import type { ColumnBaseConfig } from "../../column.cjs";
|
|
3
2
|
import { entityKind } from "../../entity.cjs";
|
|
4
3
|
import { MySqlColumn, MySqlColumnBuilder } from "./common.cjs";
|
|
5
|
-
export
|
|
6
|
-
name:
|
|
7
|
-
dataType: 'number';
|
|
8
|
-
columnType: 'MySqlYear';
|
|
4
|
+
export declare class MySqlYearBuilder extends MySqlColumnBuilder<{
|
|
5
|
+
name: string;
|
|
6
|
+
dataType: 'number year';
|
|
9
7
|
data: number;
|
|
10
8
|
driverParam: number;
|
|
11
|
-
|
|
12
|
-
}>;
|
|
13
|
-
export declare class MySqlYearBuilder<T extends ColumnBuilderBaseConfig<'number', 'MySqlYear'>> extends MySqlColumnBuilder<T> {
|
|
9
|
+
}> {
|
|
14
10
|
static readonly [entityKind]: string;
|
|
15
|
-
constructor(name:
|
|
11
|
+
constructor(name: string);
|
|
16
12
|
}
|
|
17
|
-
export declare class MySqlYear<T extends ColumnBaseConfig<'number
|
|
13
|
+
export declare class MySqlYear<T extends ColumnBaseConfig<'number year'>> extends MySqlColumn<T> {
|
|
18
14
|
static readonly [entityKind]: string;
|
|
19
15
|
getSQLType(): string;
|
|
20
16
|
}
|
|
21
|
-
export declare function year():
|
|
22
|
-
export declare function year<TName extends string>(name: TName): MySqlYearBuilderInitial<TName>;
|
|
17
|
+
export declare function year(name?: string): MySqlYearBuilder;
|
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
import type { ColumnBuilderBaseConfig } from "../../column-builder.js";
|
|
2
1
|
import type { ColumnBaseConfig } from "../../column.js";
|
|
3
2
|
import { entityKind } from "../../entity.js";
|
|
4
3
|
import { MySqlColumn, MySqlColumnBuilder } from "./common.js";
|
|
5
|
-
export
|
|
6
|
-
name:
|
|
7
|
-
dataType: 'number';
|
|
8
|
-
columnType: 'MySqlYear';
|
|
4
|
+
export declare class MySqlYearBuilder extends MySqlColumnBuilder<{
|
|
5
|
+
name: string;
|
|
6
|
+
dataType: 'number year';
|
|
9
7
|
data: number;
|
|
10
8
|
driverParam: number;
|
|
11
|
-
|
|
12
|
-
}>;
|
|
13
|
-
export declare class MySqlYearBuilder<T extends ColumnBuilderBaseConfig<'number', 'MySqlYear'>> extends MySqlColumnBuilder<T> {
|
|
9
|
+
}> {
|
|
14
10
|
static readonly [entityKind]: string;
|
|
15
|
-
constructor(name:
|
|
11
|
+
constructor(name: string);
|
|
16
12
|
}
|
|
17
|
-
export declare class MySqlYear<T extends ColumnBaseConfig<'number
|
|
13
|
+
export declare class MySqlYear<T extends ColumnBaseConfig<'number year'>> extends MySqlColumn<T> {
|
|
18
14
|
static readonly [entityKind]: string;
|
|
19
15
|
getSQLType(): string;
|
|
20
16
|
}
|
|
21
|
-
export declare function year():
|
|
22
|
-
export declare function year<TName extends string>(name: TName): MySqlYearBuilderInitial<TName>;
|
|
17
|
+
export declare function year(name?: string): MySqlYearBuilder;
|
|
@@ -3,7 +3,7 @@ import { MySqlColumn, MySqlColumnBuilder } from "./common.js";
|
|
|
3
3
|
class MySqlYearBuilder extends MySqlColumnBuilder {
|
|
4
4
|
static [entityKind] = "MySqlYearBuilder";
|
|
5
5
|
constructor(name) {
|
|
6
|
-
super(name, "number", "MySqlYear");
|
|
6
|
+
super(name, "number year", "MySqlYear");
|
|
7
7
|
}
|
|
8
8
|
/** @internal */
|
|
9
9
|
build(table) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/mysql-core/columns/year.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../../../src/mysql-core/columns/year.ts"],"sourcesContent":["import type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { MySqlTable } from '~/mysql-core/table.ts';\nimport { MySqlColumn, MySqlColumnBuilder } from './common.ts';\n\nexport class MySqlYearBuilder extends MySqlColumnBuilder<{\n\tname: string;\n\tdataType: 'number year';\n\tdata: number;\n\tdriverParam: number;\n}> {\n\tstatic override readonly [entityKind]: string = 'MySqlYearBuilder';\n\n\tconstructor(name: string) {\n\t\tsuper(name, 'number year', 'MySqlYear');\n\t}\n\n\t/** @internal */\n\toverride build(table: MySqlTable) {\n\t\treturn new MySqlYear(table, this.config as any);\n\t}\n}\n\nexport class MySqlYear<\n\tT extends ColumnBaseConfig<'number year'>,\n> extends MySqlColumn<T> {\n\tstatic override readonly [entityKind]: string = 'MySqlYear';\n\n\tgetSQLType(): string {\n\t\treturn `year`;\n\t}\n}\n\nexport function year(name?: string): MySqlYearBuilder {\n\treturn new MySqlYearBuilder(name ?? '');\n}\n"],"mappings":"AACA,SAAS,kBAAkB;AAE3B,SAAS,aAAa,0BAA0B;AAEzC,MAAM,yBAAyB,mBAKnC;AAAA,EACF,QAA0B,UAAU,IAAY;AAAA,EAEhD,YAAY,MAAc;AACzB,UAAM,MAAM,eAAe,WAAW;AAAA,EACvC;AAAA;AAAA,EAGS,MAAM,OAAmB;AACjC,WAAO,IAAI,UAAU,OAAO,KAAK,MAAa;AAAA,EAC/C;AACD;AAEO,MAAM,kBAEH,YAAe;AAAA,EACxB,QAA0B,UAAU,IAAY;AAAA,EAEhD,aAAqB;AACpB,WAAO;AAAA,EACR;AACD;AAEO,SAAS,KAAK,MAAiC;AACrD,SAAO,IAAI,iBAAiB,QAAQ,EAAE;AACvC;","names":[]}
|
package/mysql-core/db.cjs
CHANGED
|
@@ -35,17 +35,16 @@ class MySqlDatabase {
|
|
|
35
35
|
this.dialect = dialect;
|
|
36
36
|
this.session = session;
|
|
37
37
|
this.mode = mode;
|
|
38
|
-
const rel = relations ?? {};
|
|
39
38
|
this._ = schema ? {
|
|
40
39
|
schema: schema.schema,
|
|
41
40
|
fullSchema: schema.fullSchema,
|
|
42
41
|
tableNamesMap: schema.tableNamesMap,
|
|
43
|
-
relations
|
|
42
|
+
relations
|
|
44
43
|
} : {
|
|
45
44
|
schema: void 0,
|
|
46
45
|
fullSchema: {},
|
|
47
46
|
tableNamesMap: {},
|
|
48
|
-
relations
|
|
47
|
+
relations
|
|
49
48
|
};
|
|
50
49
|
this._query = {};
|
|
51
50
|
if (this._.schema) {
|
|
@@ -63,32 +62,14 @@ class MySqlDatabase {
|
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
64
|
this.query = {};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
dialect,
|
|
75
|
-
session
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
this.query = {};
|
|
80
|
-
if (relations) {
|
|
81
|
-
for (const [tableName, relation] of Object.entries(relations.tablesConfig)) {
|
|
82
|
-
this.query[tableName] = new import_query2.RelationalQueryBuilder(
|
|
83
|
-
relations.tables,
|
|
84
|
-
relations.tablesConfig,
|
|
85
|
-
relations.tableNamesMap,
|
|
86
|
-
relation.table,
|
|
87
|
-
relation,
|
|
88
|
-
dialect,
|
|
89
|
-
session
|
|
90
|
-
);
|
|
91
|
-
}
|
|
65
|
+
for (const [tableName, relation] of Object.entries(relations)) {
|
|
66
|
+
this.query[tableName] = new import_query2.RelationalQueryBuilder(
|
|
67
|
+
relations,
|
|
68
|
+
relations[relation.name].table,
|
|
69
|
+
relation,
|
|
70
|
+
dialect,
|
|
71
|
+
session
|
|
72
|
+
);
|
|
92
73
|
}
|
|
93
74
|
this.$cache = { invalidate: async (_params) => {
|
|
94
75
|
} };
|
package/mysql-core/db.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/mysql-core/db.ts"],"sourcesContent":["import type { ResultSetHeader } from 'mysql2/promise';\nimport type * as V1 from '~/_relations.ts';\nimport type { Cache } from '~/cache/core/cache.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { TypedQueryBuilder } from '~/query-builders/query-builder.ts';\nimport type { AnyRelations, EmptyRelations, ExtractTablesWithRelations, TablesRelationalConfig } from '~/relations.ts';\nimport { SelectionProxyHandler } from '~/selection-proxy.ts';\nimport { type ColumnsSelection, type SQL, sql, type SQLWrapper } from '~/sql/sql.ts';\nimport { WithSubquery } from '~/subquery.ts';\nimport type { DrizzleTypeError } from '~/utils.ts';\nimport type { MySqlDialect } from './dialect.ts';\nimport { _RelationalQueryBuilder } from './query-builders/_query.ts';\nimport { MySqlCountBuilder } from './query-builders/count.ts';\nimport {\n\tMySqlDeleteBase,\n\tMySqlInsertBuilder,\n\tMySqlSelectBuilder,\n\tMySqlUpdateBuilder,\n\tQueryBuilder,\n} from './query-builders/index.ts';\nimport { RelationalQueryBuilder } from './query-builders/query.ts';\nimport type { SelectedFields } from './query-builders/select.types.ts';\nimport type {\n\tMode,\n\tMySqlQueryResultHKT,\n\tMySqlQueryResultKind,\n\tMySqlSession,\n\tMySqlTransaction,\n\tMySqlTransactionConfig,\n\tPreparedQueryHKTBase,\n} from './session.ts';\nimport type { WithBuilder } from './subquery.ts';\nimport type { MySqlTable } from './table.ts';\nimport type { MySqlViewBase } from './view-base.ts';\n\nexport class MySqlDatabase<\n\tTQueryResult extends MySqlQueryResultHKT,\n\tTPreparedQueryHKT extends PreparedQueryHKTBase,\n\tTFullSchema extends Record<string, unknown> = Record<string, never>,\n\tTRelations extends AnyRelations = EmptyRelations,\n\tTTablesConfig extends TablesRelationalConfig = ExtractTablesWithRelations<TRelations>,\n\tTSchema extends V1.TablesRelationalConfig = V1.ExtractTablesWithRelations<TFullSchema>,\n> {\n\tstatic readonly [entityKind]: string = 'MySqlDatabase';\n\n\tdeclare readonly _: {\n\t\treadonly schema: TSchema | undefined;\n\t\treadonly fullSchema: TFullSchema;\n\t\treadonly relations: TRelations;\n\t\treadonly tableNamesMap: Record<string, string>;\n\t};\n\n\t/** @deprecated */\n\t_query: TFullSchema extends Record<string, never>\n\t\t? DrizzleTypeError<'Seems like the schema generic is missing - did you forget to add it to your DB type?'>\n\t\t: {\n\t\t\t[K in keyof TSchema]: _RelationalQueryBuilder<TPreparedQueryHKT, TSchema, TSchema[K]>;\n\t\t};\n\n\t// TO-DO: Figure out how to pass DrizzleTypeError without breaking withReplicas\n\tquery: {\n\t\t[K in keyof TRelations['tables']]: RelationalQueryBuilder<\n\t\t\tTPreparedQueryHKT,\n\t\t\tTTablesConfig,\n\t\t\tTTablesConfig[K]\n\t\t>;\n\t};\n\n\tconstructor(\n\t\t/** @internal */\n\t\treadonly dialect: MySqlDialect,\n\t\t/** @internal */\n\t\treadonly session: MySqlSession<any, any, any, any, any, any>,\n\t\trelations: AnyRelations | undefined,\n\t\tschema: V1.RelationalSchemaConfig<TSchema> | undefined,\n\t\tprotected readonly mode: Mode,\n\t) {\n\t\tconst rel = relations ?? {} as EmptyRelations;\n\n\t\tthis._ = schema\n\t\t\t? {\n\t\t\t\tschema: schema.schema,\n\t\t\t\tfullSchema: schema.fullSchema as TFullSchema,\n\t\t\t\ttableNamesMap: schema.tableNamesMap,\n\t\t\t\trelations: rel as TRelations,\n\t\t\t}\n\t\t\t: {\n\t\t\t\tschema: undefined,\n\t\t\t\tfullSchema: {} as TFullSchema,\n\t\t\t\ttableNamesMap: {},\n\t\t\t\trelations: rel as TRelations,\n\t\t\t};\n\t\tthis._query = {} as typeof this['_query'];\n\t\tif (this._.schema) {\n\t\t\tfor (const [tableName, columns] of Object.entries(this._.schema)) {\n\t\t\t\t(this._query as MySqlDatabase<TQueryResult, TPreparedQueryHKT, Record<string, any>>['_query'])[tableName] =\n\t\t\t\t\tnew _RelationalQueryBuilder(\n\t\t\t\t\t\tschema!.fullSchema,\n\t\t\t\t\t\tthis._.schema,\n\t\t\t\t\t\tthis._.tableNamesMap,\n\t\t\t\t\t\tschema!.fullSchema[tableName] as MySqlTable,\n\t\t\t\t\t\tcolumns,\n\t\t\t\t\t\tdialect,\n\t\t\t\t\t\tsession,\n\t\t\t\t\t\tthis.mode,\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthis.query = {} as typeof this['query'];\n\t\tif (relations) {\n\t\t\tfor (const [tableName, relation] of Object.entries(relations.tablesConfig)) {\n\t\t\t\t(this.query as MySqlDatabase<\n\t\t\t\t\tTQueryResult,\n\t\t\t\t\tTPreparedQueryHKT,\n\t\t\t\t\tTSchema,\n\t\t\t\t\tAnyRelations,\n\t\t\t\t\tTablesRelationalConfig,\n\t\t\t\t\tV1.TablesRelationalConfig\n\t\t\t\t>['query'])[\n\t\t\t\t\ttableName\n\t\t\t\t] = new RelationalQueryBuilder(\n\t\t\t\t\trelations.tables,\n\t\t\t\t\trelations.tablesConfig,\n\t\t\t\t\trelations.tableNamesMap,\n\t\t\t\t\trelation.table as MySqlTable,\n\t\t\t\t\trelation,\n\t\t\t\t\tdialect,\n\t\t\t\t\tsession,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthis.query = {} as typeof this['query'];\n\t\tif (relations) {\n\t\t\tfor (const [tableName, relation] of Object.entries(relations.tablesConfig)) {\n\t\t\t\t(this.query as MySqlDatabase<\n\t\t\t\t\tTQueryResult,\n\t\t\t\t\tTPreparedQueryHKT,\n\t\t\t\t\tTSchema,\n\t\t\t\t\tAnyRelations,\n\t\t\t\t\tTablesRelationalConfig,\n\t\t\t\t\tV1.TablesRelationalConfig\n\t\t\t\t>['query'])[\n\t\t\t\t\ttableName\n\t\t\t\t] = new RelationalQueryBuilder(\n\t\t\t\t\trelations.tables,\n\t\t\t\t\trelations.tablesConfig,\n\t\t\t\t\trelations.tableNamesMap,\n\t\t\t\t\trelation.table as MySqlTable,\n\t\t\t\t\trelation,\n\t\t\t\t\tdialect,\n\t\t\t\t\tsession,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tthis.$cache = { invalidate: async (_params: any) => {} };\n\t}\n\n\t/**\n\t * Creates a subquery that defines a temporary named result set as a CTE.\n\t *\n\t * It is useful for breaking down complex queries into simpler parts and for reusing the result set in subsequent parts of the query.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#with-clause}\n\t *\n\t * @param alias The alias for the subquery.\n\t *\n\t * Failure to provide an alias will result in a DrizzleTypeError, preventing the subquery from being referenced in other queries.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Create a subquery with alias 'sq' and use it in the select query\n\t * const sq = db.$with('sq').as(db.select().from(users).where(eq(users.id, 42)));\n\t *\n\t * const result = await db.with(sq).select().from(sq);\n\t * ```\n\t *\n\t * To select arbitrary SQL values as fields in a CTE and reference them in other CTEs or in the main query, you need to add aliases to them:\n\t *\n\t * ```ts\n\t * // Select an arbitrary SQL value as a field in a CTE and reference it in the main query\n\t * const sq = db.$with('sq').as(db.select({\n\t * name: sql<string>`upper(${users.name})`.as('name'),\n\t * })\n\t * .from(users));\n\t *\n\t * const result = await db.with(sq).select({ name: sq.name }).from(sq);\n\t * ```\n\t */\n\t$with: WithBuilder = (alias: string, selection?: ColumnsSelection) => {\n\t\tconst self = this;\n\t\tconst as = (\n\t\t\tqb:\n\t\t\t\t| TypedQueryBuilder<ColumnsSelection | undefined>\n\t\t\t\t| SQL\n\t\t\t\t| ((qb: QueryBuilder) => TypedQueryBuilder<ColumnsSelection | undefined> | SQL),\n\t\t) => {\n\t\t\tif (typeof qb === 'function') {\n\t\t\t\tqb = qb(new QueryBuilder(self.dialect));\n\t\t\t}\n\n\t\t\treturn new Proxy(\n\t\t\t\tnew WithSubquery(\n\t\t\t\t\tqb.getSQL(),\n\t\t\t\t\tselection ?? ('getSelectedFields' in qb ? qb.getSelectedFields() ?? {} : {}) as SelectedFields,\n\t\t\t\t\talias,\n\t\t\t\t\ttrue,\n\t\t\t\t),\n\t\t\t\tnew SelectionProxyHandler({ alias, sqlAliasedBehavior: 'alias', sqlBehavior: 'error' }),\n\t\t\t);\n\t\t};\n\t\treturn { as };\n\t};\n\n\t$count(\n\t\tsource: MySqlTable | MySqlViewBase | SQL | SQLWrapper,\n\t\tfilters?: SQL<unknown>,\n\t) {\n\t\treturn new MySqlCountBuilder({ source, filters, session: this.session });\n\t}\n\n\t$cache: { invalidate: Cache['onMutate'] };\n\n\t/**\n\t * Incorporates a previously defined CTE (using `$with`) into the main query.\n\t *\n\t * This method allows the main query to reference a temporary named result set.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#with-clause}\n\t *\n\t * @param queries The CTEs to incorporate into the main query.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Define a subquery 'sq' as a CTE using $with\n\t * const sq = db.$with('sq').as(db.select().from(users).where(eq(users.id, 42)));\n\t *\n\t * // Incorporate the CTE 'sq' into the main query and select from it\n\t * const result = await db.with(sq).select().from(sq);\n\t * ```\n\t */\n\twith(...queries: WithSubquery[]) {\n\t\tconst self = this;\n\n\t\t/**\n\t\t * Creates a select query.\n\t\t *\n\t\t * Calling this method with no arguments will select all columns from the table. Pass a selection object to specify the columns you want to select.\n\t\t *\n\t\t * Use `.from()` method to specify which table to select from.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/select}\n\t\t *\n\t\t * @param fields The selection object.\n\t\t *\n\t\t * @example\n\t\t *\n\t\t * ```ts\n\t\t * // Select all columns and all rows from the 'cars' table\n\t\t * const allCars: Car[] = await db.select().from(cars);\n\t\t *\n\t\t * // Select specific columns and all rows from the 'cars' table\n\t\t * const carsIdsAndBrands: { id: number; brand: string }[] = await db.select({\n\t\t * id: cars.id,\n\t\t * brand: cars.brand\n\t\t * })\n\t\t * .from(cars);\n\t\t * ```\n\t\t *\n\t\t * Like in SQL, you can use arbitrary expressions as selection fields, not just table columns:\n\t\t *\n\t\t * ```ts\n\t\t * // Select specific columns along with expression and all rows from the 'cars' table\n\t\t * const carsIdsAndLowerNames: { id: number; lowerBrand: string }[] = await db.select({\n\t\t * id: cars.id,\n\t\t * lowerBrand: sql<string>`lower(${cars.brand})`,\n\t\t * })\n\t\t * .from(cars);\n\t\t * ```\n\t\t */\n\t\tfunction select(): MySqlSelectBuilder<undefined, TPreparedQueryHKT>;\n\t\tfunction select<TSelection extends SelectedFields>(\n\t\t\tfields: TSelection,\n\t\t): MySqlSelectBuilder<TSelection, TPreparedQueryHKT>;\n\t\tfunction select(fields?: SelectedFields): MySqlSelectBuilder<SelectedFields | undefined, TPreparedQueryHKT> {\n\t\t\treturn new MySqlSelectBuilder({\n\t\t\t\tfields: fields ?? undefined,\n\t\t\t\tsession: self.session,\n\t\t\t\tdialect: self.dialect,\n\t\t\t\twithList: queries,\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Adds `distinct` expression to the select query.\n\t\t *\n\t\t * Calling this method will return only unique values. When multiple columns are selected, it returns rows with unique combinations of values in these columns.\n\t\t *\n\t\t * Use `.from()` method to specify which table to select from.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/select#distinct}\n\t\t *\n\t\t * @param fields The selection object.\n\t\t *\n\t\t * @example\n\t\t * ```ts\n\t\t * // Select all unique rows from the 'cars' table\n\t\t * await db.selectDistinct()\n\t\t * .from(cars)\n\t\t * .orderBy(cars.id, cars.brand, cars.color);\n\t\t *\n\t\t * // Select all unique brands from the 'cars' table\n\t\t * await db.selectDistinct({ brand: cars.brand })\n\t\t * .from(cars)\n\t\t * .orderBy(cars.brand);\n\t\t * ```\n\t\t */\n\t\tfunction selectDistinct(): MySqlSelectBuilder<undefined, TPreparedQueryHKT>;\n\t\tfunction selectDistinct<TSelection extends SelectedFields>(\n\t\t\tfields: TSelection,\n\t\t): MySqlSelectBuilder<TSelection, TPreparedQueryHKT>;\n\t\tfunction selectDistinct(\n\t\t\tfields?: SelectedFields,\n\t\t): MySqlSelectBuilder<SelectedFields | undefined, TPreparedQueryHKT> {\n\t\t\treturn new MySqlSelectBuilder({\n\t\t\t\tfields: fields ?? undefined,\n\t\t\t\tsession: self.session,\n\t\t\t\tdialect: self.dialect,\n\t\t\t\twithList: queries,\n\t\t\t\tdistinct: true,\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Creates an update query.\n\t\t *\n\t\t * Calling this method without `.where()` clause will update all rows in a table. The `.where()` clause specifies which rows should be updated.\n\t\t *\n\t\t * Use `.set()` method to specify which values to update.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/update}\n\t\t *\n\t\t * @param table The table to update.\n\t\t *\n\t\t * @example\n\t\t *\n\t\t * ```ts\n\t\t * // Update all rows in the 'cars' table\n\t\t * await db.update(cars).set({ color: 'red' });\n\t\t *\n\t\t * // Update rows with filters and conditions\n\t\t * await db.update(cars).set({ color: 'red' }).where(eq(cars.brand, 'BMW'));\n\t\t * ```\n\t\t */\n\t\tfunction update<TTable extends MySqlTable>(\n\t\t\ttable: TTable,\n\t\t): MySqlUpdateBuilder<TTable, TQueryResult, TPreparedQueryHKT> {\n\t\t\treturn new MySqlUpdateBuilder(table, self.session, self.dialect, queries);\n\t\t}\n\n\t\t/**\n\t\t * Creates a delete query.\n\t\t *\n\t\t * Calling this method without `.where()` clause will delete all rows in a table. The `.where()` clause specifies which rows should be deleted.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/delete}\n\t\t *\n\t\t * @param table The table to delete from.\n\t\t *\n\t\t * @example\n\t\t *\n\t\t * ```ts\n\t\t * // Delete all rows in the 'cars' table\n\t\t * await db.delete(cars);\n\t\t *\n\t\t * // Delete rows with filters and conditions\n\t\t * await db.delete(cars).where(eq(cars.color, 'green'));\n\t\t * ```\n\t\t */\n\t\tfunction delete_<TTable extends MySqlTable>(\n\t\t\ttable: TTable,\n\t\t): MySqlDeleteBase<TTable, TQueryResult, TPreparedQueryHKT> {\n\t\t\treturn new MySqlDeleteBase(table, self.session, self.dialect, queries);\n\t\t}\n\n\t\treturn { select, selectDistinct, update, delete: delete_ };\n\t}\n\n\t/**\n\t * Creates a select query.\n\t *\n\t * Calling this method with no arguments will select all columns from the table. Pass a selection object to specify the columns you want to select.\n\t *\n\t * Use `.from()` method to specify which table to select from.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select}\n\t *\n\t * @param fields The selection object.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Select all columns and all rows from the 'cars' table\n\t * const allCars: Car[] = await db.select().from(cars);\n\t *\n\t * // Select specific columns and all rows from the 'cars' table\n\t * const carsIdsAndBrands: { id: number; brand: string }[] = await db.select({\n\t * id: cars.id,\n\t * brand: cars.brand\n\t * })\n\t * .from(cars);\n\t * ```\n\t *\n\t * Like in SQL, you can use arbitrary expressions as selection fields, not just table columns:\n\t *\n\t * ```ts\n\t * // Select specific columns along with expression and all rows from the 'cars' table\n\t * const carsIdsAndLowerNames: { id: number; lowerBrand: string }[] = await db.select({\n\t * id: cars.id,\n\t * lowerBrand: sql<string>`lower(${cars.brand})`,\n\t * })\n\t * .from(cars);\n\t * ```\n\t */\n\tselect(): MySqlSelectBuilder<undefined, TPreparedQueryHKT>;\n\tselect<TSelection extends SelectedFields>(fields: TSelection): MySqlSelectBuilder<TSelection, TPreparedQueryHKT>;\n\tselect(fields?: SelectedFields): MySqlSelectBuilder<SelectedFields | undefined, TPreparedQueryHKT> {\n\t\treturn new MySqlSelectBuilder({ fields: fields ?? undefined, session: this.session, dialect: this.dialect });\n\t}\n\n\t/**\n\t * Adds `distinct` expression to the select query.\n\t *\n\t * Calling this method will return only unique values. When multiple columns are selected, it returns rows with unique combinations of values in these columns.\n\t *\n\t * Use `.from()` method to specify which table to select from.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#distinct}\n\t *\n\t * @param fields The selection object.\n\t *\n\t * @example\n\t * ```ts\n\t * // Select all unique rows from the 'cars' table\n\t * await db.selectDistinct()\n\t * .from(cars)\n\t * .orderBy(cars.id, cars.brand, cars.color);\n\t *\n\t * // Select all unique brands from the 'cars' table\n\t * await db.selectDistinct({ brand: cars.brand })\n\t * .from(cars)\n\t * .orderBy(cars.brand);\n\t * ```\n\t */\n\tselectDistinct(): MySqlSelectBuilder<undefined, TPreparedQueryHKT>;\n\tselectDistinct<TSelection extends SelectedFields>(\n\t\tfields: TSelection,\n\t): MySqlSelectBuilder<TSelection, TPreparedQueryHKT>;\n\tselectDistinct(fields?: SelectedFields): MySqlSelectBuilder<SelectedFields | undefined, TPreparedQueryHKT> {\n\t\treturn new MySqlSelectBuilder({\n\t\t\tfields: fields ?? undefined,\n\t\t\tsession: this.session,\n\t\t\tdialect: this.dialect,\n\t\t\tdistinct: true,\n\t\t});\n\t}\n\n\t/**\n\t * Creates an update query.\n\t *\n\t * Calling this method without `.where()` clause will update all rows in a table. The `.where()` clause specifies which rows should be updated.\n\t *\n\t * Use `.set()` method to specify which values to update.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/update}\n\t *\n\t * @param table The table to update.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Update all rows in the 'cars' table\n\t * await db.update(cars).set({ color: 'red' });\n\t *\n\t * // Update rows with filters and conditions\n\t * await db.update(cars).set({ color: 'red' }).where(eq(cars.brand, 'BMW'));\n\t * ```\n\t */\n\tupdate<TTable extends MySqlTable>(table: TTable): MySqlUpdateBuilder<TTable, TQueryResult, TPreparedQueryHKT> {\n\t\treturn new MySqlUpdateBuilder(table, this.session, this.dialect);\n\t}\n\n\t/**\n\t * Creates an insert query.\n\t *\n\t * Calling this method will create new rows in a table. Use `.values()` method to specify which values to insert.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/insert}\n\t *\n\t * @param table The table to insert into.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Insert one row\n\t * await db.insert(cars).values({ brand: 'BMW' });\n\t *\n\t * // Insert multiple rows\n\t * await db.insert(cars).values([{ brand: 'BMW' }, { brand: 'Porsche' }]);\n\t * ```\n\t */\n\tinsert<TTable extends MySqlTable>(table: TTable): MySqlInsertBuilder<TTable, TQueryResult, TPreparedQueryHKT> {\n\t\treturn new MySqlInsertBuilder(table, this.session, this.dialect);\n\t}\n\n\t/**\n\t * Creates a delete query.\n\t *\n\t * Calling this method without `.where()` clause will delete all rows in a table. The `.where()` clause specifies which rows should be deleted.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/delete}\n\t *\n\t * @param table The table to delete from.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Delete all rows in the 'cars' table\n\t * await db.delete(cars);\n\t *\n\t * // Delete rows with filters and conditions\n\t * await db.delete(cars).where(eq(cars.color, 'green'));\n\t * ```\n\t */\n\tdelete<TTable extends MySqlTable>(table: TTable): MySqlDeleteBase<TTable, TQueryResult, TPreparedQueryHKT> {\n\t\treturn new MySqlDeleteBase(table, this.session, this.dialect);\n\t}\n\n\texecute<T extends { [column: string]: any } = ResultSetHeader>(\n\t\tquery: SQLWrapper | string,\n\t): Promise<MySqlQueryResultKind<TQueryResult, T>> {\n\t\treturn this.session.execute(typeof query === 'string' ? sql.raw(query) : query.getSQL());\n\t}\n\n\ttransaction<T>(\n\t\ttransaction: (\n\t\t\ttx: MySqlTransaction<TQueryResult, TPreparedQueryHKT, TFullSchema, TRelations, TTablesConfig, TSchema>,\n\t\t\tconfig?: MySqlTransactionConfig,\n\t\t) => Promise<T>,\n\t\tconfig?: MySqlTransactionConfig,\n\t): Promise<T> {\n\t\treturn this.session.transaction(transaction, config);\n\t}\n}\n\nexport type MySQLWithReplicas<Q> = Q & { $primary: Q };\n\nexport const withReplicas = <\n\tHKT extends MySqlQueryResultHKT,\n\tTPreparedQueryHKT extends PreparedQueryHKTBase,\n\tTFullSchema extends Record<string, unknown>,\n\tTRelations extends AnyRelations,\n\tTTablesConfig extends TablesRelationalConfig,\n\tTSchema extends V1.TablesRelationalConfig,\n\tQ extends MySqlDatabase<\n\t\tHKT,\n\t\tTPreparedQueryHKT,\n\t\tTFullSchema,\n\t\tTRelations,\n\t\tTTablesConfig,\n\t\tTSchema extends Record<string, unknown> ? V1.ExtractTablesWithRelations<TFullSchema> : TSchema\n\t>,\n>(\n\tprimary: Q,\n\treplicas: [Q, ...Q[]],\n\tgetReplica: (replicas: Q[]) => Q = () => replicas[Math.floor(Math.random() * replicas.length)]!,\n): MySQLWithReplicas<Q> => {\n\tconst select: Q['select'] = (...args: []) => getReplica(replicas).select(...args);\n\tconst selectDistinct: Q['selectDistinct'] = (...args: []) => getReplica(replicas).selectDistinct(...args);\n\tconst $count: Q['$count'] = (...args: [any]) => getReplica(replicas).$count(...args);\n\tconst $with: Q['with'] = (...args: []) => getReplica(replicas).with(...args);\n\n\tconst update: Q['update'] = (...args: [any]) => primary.update(...args);\n\tconst insert: Q['insert'] = (...args: [any]) => primary.insert(...args);\n\tconst $delete: Q['delete'] = (...args: [any]) => primary.delete(...args);\n\tconst execute: Q['execute'] = (...args: [any]) => primary.execute(...args);\n\tconst transaction: Q['transaction'] = (...args: [any, any]) => primary.transaction(...args);\n\n\treturn {\n\t\t...primary,\n\t\tupdate,\n\t\tinsert,\n\t\tdelete: $delete,\n\t\texecute,\n\t\ttransaction,\n\t\t$primary: primary,\n\t\tselect,\n\t\tselectDistinct,\n\t\t$count,\n\t\twith: $with,\n\t\tget _query() {\n\t\t\treturn getReplica(replicas)._query;\n\t\t},\n\t\tget query() {\n\t\t\treturn getReplica(replicas).query;\n\t\t},\n\t};\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAA2B;AAG3B,6BAAsC;AACtC,iBAAsE;AACtE,sBAA6B;AAG7B,mBAAwC;AACxC,mBAAkC;AAClC,4BAMO;AACP,IAAAA,gBAAuC;AAehC,MAAM,cAOX;AAAA,EA0BD,YAEU,SAEA,SACT,WACA,QACmB,MAClB;AANQ;AAEA;AAGU;AAEnB,UAAM,MAAM,aAAa,CAAC;AAE1B,SAAK,IAAI,S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;AACX,aAAO,WAAW,QAAQ,EAAE;AAAA,IAC7B;AAAA,EACD;AACD;","names":["import_query"]}
|
|
1
|
+
{"version":3,"sources":["../../src/mysql-core/db.ts"],"sourcesContent":["import type { ResultSetHeader } from 'mysql2/promise';\nimport type * as V1 from '~/_relations.ts';\nimport type { Cache } from '~/cache/core/cache.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { TypedQueryBuilder } from '~/query-builders/query-builder.ts';\nimport type { AnyRelations, EmptyRelations } from '~/relations.ts';\nimport { SelectionProxyHandler } from '~/selection-proxy.ts';\nimport { type ColumnsSelection, type SQL, sql, type SQLWrapper } from '~/sql/sql.ts';\nimport { WithSubquery } from '~/subquery.ts';\nimport type { DrizzleTypeError } from '~/utils.ts';\nimport type { MySqlDialect } from './dialect.ts';\nimport { _RelationalQueryBuilder } from './query-builders/_query.ts';\nimport { MySqlCountBuilder } from './query-builders/count.ts';\nimport {\n\tMySqlDeleteBase,\n\tMySqlInsertBuilder,\n\tMySqlSelectBuilder,\n\tMySqlUpdateBuilder,\n\tQueryBuilder,\n} from './query-builders/index.ts';\nimport { RelationalQueryBuilder } from './query-builders/query.ts';\nimport type { SelectedFields } from './query-builders/select.types.ts';\nimport type {\n\tMode,\n\tMySqlQueryResultHKT,\n\tMySqlQueryResultKind,\n\tMySqlSession,\n\tMySqlTransaction,\n\tMySqlTransactionConfig,\n\tPreparedQueryHKTBase,\n} from './session.ts';\nimport type { WithBuilder } from './subquery.ts';\nimport type { MySqlTable } from './table.ts';\nimport type { MySqlViewBase } from './view-base.ts';\n\nexport class MySqlDatabase<\n\tTQueryResult extends MySqlQueryResultHKT,\n\tTPreparedQueryHKT extends PreparedQueryHKTBase,\n\tTFullSchema extends Record<string, unknown> = Record<string, never>,\n\tTRelations extends AnyRelations = EmptyRelations,\n\tTSchema extends V1.TablesRelationalConfig = V1.ExtractTablesWithRelations<TFullSchema>,\n> {\n\tstatic readonly [entityKind]: string = 'MySqlDatabase';\n\n\tdeclare readonly _: {\n\t\treadonly schema: TSchema | undefined;\n\t\treadonly fullSchema: TFullSchema;\n\t\treadonly relations: TRelations;\n\t\treadonly tableNamesMap: Record<string, string>;\n\t};\n\n\t/** @deprecated */\n\t_query: TFullSchema extends Record<string, never>\n\t\t? DrizzleTypeError<'Seems like the schema generic is missing - did you forget to add it to your DB type?'>\n\t\t: {\n\t\t\t[K in keyof TSchema]: _RelationalQueryBuilder<TPreparedQueryHKT, TSchema, TSchema[K]>;\n\t\t};\n\n\t// TO-DO: Figure out how to pass DrizzleTypeError without breaking withReplicas\n\tquery: {\n\t\t[K in keyof TRelations]: RelationalQueryBuilder<\n\t\t\tTPreparedQueryHKT,\n\t\t\tTRelations,\n\t\t\tTRelations[K]\n\t\t>;\n\t};\n\n\tconstructor(\n\t\t/** @internal */\n\t\treadonly dialect: MySqlDialect,\n\t\t/** @internal */\n\t\treadonly session: MySqlSession<any, any, any, any, any>,\n\t\trelations: TRelations,\n\t\tschema: V1.RelationalSchemaConfig<TSchema> | undefined,\n\t\tprotected readonly mode: Mode,\n\t) {\n\t\tthis._ = schema\n\t\t\t? {\n\t\t\t\tschema: schema.schema,\n\t\t\t\tfullSchema: schema.fullSchema as TFullSchema,\n\t\t\t\ttableNamesMap: schema.tableNamesMap,\n\t\t\t\trelations: relations,\n\t\t\t}\n\t\t\t: {\n\t\t\t\tschema: undefined,\n\t\t\t\tfullSchema: {} as TFullSchema,\n\t\t\t\ttableNamesMap: {},\n\t\t\t\trelations: relations,\n\t\t\t};\n\t\tthis._query = {} as typeof this['_query'];\n\t\tif (this._.schema) {\n\t\t\tfor (const [tableName, columns] of Object.entries(this._.schema)) {\n\t\t\t\t(this._query as MySqlDatabase<TQueryResult, TPreparedQueryHKT, Record<string, any>>['_query'])[tableName] =\n\t\t\t\t\tnew _RelationalQueryBuilder(\n\t\t\t\t\t\tschema!.fullSchema,\n\t\t\t\t\t\tthis._.schema,\n\t\t\t\t\t\tthis._.tableNamesMap,\n\t\t\t\t\t\tschema!.fullSchema[tableName] as MySqlTable,\n\t\t\t\t\t\tcolumns,\n\t\t\t\t\t\tdialect,\n\t\t\t\t\t\tsession,\n\t\t\t\t\t\tthis.mode,\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthis.query = {} as typeof this['query'];\n\t\tfor (const [tableName, relation] of Object.entries(relations)) {\n\t\t\t(this.query as MySqlDatabase<\n\t\t\t\tTQueryResult,\n\t\t\t\tTPreparedQueryHKT,\n\t\t\t\tTSchema,\n\t\t\t\tAnyRelations,\n\t\t\t\tV1.TablesRelationalConfig\n\t\t\t>['query'])[\n\t\t\t\ttableName\n\t\t\t] = new RelationalQueryBuilder(\n\t\t\t\trelations,\n\t\t\t\trelations[relation.name]!.table as MySqlTable,\n\t\t\t\trelation,\n\t\t\t\tdialect,\n\t\t\t\tsession,\n\t\t\t);\n\t\t}\n\n\t\tthis.$cache = { invalidate: async (_params: any) => {} };\n\t}\n\n\t/**\n\t * Creates a subquery that defines a temporary named result set as a CTE.\n\t *\n\t * It is useful for breaking down complex queries into simpler parts and for reusing the result set in subsequent parts of the query.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#with-clause}\n\t *\n\t * @param alias The alias for the subquery.\n\t *\n\t * Failure to provide an alias will result in a DrizzleTypeError, preventing the subquery from being referenced in other queries.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Create a subquery with alias 'sq' and use it in the select query\n\t * const sq = db.$with('sq').as(db.select().from(users).where(eq(users.id, 42)));\n\t *\n\t * const result = await db.with(sq).select().from(sq);\n\t * ```\n\t *\n\t * To select arbitrary SQL values as fields in a CTE and reference them in other CTEs or in the main query, you need to add aliases to them:\n\t *\n\t * ```ts\n\t * // Select an arbitrary SQL value as a field in a CTE and reference it in the main query\n\t * const sq = db.$with('sq').as(db.select({\n\t * name: sql<string>`upper(${users.name})`.as('name'),\n\t * })\n\t * .from(users));\n\t *\n\t * const result = await db.with(sq).select({ name: sq.name }).from(sq);\n\t * ```\n\t */\n\t$with: WithBuilder = (alias: string, selection?: ColumnsSelection) => {\n\t\tconst self = this;\n\t\tconst as = (\n\t\t\tqb:\n\t\t\t\t| TypedQueryBuilder<ColumnsSelection | undefined>\n\t\t\t\t| SQL\n\t\t\t\t| ((qb: QueryBuilder) => TypedQueryBuilder<ColumnsSelection | undefined> | SQL),\n\t\t) => {\n\t\t\tif (typeof qb === 'function') {\n\t\t\t\tqb = qb(new QueryBuilder(self.dialect));\n\t\t\t}\n\n\t\t\treturn new Proxy(\n\t\t\t\tnew WithSubquery(\n\t\t\t\t\tqb.getSQL(),\n\t\t\t\t\tselection ?? ('getSelectedFields' in qb ? qb.getSelectedFields() ?? {} : {}) as SelectedFields,\n\t\t\t\t\talias,\n\t\t\t\t\ttrue,\n\t\t\t\t),\n\t\t\t\tnew SelectionProxyHandler({ alias, sqlAliasedBehavior: 'alias', sqlBehavior: 'error' }),\n\t\t\t);\n\t\t};\n\t\treturn { as };\n\t};\n\n\t$count(\n\t\tsource: MySqlTable | MySqlViewBase | SQL | SQLWrapper,\n\t\tfilters?: SQL<unknown>,\n\t) {\n\t\treturn new MySqlCountBuilder({ source, filters, session: this.session });\n\t}\n\n\t$cache: { invalidate: Cache['onMutate'] };\n\n\t/**\n\t * Incorporates a previously defined CTE (using `$with`) into the main query.\n\t *\n\t * This method allows the main query to reference a temporary named result set.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#with-clause}\n\t *\n\t * @param queries The CTEs to incorporate into the main query.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Define a subquery 'sq' as a CTE using $with\n\t * const sq = db.$with('sq').as(db.select().from(users).where(eq(users.id, 42)));\n\t *\n\t * // Incorporate the CTE 'sq' into the main query and select from it\n\t * const result = await db.with(sq).select().from(sq);\n\t * ```\n\t */\n\twith(...queries: WithSubquery[]) {\n\t\tconst self = this;\n\n\t\t/**\n\t\t * Creates a select query.\n\t\t *\n\t\t * Calling this method with no arguments will select all columns from the table. Pass a selection object to specify the columns you want to select.\n\t\t *\n\t\t * Use `.from()` method to specify which table to select from.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/select}\n\t\t *\n\t\t * @param fields The selection object.\n\t\t *\n\t\t * @example\n\t\t *\n\t\t * ```ts\n\t\t * // Select all columns and all rows from the 'cars' table\n\t\t * const allCars: Car[] = await db.select().from(cars);\n\t\t *\n\t\t * // Select specific columns and all rows from the 'cars' table\n\t\t * const carsIdsAndBrands: { id: number; brand: string }[] = await db.select({\n\t\t * id: cars.id,\n\t\t * brand: cars.brand\n\t\t * })\n\t\t * .from(cars);\n\t\t * ```\n\t\t *\n\t\t * Like in SQL, you can use arbitrary expressions as selection fields, not just table columns:\n\t\t *\n\t\t * ```ts\n\t\t * // Select specific columns along with expression and all rows from the 'cars' table\n\t\t * const carsIdsAndLowerNames: { id: number; lowerBrand: string }[] = await db.select({\n\t\t * id: cars.id,\n\t\t * lowerBrand: sql<string>`lower(${cars.brand})`,\n\t\t * })\n\t\t * .from(cars);\n\t\t * ```\n\t\t */\n\t\tfunction select(): MySqlSelectBuilder<undefined, TPreparedQueryHKT>;\n\t\tfunction select<TSelection extends SelectedFields>(\n\t\t\tfields: TSelection,\n\t\t): MySqlSelectBuilder<TSelection, TPreparedQueryHKT>;\n\t\tfunction select(fields?: SelectedFields): MySqlSelectBuilder<SelectedFields | undefined, TPreparedQueryHKT> {\n\t\t\treturn new MySqlSelectBuilder({\n\t\t\t\tfields: fields ?? undefined,\n\t\t\t\tsession: self.session,\n\t\t\t\tdialect: self.dialect,\n\t\t\t\twithList: queries,\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Adds `distinct` expression to the select query.\n\t\t *\n\t\t * Calling this method will return only unique values. When multiple columns are selected, it returns rows with unique combinations of values in these columns.\n\t\t *\n\t\t * Use `.from()` method to specify which table to select from.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/select#distinct}\n\t\t *\n\t\t * @param fields The selection object.\n\t\t *\n\t\t * @example\n\t\t * ```ts\n\t\t * // Select all unique rows from the 'cars' table\n\t\t * await db.selectDistinct()\n\t\t * .from(cars)\n\t\t * .orderBy(cars.id, cars.brand, cars.color);\n\t\t *\n\t\t * // Select all unique brands from the 'cars' table\n\t\t * await db.selectDistinct({ brand: cars.brand })\n\t\t * .from(cars)\n\t\t * .orderBy(cars.brand);\n\t\t * ```\n\t\t */\n\t\tfunction selectDistinct(): MySqlSelectBuilder<undefined, TPreparedQueryHKT>;\n\t\tfunction selectDistinct<TSelection extends SelectedFields>(\n\t\t\tfields: TSelection,\n\t\t): MySqlSelectBuilder<TSelection, TPreparedQueryHKT>;\n\t\tfunction selectDistinct(\n\t\t\tfields?: SelectedFields,\n\t\t): MySqlSelectBuilder<SelectedFields | undefined, TPreparedQueryHKT> {\n\t\t\treturn new MySqlSelectBuilder({\n\t\t\t\tfields: fields ?? undefined,\n\t\t\t\tsession: self.session,\n\t\t\t\tdialect: self.dialect,\n\t\t\t\twithList: queries,\n\t\t\t\tdistinct: true,\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Creates an update query.\n\t\t *\n\t\t * Calling this method without `.where()` clause will update all rows in a table. The `.where()` clause specifies which rows should be updated.\n\t\t *\n\t\t * Use `.set()` method to specify which values to update.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/update}\n\t\t *\n\t\t * @param table The table to update.\n\t\t *\n\t\t * @example\n\t\t *\n\t\t * ```ts\n\t\t * // Update all rows in the 'cars' table\n\t\t * await db.update(cars).set({ color: 'red' });\n\t\t *\n\t\t * // Update rows with filters and conditions\n\t\t * await db.update(cars).set({ color: 'red' }).where(eq(cars.brand, 'BMW'));\n\t\t * ```\n\t\t */\n\t\tfunction update<TTable extends MySqlTable>(\n\t\t\ttable: TTable,\n\t\t): MySqlUpdateBuilder<TTable, TQueryResult, TPreparedQueryHKT> {\n\t\t\treturn new MySqlUpdateBuilder(table, self.session, self.dialect, queries);\n\t\t}\n\n\t\t/**\n\t\t * Creates a delete query.\n\t\t *\n\t\t * Calling this method without `.where()` clause will delete all rows in a table. The `.where()` clause specifies which rows should be deleted.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/delete}\n\t\t *\n\t\t * @param table The table to delete from.\n\t\t *\n\t\t * @example\n\t\t *\n\t\t * ```ts\n\t\t * // Delete all rows in the 'cars' table\n\t\t * await db.delete(cars);\n\t\t *\n\t\t * // Delete rows with filters and conditions\n\t\t * await db.delete(cars).where(eq(cars.color, 'green'));\n\t\t * ```\n\t\t */\n\t\tfunction delete_<TTable extends MySqlTable>(\n\t\t\ttable: TTable,\n\t\t): MySqlDeleteBase<TTable, TQueryResult, TPreparedQueryHKT> {\n\t\t\treturn new MySqlDeleteBase(table, self.session, self.dialect, queries);\n\t\t}\n\n\t\treturn { select, selectDistinct, update, delete: delete_ };\n\t}\n\n\t/**\n\t * Creates a select query.\n\t *\n\t * Calling this method with no arguments will select all columns from the table. Pass a selection object to specify the columns you want to select.\n\t *\n\t * Use `.from()` method to specify which table to select from.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select}\n\t *\n\t * @param fields The selection object.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Select all columns and all rows from the 'cars' table\n\t * const allCars: Car[] = await db.select().from(cars);\n\t *\n\t * // Select specific columns and all rows from the 'cars' table\n\t * const carsIdsAndBrands: { id: number; brand: string }[] = await db.select({\n\t * id: cars.id,\n\t * brand: cars.brand\n\t * })\n\t * .from(cars);\n\t * ```\n\t *\n\t * Like in SQL, you can use arbitrary expressions as selection fields, not just table columns:\n\t *\n\t * ```ts\n\t * // Select specific columns along with expression and all rows from the 'cars' table\n\t * const carsIdsAndLowerNames: { id: number; lowerBrand: string }[] = await db.select({\n\t * id: cars.id,\n\t * lowerBrand: sql<string>`lower(${cars.brand})`,\n\t * })\n\t * .from(cars);\n\t * ```\n\t */\n\tselect(): MySqlSelectBuilder<undefined, TPreparedQueryHKT>;\n\tselect<TSelection extends SelectedFields>(fields: TSelection): MySqlSelectBuilder<TSelection, TPreparedQueryHKT>;\n\tselect(fields?: SelectedFields): MySqlSelectBuilder<SelectedFields | undefined, TPreparedQueryHKT> {\n\t\treturn new MySqlSelectBuilder({ fields: fields ?? undefined, session: this.session, dialect: this.dialect });\n\t}\n\n\t/**\n\t * Adds `distinct` expression to the select query.\n\t *\n\t * Calling this method will return only unique values. When multiple columns are selected, it returns rows with unique combinations of values in these columns.\n\t *\n\t * Use `.from()` method to specify which table to select from.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#distinct}\n\t *\n\t * @param fields The selection object.\n\t *\n\t * @example\n\t * ```ts\n\t * // Select all unique rows from the 'cars' table\n\t * await db.selectDistinct()\n\t * .from(cars)\n\t * .orderBy(cars.id, cars.brand, cars.color);\n\t *\n\t * // Select all unique brands from the 'cars' table\n\t * await db.selectDistinct({ brand: cars.brand })\n\t * .from(cars)\n\t * .orderBy(cars.brand);\n\t * ```\n\t */\n\tselectDistinct(): MySqlSelectBuilder<undefined, TPreparedQueryHKT>;\n\tselectDistinct<TSelection extends SelectedFields>(\n\t\tfields: TSelection,\n\t): MySqlSelectBuilder<TSelection, TPreparedQueryHKT>;\n\tselectDistinct(fields?: SelectedFields): MySqlSelectBuilder<SelectedFields | undefined, TPreparedQueryHKT> {\n\t\treturn new MySqlSelectBuilder({\n\t\t\tfields: fields ?? undefined,\n\t\t\tsession: this.session,\n\t\t\tdialect: this.dialect,\n\t\t\tdistinct: true,\n\t\t});\n\t}\n\n\t/**\n\t * Creates an update query.\n\t *\n\t * Calling this method without `.where()` clause will update all rows in a table. The `.where()` clause specifies which rows should be updated.\n\t *\n\t * Use `.set()` method to specify which values to update.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/update}\n\t *\n\t * @param table The table to update.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Update all rows in the 'cars' table\n\t * await db.update(cars).set({ color: 'red' });\n\t *\n\t * // Update rows with filters and conditions\n\t * await db.update(cars).set({ color: 'red' }).where(eq(cars.brand, 'BMW'));\n\t * ```\n\t */\n\tupdate<TTable extends MySqlTable>(table: TTable): MySqlUpdateBuilder<TTable, TQueryResult, TPreparedQueryHKT> {\n\t\treturn new MySqlUpdateBuilder(table, this.session, this.dialect);\n\t}\n\n\t/**\n\t * Creates an insert query.\n\t *\n\t * Calling this method will create new rows in a table. Use `.values()` method to specify which values to insert.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/insert}\n\t *\n\t * @param table The table to insert into.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Insert one row\n\t * await db.insert(cars).values({ brand: 'BMW' });\n\t *\n\t * // Insert multiple rows\n\t * await db.insert(cars).values([{ brand: 'BMW' }, { brand: 'Porsche' }]);\n\t * ```\n\t */\n\tinsert<TTable extends MySqlTable>(table: TTable): MySqlInsertBuilder<TTable, TQueryResult, TPreparedQueryHKT> {\n\t\treturn new MySqlInsertBuilder(table, this.session, this.dialect);\n\t}\n\n\t/**\n\t * Creates a delete query.\n\t *\n\t * Calling this method without `.where()` clause will delete all rows in a table. The `.where()` clause specifies which rows should be deleted.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/delete}\n\t *\n\t * @param table The table to delete from.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Delete all rows in the 'cars' table\n\t * await db.delete(cars);\n\t *\n\t * // Delete rows with filters and conditions\n\t * await db.delete(cars).where(eq(cars.color, 'green'));\n\t * ```\n\t */\n\tdelete<TTable extends MySqlTable>(table: TTable): MySqlDeleteBase<TTable, TQueryResult, TPreparedQueryHKT> {\n\t\treturn new MySqlDeleteBase(table, this.session, this.dialect);\n\t}\n\n\texecute<T extends { [column: string]: any } = ResultSetHeader>(\n\t\tquery: SQLWrapper | string,\n\t): Promise<MySqlQueryResultKind<TQueryResult, T>> {\n\t\treturn this.session.execute(typeof query === 'string' ? sql.raw(query) : query.getSQL());\n\t}\n\n\ttransaction<T>(\n\t\ttransaction: (\n\t\t\ttx: MySqlTransaction<TQueryResult, TPreparedQueryHKT, TFullSchema, TRelations, TSchema>,\n\t\t\tconfig?: MySqlTransactionConfig,\n\t\t) => Promise<T>,\n\t\tconfig?: MySqlTransactionConfig,\n\t): Promise<T> {\n\t\treturn this.session.transaction(transaction, config);\n\t}\n}\n\nexport type MySQLWithReplicas<Q> = Q & { $primary: Q };\n\nexport const withReplicas = <\n\tHKT extends MySqlQueryResultHKT,\n\tTPreparedQueryHKT extends PreparedQueryHKTBase,\n\tTFullSchema extends Record<string, unknown>,\n\tTRelations extends AnyRelations,\n\tTSchema extends V1.TablesRelationalConfig,\n\tQ extends MySqlDatabase<\n\t\tHKT,\n\t\tTPreparedQueryHKT,\n\t\tTFullSchema,\n\t\tTRelations,\n\t\tTSchema extends Record<string, unknown> ? V1.ExtractTablesWithRelations<TFullSchema> : TSchema\n\t>,\n>(\n\tprimary: Q,\n\treplicas: [Q, ...Q[]],\n\tgetReplica: (replicas: Q[]) => Q = () => replicas[Math.floor(Math.random() * replicas.length)]!,\n): MySQLWithReplicas<Q> => {\n\tconst select: Q['select'] = (...args: []) => getReplica(replicas).select(...args);\n\tconst selectDistinct: Q['selectDistinct'] = (...args: []) => getReplica(replicas).selectDistinct(...args);\n\tconst $count: Q['$count'] = (...args: [any]) => getReplica(replicas).$count(...args);\n\tconst $with: Q['with'] = (...args: []) => getReplica(replicas).with(...args);\n\n\tconst update: Q['update'] = (...args: [any]) => primary.update(...args);\n\tconst insert: Q['insert'] = (...args: [any]) => primary.insert(...args);\n\tconst $delete: Q['delete'] = (...args: [any]) => primary.delete(...args);\n\tconst execute: Q['execute'] = (...args: [any]) => primary.execute(...args);\n\tconst transaction: Q['transaction'] = (...args: [any, any]) => primary.transaction(...args);\n\n\treturn {\n\t\t...primary,\n\t\tupdate,\n\t\tinsert,\n\t\tdelete: $delete,\n\t\texecute,\n\t\ttransaction,\n\t\t$primary: primary,\n\t\tselect,\n\t\tselectDistinct,\n\t\t$count,\n\t\twith: $with,\n\t\tget _query() {\n\t\t\treturn getReplica(replicas)._query;\n\t\t},\n\t\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AO,WAAW,QAAQ,EAAE;AAAA,IAC7B;AAAA,EACD;AACD;","names":["import_query"]}
|
package/mysql-core/db.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ResultSetHeader } from 'mysql2/promise';
|
|
|
2
2
|
import type * as V1 from "../_relations.cjs";
|
|
3
3
|
import type { Cache } from "../cache/core/cache.cjs";
|
|
4
4
|
import { entityKind } from "../entity.cjs";
|
|
5
|
-
import type { AnyRelations, EmptyRelations
|
|
5
|
+
import type { AnyRelations, EmptyRelations } from "../relations.cjs";
|
|
6
6
|
import { type SQL, type SQLWrapper } from "../sql/sql.cjs";
|
|
7
7
|
import { WithSubquery } from "../subquery.cjs";
|
|
8
8
|
import type { DrizzleTypeError } from "../utils.cjs";
|
|
@@ -16,7 +16,7 @@ import type { Mode, MySqlQueryResultHKT, MySqlQueryResultKind, MySqlSession, MyS
|
|
|
16
16
|
import type { WithBuilder } from "./subquery.cjs";
|
|
17
17
|
import type { MySqlTable } from "./table.cjs";
|
|
18
18
|
import type { MySqlViewBase } from "./view-base.cjs";
|
|
19
|
-
export declare class MySqlDatabase<TQueryResult extends MySqlQueryResultHKT, TPreparedQueryHKT extends PreparedQueryHKTBase, TFullSchema extends Record<string, unknown> = Record<string, never>, TRelations extends AnyRelations = EmptyRelations,
|
|
19
|
+
export declare class MySqlDatabase<TQueryResult extends MySqlQueryResultHKT, TPreparedQueryHKT extends PreparedQueryHKTBase, TFullSchema extends Record<string, unknown> = Record<string, never>, TRelations extends AnyRelations = EmptyRelations, TSchema extends V1.TablesRelationalConfig = V1.ExtractTablesWithRelations<TFullSchema>> {
|
|
20
20
|
protected readonly mode: Mode;
|
|
21
21
|
static readonly [entityKind]: string;
|
|
22
22
|
readonly _: {
|
|
@@ -30,13 +30,13 @@ export declare class MySqlDatabase<TQueryResult extends MySqlQueryResultHKT, TPr
|
|
|
30
30
|
[K in keyof TSchema]: _RelationalQueryBuilder<TPreparedQueryHKT, TSchema, TSchema[K]>;
|
|
31
31
|
};
|
|
32
32
|
query: {
|
|
33
|
-
[K in keyof TRelations
|
|
33
|
+
[K in keyof TRelations]: RelationalQueryBuilder<TPreparedQueryHKT, TRelations, TRelations[K]>;
|
|
34
34
|
};
|
|
35
35
|
constructor(
|
|
36
36
|
/** @internal */
|
|
37
37
|
dialect: MySqlDialect,
|
|
38
38
|
/** @internal */
|
|
39
|
-
session: MySqlSession<any, any, any, any, any
|
|
39
|
+
session: MySqlSession<any, any, any, any, any>, relations: TRelations, schema: V1.RelationalSchemaConfig<TSchema> | undefined, mode: Mode);
|
|
40
40
|
/**
|
|
41
41
|
* Creates a subquery that defines a temporary named result set as a CTE.
|
|
42
42
|
*
|
|
@@ -70,7 +70,7 @@ export declare class MySqlDatabase<TQueryResult extends MySqlQueryResultHKT, TPr
|
|
|
70
70
|
* ```
|
|
71
71
|
*/
|
|
72
72
|
$with: WithBuilder;
|
|
73
|
-
$count(source: MySqlTable | MySqlViewBase | SQL | SQLWrapper, filters?: SQL<unknown>): MySqlCountBuilder<MySqlSession<any, any, any, any, any
|
|
73
|
+
$count(source: MySqlTable | MySqlViewBase | SQL | SQLWrapper, filters?: SQL<unknown>): MySqlCountBuilder<MySqlSession<any, any, any, any, any>>;
|
|
74
74
|
$cache: {
|
|
75
75
|
invalidate: Cache['onMutate'];
|
|
76
76
|
};
|
|
@@ -234,9 +234,9 @@ export declare class MySqlDatabase<TQueryResult extends MySqlQueryResultHKT, TPr
|
|
|
234
234
|
execute<T extends {
|
|
235
235
|
[column: string]: any;
|
|
236
236
|
} = ResultSetHeader>(query: SQLWrapper | string): Promise<MySqlQueryResultKind<TQueryResult, T>>;
|
|
237
|
-
transaction<T>(transaction: (tx: MySqlTransaction<TQueryResult, TPreparedQueryHKT, TFullSchema, TRelations,
|
|
237
|
+
transaction<T>(transaction: (tx: MySqlTransaction<TQueryResult, TPreparedQueryHKT, TFullSchema, TRelations, TSchema>, config?: MySqlTransactionConfig) => Promise<T>, config?: MySqlTransactionConfig): Promise<T>;
|
|
238
238
|
}
|
|
239
239
|
export type MySQLWithReplicas<Q> = Q & {
|
|
240
240
|
$primary: Q;
|
|
241
241
|
};
|
|
242
|
-
export declare const withReplicas: <HKT extends MySqlQueryResultHKT, TPreparedQueryHKT extends PreparedQueryHKTBase, TFullSchema extends Record<string, unknown>, TRelations extends AnyRelations,
|
|
242
|
+
export declare const withReplicas: <HKT extends MySqlQueryResultHKT, TPreparedQueryHKT extends PreparedQueryHKTBase, TFullSchema extends Record<string, unknown>, TRelations extends AnyRelations, TSchema extends V1.TablesRelationalConfig, Q extends MySqlDatabase<HKT, TPreparedQueryHKT, TFullSchema, TRelations, TSchema extends Record<string, unknown> ? V1.ExtractTablesWithRelations<TFullSchema> : TSchema>>(primary: Q, replicas: [Q, ...Q[]], getReplica?: (replicas: Q[]) => Q) => MySQLWithReplicas<Q>;
|
package/mysql-core/db.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ResultSetHeader } from 'mysql2/promise';
|
|
|
2
2
|
import type * as V1 from "../_relations.js";
|
|
3
3
|
import type { Cache } from "../cache/core/cache.js";
|
|
4
4
|
import { entityKind } from "../entity.js";
|
|
5
|
-
import type { AnyRelations, EmptyRelations
|
|
5
|
+
import type { AnyRelations, EmptyRelations } from "../relations.js";
|
|
6
6
|
import { type SQL, type SQLWrapper } from "../sql/sql.js";
|
|
7
7
|
import { WithSubquery } from "../subquery.js";
|
|
8
8
|
import type { DrizzleTypeError } from "../utils.js";
|
|
@@ -16,7 +16,7 @@ import type { Mode, MySqlQueryResultHKT, MySqlQueryResultKind, MySqlSession, MyS
|
|
|
16
16
|
import type { WithBuilder } from "./subquery.js";
|
|
17
17
|
import type { MySqlTable } from "./table.js";
|
|
18
18
|
import type { MySqlViewBase } from "./view-base.js";
|
|
19
|
-
export declare class MySqlDatabase<TQueryResult extends MySqlQueryResultHKT, TPreparedQueryHKT extends PreparedQueryHKTBase, TFullSchema extends Record<string, unknown> = Record<string, never>, TRelations extends AnyRelations = EmptyRelations,
|
|
19
|
+
export declare class MySqlDatabase<TQueryResult extends MySqlQueryResultHKT, TPreparedQueryHKT extends PreparedQueryHKTBase, TFullSchema extends Record<string, unknown> = Record<string, never>, TRelations extends AnyRelations = EmptyRelations, TSchema extends V1.TablesRelationalConfig = V1.ExtractTablesWithRelations<TFullSchema>> {
|
|
20
20
|
protected readonly mode: Mode;
|
|
21
21
|
static readonly [entityKind]: string;
|
|
22
22
|
readonly _: {
|
|
@@ -30,13 +30,13 @@ export declare class MySqlDatabase<TQueryResult extends MySqlQueryResultHKT, TPr
|
|
|
30
30
|
[K in keyof TSchema]: _RelationalQueryBuilder<TPreparedQueryHKT, TSchema, TSchema[K]>;
|
|
31
31
|
};
|
|
32
32
|
query: {
|
|
33
|
-
[K in keyof TRelations
|
|
33
|
+
[K in keyof TRelations]: RelationalQueryBuilder<TPreparedQueryHKT, TRelations, TRelations[K]>;
|
|
34
34
|
};
|
|
35
35
|
constructor(
|
|
36
36
|
/** @internal */
|
|
37
37
|
dialect: MySqlDialect,
|
|
38
38
|
/** @internal */
|
|
39
|
-
session: MySqlSession<any, any, any, any, any
|
|
39
|
+
session: MySqlSession<any, any, any, any, any>, relations: TRelations, schema: V1.RelationalSchemaConfig<TSchema> | undefined, mode: Mode);
|
|
40
40
|
/**
|
|
41
41
|
* Creates a subquery that defines a temporary named result set as a CTE.
|
|
42
42
|
*
|
|
@@ -70,7 +70,7 @@ export declare class MySqlDatabase<TQueryResult extends MySqlQueryResultHKT, TPr
|
|
|
70
70
|
* ```
|
|
71
71
|
*/
|
|
72
72
|
$with: WithBuilder;
|
|
73
|
-
$count(source: MySqlTable | MySqlViewBase | SQL | SQLWrapper, filters?: SQL<unknown>): MySqlCountBuilder<MySqlSession<any, any, any, any, any
|
|
73
|
+
$count(source: MySqlTable | MySqlViewBase | SQL | SQLWrapper, filters?: SQL<unknown>): MySqlCountBuilder<MySqlSession<any, any, any, any, any>>;
|
|
74
74
|
$cache: {
|
|
75
75
|
invalidate: Cache['onMutate'];
|
|
76
76
|
};
|
|
@@ -234,9 +234,9 @@ export declare class MySqlDatabase<TQueryResult extends MySqlQueryResultHKT, TPr
|
|
|
234
234
|
execute<T extends {
|
|
235
235
|
[column: string]: any;
|
|
236
236
|
} = ResultSetHeader>(query: SQLWrapper | string): Promise<MySqlQueryResultKind<TQueryResult, T>>;
|
|
237
|
-
transaction<T>(transaction: (tx: MySqlTransaction<TQueryResult, TPreparedQueryHKT, TFullSchema, TRelations,
|
|
237
|
+
transaction<T>(transaction: (tx: MySqlTransaction<TQueryResult, TPreparedQueryHKT, TFullSchema, TRelations, TSchema>, config?: MySqlTransactionConfig) => Promise<T>, config?: MySqlTransactionConfig): Promise<T>;
|
|
238
238
|
}
|
|
239
239
|
export type MySQLWithReplicas<Q> = Q & {
|
|
240
240
|
$primary: Q;
|
|
241
241
|
};
|
|
242
|
-
export declare const withReplicas: <HKT extends MySqlQueryResultHKT, TPreparedQueryHKT extends PreparedQueryHKTBase, TFullSchema extends Record<string, unknown>, TRelations extends AnyRelations,
|
|
242
|
+
export declare const withReplicas: <HKT extends MySqlQueryResultHKT, TPreparedQueryHKT extends PreparedQueryHKTBase, TFullSchema extends Record<string, unknown>, TRelations extends AnyRelations, TSchema extends V1.TablesRelationalConfig, Q extends MySqlDatabase<HKT, TPreparedQueryHKT, TFullSchema, TRelations, TSchema extends Record<string, unknown> ? V1.ExtractTablesWithRelations<TFullSchema> : TSchema>>(primary: Q, replicas: [Q, ...Q[]], getReplica?: (replicas: Q[]) => Q) => MySQLWithReplicas<Q>;
|
package/mysql-core/db.js
CHANGED
|
@@ -17,17 +17,16 @@ class MySqlDatabase {
|
|
|
17
17
|
this.dialect = dialect;
|
|
18
18
|
this.session = session;
|
|
19
19
|
this.mode = mode;
|
|
20
|
-
const rel = relations ?? {};
|
|
21
20
|
this._ = schema ? {
|
|
22
21
|
schema: schema.schema,
|
|
23
22
|
fullSchema: schema.fullSchema,
|
|
24
23
|
tableNamesMap: schema.tableNamesMap,
|
|
25
|
-
relations
|
|
24
|
+
relations
|
|
26
25
|
} : {
|
|
27
26
|
schema: void 0,
|
|
28
27
|
fullSchema: {},
|
|
29
28
|
tableNamesMap: {},
|
|
30
|
-
relations
|
|
29
|
+
relations
|
|
31
30
|
};
|
|
32
31
|
this._query = {};
|
|
33
32
|
if (this._.schema) {
|
|
@@ -45,32 +44,14 @@ class MySqlDatabase {
|
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
46
|
this.query = {};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
dialect,
|
|
57
|
-
session
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
this.query = {};
|
|
62
|
-
if (relations) {
|
|
63
|
-
for (const [tableName, relation] of Object.entries(relations.tablesConfig)) {
|
|
64
|
-
this.query[tableName] = new RelationalQueryBuilder(
|
|
65
|
-
relations.tables,
|
|
66
|
-
relations.tablesConfig,
|
|
67
|
-
relations.tableNamesMap,
|
|
68
|
-
relation.table,
|
|
69
|
-
relation,
|
|
70
|
-
dialect,
|
|
71
|
-
session
|
|
72
|
-
);
|
|
73
|
-
}
|
|
47
|
+
for (const [tableName, relation] of Object.entries(relations)) {
|
|
48
|
+
this.query[tableName] = new RelationalQueryBuilder(
|
|
49
|
+
relations,
|
|
50
|
+
relations[relation.name].table,
|
|
51
|
+
relation,
|
|
52
|
+
dialect,
|
|
53
|
+
session
|
|
54
|
+
);
|
|
74
55
|
}
|
|
75
56
|
this.$cache = { invalidate: async (_params) => {
|
|
76
57
|
} };
|