drizzle-orm 0.28.3 → 0.28.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{alias-d302772a.mjs → alias-e80df77c.mjs} +2302 -2299
- package/alias-e80df77c.mjs.map +1 -0
- package/alias.d.cts +31 -0
- package/alias.d.mts +31 -0
- package/alias.d.ts +7 -7
- package/aws-data-api/common/index.d.cts +9 -0
- package/aws-data-api/common/index.d.mts +9 -0
- package/aws-data-api/common/index.d.ts +1 -1
- package/aws-data-api/pg/driver.d.cts +23 -0
- package/aws-data-api/pg/driver.d.mts +23 -0
- package/aws-data-api/pg/driver.d.ts +6 -6
- package/aws-data-api/pg/index.cjs +17 -17
- package/aws-data-api/pg/index.d.cts +2 -0
- package/aws-data-api/pg/index.d.mts +2 -0
- package/aws-data-api/pg/index.d.ts +2 -2
- package/aws-data-api/pg/index.mjs +3 -2
- package/aws-data-api/pg/index.mjs.map +1 -1
- package/aws-data-api/pg/migrator.d.cts +3 -0
- package/aws-data-api/pg/migrator.d.mts +3 -0
- package/aws-data-api/pg/migrator.d.ts +2 -2
- package/aws-data-api/pg/session.d.cts +50 -0
- package/aws-data-api/pg/session.d.mts +50 -0
- package/aws-data-api/pg/session.d.ts +6 -6
- package/better-sqlite3/driver.d.cts +5 -0
- package/better-sqlite3/driver.d.mts +5 -0
- package/better-sqlite3/driver.d.ts +2 -2
- package/better-sqlite3/index.cjs +16 -16
- package/better-sqlite3/index.d.cts +2 -0
- package/better-sqlite3/index.d.mts +2 -0
- package/better-sqlite3/index.d.ts +2 -2
- package/better-sqlite3/index.mjs +3 -2
- package/better-sqlite3/index.mjs.map +1 -1
- package/better-sqlite3/migrator.d.cts +3 -0
- package/better-sqlite3/migrator.d.mts +3 -0
- package/better-sqlite3/migrator.d.ts +2 -2
- package/better-sqlite3/session.d.cts +48 -0
- package/better-sqlite3/session.d.mts +48 -0
- package/better-sqlite3/session.d.ts +8 -8
- package/bun-sqlite/driver.d.cts +6 -0
- package/bun-sqlite/driver.d.mts +6 -0
- package/bun-sqlite/driver.d.ts +2 -2
- package/bun-sqlite/index.cjs +16 -16
- package/bun-sqlite/index.d.cts +2 -0
- package/bun-sqlite/index.d.mts +2 -0
- package/bun-sqlite/index.d.ts +2 -2
- package/bun-sqlite/index.mjs +3 -2
- package/bun-sqlite/index.mjs.map +1 -1
- package/bun-sqlite/migrator.d.cts +3 -0
- package/bun-sqlite/migrator.d.mts +3 -0
- package/bun-sqlite/migrator.d.ts +2 -2
- package/bun-sqlite/session.d.cts +52 -0
- package/bun-sqlite/session.d.mts +52 -0
- package/bun-sqlite/session.d.ts +9 -9
- package/column-builder.d.cts +146 -0
- package/column-builder.d.mts +146 -0
- package/column-builder.d.ts +22 -20
- package/column.d.cts +56 -0
- package/column.d.mts +56 -0
- package/column.d.ts +5 -5
- package/d1/driver.d.cts +5 -0
- package/d1/driver.d.mts +5 -0
- package/d1/driver.d.ts +2 -2
- package/d1/index.cjs +19 -19
- package/d1/index.d.cts +2 -0
- package/d1/index.d.mts +2 -0
- package/d1/index.d.ts +2 -2
- package/d1/index.mjs +3 -2
- package/d1/index.mjs.map +1 -1
- package/d1/migrator.d.cts +3 -0
- package/d1/migrator.d.mts +3 -0
- package/d1/migrator.d.ts +2 -2
- package/d1/session.d.cts +50 -0
- package/d1/session.d.mts +50 -0
- package/d1/session.d.ts +9 -9
- package/entity.d.cts +7 -0
- package/entity.d.mts +7 -0
- package/errors.d.cts +10 -0
- package/errors.d.mts +10 -0
- package/errors.d.ts +1 -1
- package/expressions.d.cts +1 -0
- package/expressions.d.mts +1 -0
- package/expressions.d.ts +1 -1
- package/{alias-58b7b8c9.cjs → index-b1dbb7ec.cjs} +3071 -3030
- package/index-b1dbb7ec.cjs.map +1 -0
- package/index.cjs +100 -132
- package/index.cjs.map +1 -1
- package/index.d.cts +15 -0
- package/index.d.mts +15 -0
- package/index.d.ts +15 -15
- package/index.mjs +3 -2
- package/index.mjs.map +1 -1
- package/knex/index.d.cts +9 -0
- package/knex/index.d.mts +9 -0
- package/knex/index.d.ts +5 -5
- package/kysely/index.d.cts +16 -0
- package/kysely/index.d.mts +16 -0
- package/kysely/index.d.ts +7 -7
- package/libsql/driver.d.cts +5 -0
- package/libsql/driver.d.mts +5 -0
- package/libsql/driver.d.ts +2 -2
- package/libsql/index.cjs +17 -16
- package/libsql/index.cjs.map +1 -1
- package/libsql/index.d.cts +2 -0
- package/libsql/index.d.mts +2 -0
- package/libsql/index.d.ts +2 -2
- package/libsql/index.mjs +4 -2
- package/libsql/index.mjs.map +1 -1
- package/libsql/migrator.d.cts +3 -0
- package/libsql/migrator.d.mts +3 -0
- package/libsql/migrator.d.ts +2 -2
- package/libsql/session.d.cts +53 -0
- package/libsql/session.d.mts +53 -0
- package/libsql/session.d.ts +9 -9
- package/logger.d.cts +23 -0
- package/logger.d.mts +23 -0
- package/logger.d.ts +1 -1
- package/migrator.d.cts +15 -0
- package/migrator.d.mts +15 -0
- package/mysql-core/alias.d.cts +4 -0
- package/mysql-core/alias.d.mts +4 -0
- package/mysql-core/alias.d.ts +3 -3
- package/mysql-core/checks.d.cts +18 -0
- package/mysql-core/checks.d.mts +18 -0
- package/mysql-core/checks.d.ts +3 -3
- package/mysql-core/columns/bigint.d.cts +43 -0
- package/mysql-core/columns/bigint.d.mts +43 -0
- package/mysql-core/columns/bigint.d.ts +4 -4
- package/mysql-core/columns/binary.d.cts +25 -0
- package/mysql-core/columns/binary.d.mts +25 -0
- package/mysql-core/columns/binary.d.ts +4 -4
- package/mysql-core/columns/boolean.d.cts +22 -0
- package/mysql-core/columns/boolean.d.mts +22 -0
- package/mysql-core/columns/boolean.d.ts +4 -4
- package/mysql-core/columns/char.d.cts +28 -0
- package/mysql-core/columns/char.d.mts +28 -0
- package/mysql-core/columns/char.d.ts +5 -5
- package/mysql-core/columns/common.d.cts +49 -0
- package/mysql-core/columns/common.d.mts +49 -0
- package/mysql-core/columns/common.d.ts +13 -9
- package/mysql-core/columns/custom.d.cts +148 -0
- package/mysql-core/columns/custom.d.mts +148 -0
- package/mysql-core/columns/custom.d.ts +7 -7
- package/mysql-core/columns/date.common.d.cts +16 -0
- package/mysql-core/columns/date.common.d.mts +16 -0
- package/mysql-core/columns/date.common.d.ts +4 -4
- package/mysql-core/columns/date.d.cts +49 -0
- package/mysql-core/columns/date.d.mts +49 -0
- package/mysql-core/columns/date.d.ts +6 -6
- package/mysql-core/columns/datetime.d.cts +53 -0
- package/mysql-core/columns/datetime.d.mts +53 -0
- package/mysql-core/columns/datetime.d.ts +6 -6
- package/mysql-core/columns/decimal.d.cts +27 -0
- package/mysql-core/columns/decimal.d.mts +27 -0
- package/mysql-core/columns/decimal.d.ts +4 -4
- package/mysql-core/columns/double.d.cts +27 -0
- package/mysql-core/columns/double.d.mts +27 -0
- package/mysql-core/columns/double.d.ts +4 -4
- package/mysql-core/columns/enum.d.cts +27 -0
- package/mysql-core/columns/enum.d.mts +27 -0
- package/mysql-core/columns/enum.d.ts +5 -5
- package/mysql-core/columns/float.d.cts +21 -0
- package/mysql-core/columns/float.d.mts +21 -0
- package/mysql-core/columns/float.d.ts +4 -4
- package/mysql-core/columns/index.d.cts +25 -0
- package/mysql-core/columns/index.d.mts +25 -0
- package/mysql-core/columns/index.d.ts +25 -25
- package/mysql-core/columns/int.d.cts +22 -0
- package/mysql-core/columns/int.d.mts +22 -0
- package/mysql-core/columns/int.d.ts +4 -4
- package/mysql-core/columns/json.d.cts +22 -0
- package/mysql-core/columns/json.d.mts +22 -0
- package/mysql-core/columns/json.d.ts +4 -4
- package/mysql-core/columns/mediumint.d.cts +22 -0
- package/mysql-core/columns/mediumint.d.mts +22 -0
- package/mysql-core/columns/mediumint.d.ts +4 -4
- package/mysql-core/columns/real.d.cts +27 -0
- package/mysql-core/columns/real.d.mts +27 -0
- package/mysql-core/columns/real.d.ts +4 -4
- package/mysql-core/columns/serial.d.cts +22 -0
- package/mysql-core/columns/serial.d.mts +22 -0
- package/mysql-core/columns/serial.d.ts +4 -4
- package/mysql-core/columns/smallint.d.cts +22 -0
- package/mysql-core/columns/smallint.d.mts +22 -0
- package/mysql-core/columns/smallint.d.ts +4 -4
- package/mysql-core/columns/text.d.cts +37 -0
- package/mysql-core/columns/text.d.mts +37 -0
- package/mysql-core/columns/text.d.ts +5 -5
- package/mysql-core/columns/time.d.cts +25 -0
- package/mysql-core/columns/time.d.mts +25 -0
- package/mysql-core/columns/time.d.ts +4 -4
- package/mysql-core/columns/timestamp.d.cts +47 -0
- package/mysql-core/columns/timestamp.d.mts +47 -0
- package/mysql-core/columns/timestamp.d.ts +5 -5
- package/mysql-core/columns/tinyint.d.cts +22 -0
- package/mysql-core/columns/tinyint.d.mts +22 -0
- package/mysql-core/columns/tinyint.d.ts +4 -4
- package/mysql-core/columns/varbinary.d.cts +24 -0
- package/mysql-core/columns/varbinary.d.mts +24 -0
- package/mysql-core/columns/varbinary.d.ts +4 -4
- package/mysql-core/columns/varchar.d.cts +27 -0
- package/mysql-core/columns/varchar.d.mts +27 -0
- package/mysql-core/columns/varchar.d.ts +5 -5
- package/mysql-core/columns/year.d.cts +21 -0
- package/mysql-core/columns/year.d.mts +21 -0
- package/mysql-core/columns/year.d.ts +4 -4
- package/mysql-core/db.d.cts +55 -0
- package/mysql-core/db.d.mts +55 -0
- package/mysql-core/db.d.ts +14 -14
- package/mysql-core/dialect.d.cts +59 -0
- package/mysql-core/dialect.d.mts +59 -0
- package/mysql-core/dialect.d.ts +12 -12
- package/mysql-core/expressions.d.cts +8 -0
- package/mysql-core/expressions.d.mts +8 -0
- package/mysql-core/expressions.d.ts +3 -3
- package/mysql-core/foreign-keys.d.cts +48 -0
- package/mysql-core/foreign-keys.d.mts +48 -0
- package/mysql-core/foreign-keys.d.ts +3 -3
- package/mysql-core/index.cjs +156 -1028
- package/mysql-core/index.cjs.map +1 -1
- package/mysql-core/index.d.cts +16 -0
- package/mysql-core/index.d.mts +16 -0
- package/mysql-core/index.d.ts +16 -16
- package/mysql-core/index.mjs +37 -36
- package/mysql-core/index.mjs.map +1 -1
- package/mysql-core/indexes.d.cts +59 -0
- package/mysql-core/indexes.d.mts +59 -0
- package/mysql-core/indexes.d.ts +4 -4
- package/mysql-core/primary-keys.d.cts +17 -0
- package/mysql-core/primary-keys.d.mts +17 -0
- package/mysql-core/primary-keys.d.ts +3 -3
- package/mysql-core/query-builders/delete.d.cts +39 -0
- package/mysql-core/query-builders/delete.d.mts +39 -0
- package/mysql-core/query-builders/delete.d.ts +9 -9
- package/mysql-core/query-builders/index.d.cts +6 -0
- package/mysql-core/query-builders/index.d.mts +6 -0
- package/mysql-core/query-builders/index.d.ts +6 -6
- package/mysql-core/query-builders/insert.d.cts +59 -0
- package/mysql-core/query-builders/insert.d.mts +59 -0
- package/mysql-core/query-builders/insert.d.ts +11 -11
- package/mysql-core/query-builders/query-builder.d.cts +29 -0
- package/mysql-core/query-builders/query-builder.d.mts +29 -0
- package/mysql-core/query-builders/query-builder.d.ts +7 -7
- package/mysql-core/query-builders/query.d.cts +44 -0
- package/mysql-core/query-builders/query.d.mts +44 -0
- package/mysql-core/query-builders/query.d.ts +9 -9
- package/mysql-core/query-builders/select.d.cts +92 -0
- package/mysql-core/query-builders/select.d.mts +92 -0
- package/mysql-core/query-builders/select.d.ts +17 -17
- package/mysql-core/query-builders/select.types.d.cts +77 -0
- package/mysql-core/query-builders/select.types.d.mts +77 -0
- package/mysql-core/query-builders/select.types.d.ts +12 -12
- package/mysql-core/query-builders/update.d.cts +54 -0
- package/mysql-core/query-builders/update.d.mts +54 -0
- package/mysql-core/query-builders/update.d.ts +11 -11
- package/mysql-core/schema.d.cts +24 -0
- package/mysql-core/schema.d.mts +24 -0
- package/mysql-core/schema.d.ts +3 -3
- package/mysql-core/session.d.cts +63 -0
- package/mysql-core/session.d.mts +63 -0
- package/mysql-core/session.d.ts +7 -7
- package/mysql-core/subquery.d.cts +6 -0
- package/mysql-core/subquery.d.mts +6 -0
- package/mysql-core/subquery.d.ts +4 -4
- package/mysql-core/table.d.cts +35 -0
- package/mysql-core/table.d.mts +35 -0
- package/mysql-core/table.d.ts +11 -11
- package/mysql-core/unique-constraint.d.cts +24 -0
- package/mysql-core/unique-constraint.d.mts +24 -0
- package/mysql-core/unique-constraint.d.ts +3 -3
- package/mysql-core/utils.d.cts +32 -0
- package/mysql-core/utils.d.mts +32 -0
- package/mysql-core/utils.d.ts +11 -11
- package/mysql-core/view.d.cts +73 -0
- package/mysql-core/view.d.mts +73 -0
- package/mysql-core/view.d.ts +11 -11
- package/mysql2/driver.d.cts +31 -0
- package/mysql2/driver.d.mts +31 -0
- package/mysql2/driver.d.ts +10 -10
- package/mysql2/index.cjs +29 -27
- package/mysql2/index.cjs.map +1 -1
- package/mysql2/index.d.cts +2 -0
- package/mysql2/index.d.mts +2 -0
- package/mysql2/index.d.ts +2 -2
- package/mysql2/index.mjs +5 -2
- package/mysql2/index.mjs.map +1 -1
- package/mysql2/migrator.d.cts +3 -0
- package/mysql2/migrator.d.mts +3 -0
- package/mysql2/migrator.d.ts +2 -2
- package/mysql2/session.d.cts +52 -0
- package/mysql2/session.d.mts +52 -0
- package/mysql2/session.d.ts +8 -8
- package/neon-http/driver.d.cts +21 -0
- package/neon-http/driver.d.mts +21 -0
- package/neon-http/driver.d.ts +7 -7
- package/neon-http/index.cjs +16 -16
- package/neon-http/index.d.cts +2 -0
- package/neon-http/index.d.mts +2 -0
- package/neon-http/index.d.ts +2 -2
- package/neon-http/index.mjs +3 -2
- package/neon-http/index.mjs.map +1 -1
- package/neon-http/migrator.cjs +9 -6
- package/neon-http/migrator.cjs.map +1 -1
- package/neon-http/migrator.d.cts +11 -0
- package/neon-http/migrator.d.mts +11 -0
- package/neon-http/migrator.d.ts +2 -2
- package/neon-http/migrator.mjs +3 -1
- package/neon-http/migrator.mjs.map +1 -1
- package/neon-http/session.d.cts +55 -0
- package/neon-http/session.d.mts +55 -0
- package/neon-http/session.d.ts +10 -10
- package/neon-serverless/driver.d.cts +22 -0
- package/neon-serverless/driver.d.mts +22 -0
- package/neon-serverless/driver.d.ts +8 -8
- package/neon-serverless/index.cjs +22 -22
- package/neon-serverless/index.d.cts +2 -0
- package/neon-serverless/index.d.mts +2 -0
- package/neon-serverless/index.d.ts +2 -2
- package/neon-serverless/index.mjs +3 -2
- package/neon-serverless/index.mjs.map +1 -1
- package/neon-serverless/migrator.d.cts +3 -0
- package/neon-serverless/migrator.d.mts +3 -0
- package/neon-serverless/migrator.d.ts +2 -2
- package/neon-serverless/session.d.cts +48 -0
- package/neon-serverless/session.d.mts +48 -0
- package/neon-serverless/session.d.ts +10 -10
- package/node-postgres/driver.d.cts +22 -0
- package/node-postgres/driver.d.mts +22 -0
- package/node-postgres/driver.d.ts +8 -8
- package/node-postgres/index.cjs +27 -27
- package/node-postgres/index.d.cts +2 -0
- package/node-postgres/index.d.mts +2 -0
- package/node-postgres/index.d.ts +2 -2
- package/node-postgres/index.mjs +3 -2
- package/node-postgres/index.mjs.map +1 -1
- package/node-postgres/migrator.d.cts +3 -0
- package/node-postgres/migrator.d.mts +3 -0
- package/node-postgres/migrator.d.ts +2 -2
- package/node-postgres/session.d.cts +46 -0
- package/node-postgres/session.d.mts +46 -0
- package/node-postgres/session.d.ts +10 -10
- package/operations.d.cts +15 -0
- package/operations.d.mts +15 -0
- package/operations.d.ts +3 -3
- package/package.json +291 -74
- package/pg-core/alias.d.cts +4 -0
- package/pg-core/alias.d.mts +4 -0
- package/pg-core/alias.d.ts +3 -3
- package/pg-core/checks.d.cts +18 -0
- package/pg-core/checks.d.mts +18 -0
- package/pg-core/checks.d.ts +3 -3
- package/pg-core/columns/array.d.cts +26 -0
- package/pg-core/columns/array.d.mts +26 -0
- package/pg-core/columns/array.d.ts +5 -5
- package/pg-core/columns/bigint.d.cts +43 -0
- package/pg-core/columns/bigint.d.mts +43 -0
- package/pg-core/columns/bigint.d.ts +4 -4
- package/pg-core/columns/bigserial.d.cts +43 -0
- package/pg-core/columns/bigserial.d.mts +43 -0
- package/pg-core/columns/bigserial.d.ts +4 -4
- package/pg-core/columns/boolean.d.cts +21 -0
- package/pg-core/columns/boolean.d.mts +21 -0
- package/pg-core/columns/boolean.d.ts +4 -4
- package/pg-core/columns/char.d.cts +34 -0
- package/pg-core/columns/char.d.mts +34 -0
- package/pg-core/columns/char.d.ts +5 -5
- package/pg-core/columns/cidr.d.cts +21 -0
- package/pg-core/columns/cidr.d.mts +21 -0
- package/pg-core/columns/cidr.d.ts +4 -4
- package/pg-core/columns/common.d.cts +54 -0
- package/pg-core/columns/common.d.mts +54 -0
- package/pg-core/columns/common.d.ts +15 -13
- package/pg-core/columns/custom.d.cts +148 -0
- package/pg-core/columns/custom.d.mts +148 -0
- package/pg-core/columns/custom.d.ts +7 -7
- package/pg-core/columns/date.common.d.cts +7 -0
- package/pg-core/columns/date.common.d.mts +7 -0
- package/pg-core/columns/date.common.d.ts +4 -4
- package/pg-core/columns/date.d.cts +45 -0
- package/pg-core/columns/date.d.mts +45 -0
- package/pg-core/columns/date.d.ts +5 -5
- package/pg-core/columns/double-precision.d.cts +22 -0
- package/pg-core/columns/double-precision.d.mts +22 -0
- package/pg-core/columns/double-precision.d.ts +4 -4
- package/pg-core/columns/enum.d.cts +42 -0
- package/pg-core/columns/enum.d.mts +42 -0
- package/pg-core/columns/enum.d.ts +6 -6
- package/pg-core/columns/index.d.cts +28 -0
- package/pg-core/columns/index.d.mts +28 -0
- package/pg-core/columns/index.d.ts +28 -28
- package/pg-core/columns/inet.d.cts +21 -0
- package/pg-core/columns/inet.d.mts +21 -0
- package/pg-core/columns/inet.d.ts +4 -4
- package/pg-core/columns/integer.d.cts +23 -0
- package/pg-core/columns/integer.d.mts +23 -0
- package/pg-core/columns/integer.d.ts +4 -4
- package/pg-core/columns/interval.d.cts +32 -0
- package/pg-core/columns/interval.d.mts +32 -0
- package/pg-core/columns/interval.d.ts +5 -5
- package/pg-core/columns/json.d.cts +27 -0
- package/pg-core/columns/json.d.mts +27 -0
- package/pg-core/columns/json.d.ts +5 -5
- package/pg-core/columns/jsonb.d.cts +27 -0
- package/pg-core/columns/jsonb.d.mts +27 -0
- package/pg-core/columns/jsonb.d.ts +5 -5
- package/pg-core/columns/macaddr.d.cts +21 -0
- package/pg-core/columns/macaddr.d.mts +21 -0
- package/pg-core/columns/macaddr.d.ts +4 -4
- package/pg-core/columns/macaddr8.d.cts +21 -0
- package/pg-core/columns/macaddr8.d.mts +21 -0
- package/pg-core/columns/macaddr8.d.ts +4 -4
- package/pg-core/columns/numeric.d.cts +40 -0
- package/pg-core/columns/numeric.d.mts +40 -0
- package/pg-core/columns/numeric.d.ts +5 -5
- package/pg-core/columns/real.d.cts +28 -0
- package/pg-core/columns/real.d.mts +28 -0
- package/pg-core/columns/real.d.ts +5 -5
- package/pg-core/columns/serial.d.cts +21 -0
- package/pg-core/columns/serial.d.mts +21 -0
- package/pg-core/columns/serial.d.ts +4 -4
- package/pg-core/columns/smallint.d.cts +22 -0
- package/pg-core/columns/smallint.d.mts +22 -0
- package/pg-core/columns/smallint.d.ts +4 -4
- package/pg-core/columns/smallserial.d.cts +21 -0
- package/pg-core/columns/smallserial.d.mts +21 -0
- package/pg-core/columns/smallserial.d.ts +4 -4
- package/pg-core/columns/text.d.cts +31 -0
- package/pg-core/columns/text.d.mts +31 -0
- package/pg-core/columns/text.d.ts +5 -5
- package/pg-core/columns/time.d.cts +38 -0
- package/pg-core/columns/time.d.mts +38 -0
- package/pg-core/columns/time.d.ts +7 -7
- package/pg-core/columns/timestamp.d.cts +64 -0
- package/pg-core/columns/timestamp.d.mts +64 -0
- package/pg-core/columns/timestamp.d.ts +7 -7
- package/pg-core/columns/uuid.d.cts +25 -0
- package/pg-core/columns/uuid.d.mts +25 -0
- package/pg-core/columns/uuid.d.ts +4 -4
- package/pg-core/columns/varchar.d.cts +34 -0
- package/pg-core/columns/varchar.d.mts +34 -0
- package/pg-core/columns/varchar.d.ts +5 -5
- package/pg-core/db.d.cts +53 -0
- package/pg-core/db.d.mts +53 -0
- package/pg-core/db.d.ts +17 -17
- package/pg-core/dialect.d.cts +53 -0
- package/pg-core/dialect.d.mts +53 -0
- package/pg-core/dialect.d.ts +11 -11
- package/pg-core/expressions.d.cts +8 -0
- package/pg-core/expressions.d.mts +8 -0
- package/pg-core/expressions.d.ts +3 -3
- package/pg-core/foreign-keys.d.cts +45 -0
- package/pg-core/foreign-keys.d.mts +45 -0
- package/pg-core/foreign-keys.d.ts +3 -3
- package/pg-core/index.cjs +158 -157
- package/pg-core/index.cjs.map +1 -1
- package/pg-core/index.d.cts +16 -0
- package/pg-core/index.d.mts +16 -0
- package/pg-core/index.d.ts +16 -16
- package/pg-core/index.mjs +8 -7
- package/pg-core/index.mjs.map +1 -1
- package/pg-core/indexes.d.cts +72 -0
- package/pg-core/indexes.d.mts +72 -0
- package/pg-core/indexes.d.ts +4 -4
- package/pg-core/primary-keys.d.cts +17 -0
- package/pg-core/primary-keys.d.mts +17 -0
- package/pg-core/primary-keys.d.ts +3 -3
- package/pg-core/query-builders/delete.d.cts +35 -0
- package/pg-core/query-builders/delete.d.mts +35 -0
- package/pg-core/query-builders/delete.d.ts +9 -9
- package/pg-core/query-builders/index.d.cts +7 -0
- package/pg-core/query-builders/index.d.mts +7 -0
- package/pg-core/query-builders/index.d.ts +7 -7
- package/pg-core/query-builders/insert.d.cts +63 -0
- package/pg-core/query-builders/insert.d.mts +63 -0
- package/pg-core/query-builders/insert.d.ts +12 -12
- package/pg-core/query-builders/query-builder.d.cts +37 -0
- package/pg-core/query-builders/query-builder.d.mts +37 -0
- package/pg-core/query-builders/query-builder.d.ts +9 -9
- package/pg-core/query-builders/query.d.cts +39 -0
- package/pg-core/query-builders/query.d.mts +39 -0
- package/pg-core/query-builders/query.d.ts +7 -7
- package/pg-core/query-builders/refresh-materialized-view.d.cts +26 -0
- package/pg-core/query-builders/refresh-materialized-view.d.mts +26 -0
- package/pg-core/query-builders/refresh-materialized-view.d.ts +6 -6
- package/pg-core/query-builders/select.d.cts +211 -0
- package/pg-core/query-builders/select.d.mts +211 -0
- package/pg-core/query-builders/select.d.ts +15 -15
- package/pg-core/query-builders/select.types.d.cts +79 -0
- package/pg-core/query-builders/select.types.d.mts +79 -0
- package/pg-core/query-builders/select.types.d.ts +11 -11
- package/pg-core/query-builders/update.d.cts +53 -0
- package/pg-core/query-builders/update.d.mts +53 -0
- package/pg-core/query-builders/update.d.ts +11 -11
- package/pg-core/schema.d.cts +13 -0
- package/pg-core/schema.d.mts +13 -0
- package/pg-core/schema.d.ts +3 -3
- package/pg-core/session.d.cts +54 -0
- package/pg-core/session.d.mts +54 -0
- package/pg-core/session.d.ts +6 -6
- package/pg-core/subquery.d.cts +5 -0
- package/pg-core/subquery.d.mts +5 -0
- package/pg-core/subquery.d.ts +3 -3
- package/pg-core/table.d.cts +28 -0
- package/pg-core/table.d.mts +28 -0
- package/pg-core/table.d.ts +10 -10
- package/pg-core/unique-constraint.d.cts +25 -0
- package/pg-core/unique-constraint.d.mts +25 -0
- package/pg-core/unique-constraint.d.ts +3 -3
- package/pg-core/utils.d.cts +52 -0
- package/pg-core/utils.d.mts +52 -0
- package/pg-core/utils.d.ts +16 -16
- package/pg-core/view.d.cts +143 -0
- package/pg-core/view.d.mts +143 -0
- package/pg-core/view.d.ts +13 -13
- package/planetscale-serverless/driver.d.cts +10 -0
- package/planetscale-serverless/driver.d.mts +10 -0
- package/planetscale-serverless/driver.d.ts +4 -4
- package/planetscale-serverless/index.cjs +18 -18
- package/planetscale-serverless/index.cjs.map +1 -1
- package/planetscale-serverless/index.d.cts +2 -0
- package/planetscale-serverless/index.d.mts +2 -0
- package/planetscale-serverless/index.d.ts +2 -2
- package/planetscale-serverless/index.mjs +3 -2
- package/planetscale-serverless/index.mjs.map +1 -1
- package/planetscale-serverless/migrator.d.cts +3 -0
- package/planetscale-serverless/migrator.d.mts +3 -0
- package/planetscale-serverless/migrator.d.ts +2 -2
- package/planetscale-serverless/session.d.cts +52 -0
- package/planetscale-serverless/session.d.mts +52 -0
- package/planetscale-serverless/session.d.ts +8 -8
- package/postgres-js/driver.d.cts +6 -0
- package/postgres-js/driver.d.mts +6 -0
- package/postgres-js/driver.d.ts +3 -3
- package/postgres-js/index.cjs +20 -20
- package/postgres-js/index.d.cts +2 -0
- package/postgres-js/index.d.mts +2 -0
- package/postgres-js/index.d.ts +2 -2
- package/postgres-js/index.mjs +3 -2
- package/postgres-js/index.mjs.map +1 -1
- package/postgres-js/migrator.d.cts +3 -0
- package/postgres-js/migrator.d.mts +3 -0
- package/postgres-js/migrator.d.ts +2 -2
- package/postgres-js/session.d.cts +49 -0
- package/postgres-js/session.d.mts +49 -0
- package/postgres-js/session.d.ts +10 -10
- package/primary-key.d.cts +10 -0
- package/primary-key.d.mts +10 -0
- package/primary-key.d.ts +3 -3
- package/query-builders/query-builder.d.cts +10 -0
- package/query-builders/query-builder.d.mts +10 -0
- package/query-builders/query-builder.d.ts +2 -2
- package/query-builders/select.types.d.cts +56 -0
- package/query-builders/select.types.d.mts +56 -0
- package/query-builders/select.types.d.ts +8 -8
- package/query-promise.d.cts +9 -0
- package/query-promise.d.mts +9 -0
- package/query-promise.d.ts +1 -1
- package/relations.d.cts +189 -0
- package/relations.d.mts +189 -0
- package/relations.d.ts +10 -10
- package/{session-775da517.mjs → session-a0c900ab.mjs} +5 -3
- package/session-a0c900ab.mjs.map +1 -0
- package/{session-e7fcd577.mjs → session-a706e83f.mjs} +3 -2
- package/session-a706e83f.mjs.map +1 -0
- package/{session-f61b6e4d.cjs → session-fadbb086.cjs} +239 -239
- package/session-fadbb086.cjs.map +1 -0
- package/sql/expressions/conditions.d.cts +393 -0
- package/sql/expressions/conditions.d.mts +393 -0
- package/sql/expressions/conditions.d.ts +2 -2
- package/sql/expressions/index.d.cts +2 -0
- package/sql/expressions/index.d.mts +2 -0
- package/sql/expressions/index.d.ts +2 -2
- package/sql/expressions/select.d.cts +38 -0
- package/sql/expressions/select.d.mts +38 -0
- package/sql/expressions/select.d.ts +2 -2
- package/sql/index.d.cts +191 -0
- package/sql/index.d.mts +191 -0
- package/sql/index.d.ts +7 -7
- package/sql-js/driver.d.cts +5 -0
- package/sql-js/driver.d.mts +5 -0
- package/sql-js/driver.d.ts +2 -2
- package/sql-js/index.cjs +19 -19
- package/sql-js/index.d.cts +2 -0
- package/sql-js/index.d.mts +2 -0
- package/sql-js/index.d.ts +2 -2
- package/sql-js/index.mjs +3 -2
- package/sql-js/index.mjs.map +1 -1
- package/sql-js/migrator.d.cts +3 -0
- package/sql-js/migrator.d.mts +3 -0
- package/sql-js/migrator.d.ts +2 -2
- package/sql-js/session.d.cts +52 -0
- package/sql-js/session.d.mts +52 -0
- package/sql-js/session.d.ts +9 -9
- package/sqlite-core/alias.d.cts +4 -0
- package/sqlite-core/alias.d.mts +4 -0
- package/sqlite-core/alias.d.ts +3 -3
- package/sqlite-core/checks.d.cts +22 -0
- package/sqlite-core/checks.d.mts +22 -0
- package/sqlite-core/checks.d.ts +3 -3
- package/sqlite-core/columns/blob.d.cts +65 -0
- package/sqlite-core/columns/blob.d.mts +65 -0
- package/sqlite-core/columns/blob.d.ts +6 -6
- package/sqlite-core/columns/common.d.cts +35 -0
- package/sqlite-core/columns/common.d.mts +35 -0
- package/sqlite-core/columns/common.d.ts +14 -12
- package/sqlite-core/columns/custom.d.cts +148 -0
- package/sqlite-core/columns/custom.d.mts +148 -0
- package/sqlite-core/columns/custom.d.ts +7 -7
- package/sqlite-core/columns/index.d.cts +7 -0
- package/sqlite-core/columns/index.d.mts +7 -0
- package/sqlite-core/columns/index.d.ts +7 -7
- package/sqlite-core/columns/integer.d.cts +106 -0
- package/sqlite-core/columns/integer.d.mts +106 -0
- package/sqlite-core/columns/integer.d.ts +7 -7
- package/sqlite-core/columns/numeric.d.cts +21 -0
- package/sqlite-core/columns/numeric.d.mts +21 -0
- package/sqlite-core/columns/numeric.d.ts +4 -4
- package/sqlite-core/columns/real.d.cts +21 -0
- package/sqlite-core/columns/real.d.mts +21 -0
- package/sqlite-core/columns/real.d.ts +4 -4
- package/sqlite-core/columns/text.d.cts +38 -0
- package/sqlite-core/columns/text.d.mts +38 -0
- package/sqlite-core/columns/text.d.ts +6 -6
- package/sqlite-core/db.d.cts +57 -0
- package/sqlite-core/db.d.mts +57 -0
- package/sqlite-core/db.d.ts +14 -14
- package/sqlite-core/dialect.d.cts +53 -0
- package/sqlite-core/dialect.d.mts +53 -0
- package/sqlite-core/dialect.d.ts +10 -10
- package/sqlite-core/expressions.d.cts +9 -0
- package/sqlite-core/expressions.d.mts +9 -0
- package/sqlite-core/expressions.d.ts +3 -3
- package/sqlite-core/foreign-keys.d.cts +48 -0
- package/sqlite-core/foreign-keys.d.mts +48 -0
- package/sqlite-core/foreign-keys.d.ts +3 -3
- package/sqlite-core/index.cjs +11 -11
- package/sqlite-core/index.cjs.map +1 -1
- package/sqlite-core/index.d.cts +15 -0
- package/sqlite-core/index.d.mts +15 -0
- package/sqlite-core/index.d.ts +15 -15
- package/sqlite-core/index.mjs +4 -3
- package/sqlite-core/index.mjs.map +1 -1
- package/sqlite-core/indexes.d.cts +41 -0
- package/sqlite-core/indexes.d.mts +41 -0
- package/sqlite-core/indexes.d.ts +4 -4
- package/sqlite-core/primary-keys.d.cts +20 -0
- package/sqlite-core/primary-keys.d.mts +20 -0
- package/sqlite-core/primary-keys.d.ts +3 -3
- package/sqlite-core/query-builders/delete.d.cts +42 -0
- package/sqlite-core/query-builders/delete.d.mts +42 -0
- package/sqlite-core/query-builders/delete.d.ts +10 -10
- package/sqlite-core/query-builders/index.d.cts +6 -0
- package/sqlite-core/query-builders/index.d.mts +6 -0
- package/sqlite-core/query-builders/index.d.ts +6 -6
- package/sqlite-core/query-builders/insert.d.cts +74 -0
- package/sqlite-core/query-builders/insert.d.mts +74 -0
- package/sqlite-core/query-builders/insert.d.ts +13 -13
- package/sqlite-core/query-builders/query-builder.d.cts +29 -0
- package/sqlite-core/query-builders/query-builder.d.mts +29 -0
- package/sqlite-core/query-builders/query-builder.d.ts +7 -7
- package/sqlite-core/query-builders/query.d.cts +47 -0
- package/sqlite-core/query-builders/query.d.mts +47 -0
- package/sqlite-core/query-builders/query.d.ts +7 -7
- package/sqlite-core/query-builders/select.d.cts +94 -0
- package/sqlite-core/query-builders/select.d.mts +94 -0
- package/sqlite-core/query-builders/select.d.ts +15 -15
- package/sqlite-core/query-builders/select.types.d.cts +63 -0
- package/sqlite-core/query-builders/select.types.d.mts +63 -0
- package/sqlite-core/query-builders/select.types.d.ts +11 -11
- package/sqlite-core/query-builders/update.d.cts +63 -0
- package/sqlite-core/query-builders/update.d.mts +63 -0
- package/sqlite-core/query-builders/update.d.ts +11 -11
- package/sqlite-core/session.d.cts +91 -0
- package/sqlite-core/session.d.mts +91 -0
- package/sqlite-core/session.d.ts +7 -7
- package/sqlite-core/subquery.d.cts +5 -0
- package/sqlite-core/subquery.d.mts +5 -0
- package/sqlite-core/subquery.d.ts +3 -3
- package/sqlite-core/table.d.cts +28 -0
- package/sqlite-core/table.d.mts +28 -0
- package/sqlite-core/table.d.ts +10 -10
- package/sqlite-core/unique-constraint.d.cts +23 -0
- package/sqlite-core/unique-constraint.d.mts +23 -0
- package/sqlite-core/unique-constraint.d.ts +3 -3
- package/sqlite-core/utils.d.cts +31 -0
- package/sqlite-core/utils.d.mts +31 -0
- package/sqlite-core/utils.d.ts +11 -11
- package/sqlite-core/view.d.cts +67 -0
- package/sqlite-core/view.d.mts +67 -0
- package/sqlite-core/view.d.ts +11 -11
- package/sqlite-proxy/driver.d.cts +11 -0
- package/sqlite-proxy/driver.d.mts +11 -0
- package/sqlite-proxy/driver.d.ts +2 -2
- package/sqlite-proxy/index.cjs +19 -19
- package/sqlite-proxy/index.d.cts +2 -0
- package/sqlite-proxy/index.d.mts +2 -0
- package/sqlite-proxy/index.d.ts +2 -2
- package/sqlite-proxy/index.mjs +3 -2
- package/sqlite-proxy/index.mjs.map +1 -1
- package/sqlite-proxy/migrator.cjs +4 -3
- package/sqlite-proxy/migrator.cjs.map +1 -1
- package/sqlite-proxy/migrator.d.cts +4 -0
- package/sqlite-proxy/migrator.d.mts +4 -0
- package/sqlite-proxy/migrator.d.ts +2 -2
- package/sqlite-proxy/migrator.mjs +2 -1
- package/sqlite-proxy/migrator.mjs.map +1 -1
- package/sqlite-proxy/session.d.cts +48 -0
- package/sqlite-proxy/session.d.mts +48 -0
- package/sqlite-proxy/session.d.ts +10 -10
- package/subquery.d.cts +23 -0
- package/subquery.d.mts +23 -0
- package/subquery.d.ts +3 -3
- package/table.d.cts +63 -0
- package/table.d.mts +63 -0
- package/table.d.ts +8 -8
- package/tracing.d.cts +1 -0
- package/tracing.d.mts +1 -0
- package/utils.d.cts +45 -0
- package/utils.d.mts +45 -0
- package/utils.d.ts +4 -4
- package/vercel-postgres/driver.d.cts +21 -0
- package/vercel-postgres/driver.d.mts +21 -0
- package/vercel-postgres/driver.d.ts +7 -7
- package/vercel-postgres/index.cjs +22 -22
- package/vercel-postgres/index.d.cts +2 -0
- package/vercel-postgres/index.d.mts +2 -0
- package/vercel-postgres/index.d.ts +2 -2
- package/vercel-postgres/index.mjs +3 -2
- package/vercel-postgres/index.mjs.map +1 -1
- package/vercel-postgres/migrator.d.cts +3 -0
- package/vercel-postgres/migrator.d.mts +3 -0
- package/vercel-postgres/migrator.d.ts +2 -2
- package/vercel-postgres/session.d.cts +47 -0
- package/vercel-postgres/session.d.mts +47 -0
- package/vercel-postgres/session.d.ts +9 -9
- package/version.cjs +1 -1
- package/version.d.cts +2 -0
- package/version.d.mts +2 -0
- package/version.mjs +1 -1
- package/{session-9eb850c1.mjs → view-ba779eb7.mjs} +171 -169
- package/view-ba779eb7.mjs.map +1 -0
- package/{session-690cd067.cjs → view-e96fe3b6.cjs} +1400 -445
- package/view-e96fe3b6.cjs.map +1 -0
- package/view.d.cts +24 -0
- package/view.d.mts +24 -0
- package/view.d.ts +5 -5
- package/alias-58b7b8c9.cjs.map +0 -1
- package/alias-d302772a.mjs.map +0 -1
- package/session-690cd067.cjs.map +0 -1
- package/session-775da517.mjs.map +0 -1
- package/session-9eb850c1.mjs.map +0 -1
- package/session-e7fcd577.mjs.map +0 -1
- package/session-f61b6e4d.cjs.map +0 -1
package/neon-http/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var serverless = require('@neondatabase/serverless');
|
|
4
|
-
var
|
|
5
|
-
|
|
4
|
+
var index = require('../index-b1dbb7ec.cjs');
|
|
5
|
+
require('@opentelemetry/api');
|
|
6
6
|
|
|
7
7
|
var _a$1, _b, _c;
|
|
8
|
-
class NeonHttpPreparedQuery extends
|
|
8
|
+
class NeonHttpPreparedQuery extends index.PreparedQuery {
|
|
9
9
|
constructor(client, queryString, params, logger, fields, name, customResultMapper) {
|
|
10
10
|
super();
|
|
11
11
|
this.client = client;
|
|
@@ -22,7 +22,7 @@ class NeonHttpPreparedQuery extends alias.PreparedQuery {
|
|
|
22
22
|
this.query = { arrayMode: true, fullResults: true };
|
|
23
23
|
}
|
|
24
24
|
async execute(placeholderValues = {}) {
|
|
25
|
-
const params =
|
|
25
|
+
const params = index.fillPlaceholders(this.params, placeholderValues);
|
|
26
26
|
this.logger.logQuery(this.queryString, params);
|
|
27
27
|
const { fields, client, queryString, query, rawQuery, joinsNotNullableMap, customResultMapper } = this;
|
|
28
28
|
if (!fields && !customResultMapper) {
|
|
@@ -31,22 +31,22 @@ class NeonHttpPreparedQuery extends alias.PreparedQuery {
|
|
|
31
31
|
const result = await client(queryString, params, query);
|
|
32
32
|
return customResultMapper
|
|
33
33
|
? customResultMapper(result.rows)
|
|
34
|
-
: result.rows.map((row) =>
|
|
34
|
+
: result.rows.map((row) => index.mapResultRow(fields, row, joinsNotNullableMap));
|
|
35
35
|
}
|
|
36
36
|
all(placeholderValues = {}) {
|
|
37
|
-
const params =
|
|
37
|
+
const params = index.fillPlaceholders(this.params, placeholderValues);
|
|
38
38
|
this.logger.logQuery(this.queryString, params);
|
|
39
39
|
return this.client(this.queryString, params, this.rawQuery).then((result) => result.rows);
|
|
40
40
|
}
|
|
41
41
|
values(placeholderValues = {}) {
|
|
42
|
-
const params =
|
|
42
|
+
const params = index.fillPlaceholders(this.params, placeholderValues);
|
|
43
43
|
this.logger.logQuery(this.queryString, params);
|
|
44
44
|
return this.client(this.queryString, params).then((result) => result.rows);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
_a$1 =
|
|
47
|
+
_a$1 = index.entityKind;
|
|
48
48
|
NeonHttpPreparedQuery[_a$1] = 'NeonHttpPreparedQuery';
|
|
49
|
-
class NeonHttpSession extends
|
|
49
|
+
class NeonHttpSession extends index.PgSession {
|
|
50
50
|
constructor(client, dialect, schema, options = {}) {
|
|
51
51
|
super(dialect);
|
|
52
52
|
this.client = client;
|
|
@@ -73,9 +73,9 @@ class NeonHttpSession extends alias.PgSession {
|
|
|
73
73
|
throw new Error('No transactions support in neon-http driver');
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
_b =
|
|
76
|
+
_b = index.entityKind;
|
|
77
77
|
NeonHttpSession[_b] = 'NeonHttpSession';
|
|
78
|
-
class NeonTransaction extends
|
|
78
|
+
class NeonTransaction extends index.PgTransaction {
|
|
79
79
|
async transaction(_transaction) {
|
|
80
80
|
throw new Error('No transactions support in neon-http driver');
|
|
81
81
|
// const savepointName = `sp${this.nestedIndex + 1}`;
|
|
@@ -91,7 +91,7 @@ class NeonTransaction extends alias.PgTransaction {
|
|
|
91
91
|
// }
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
_c =
|
|
94
|
+
_c = index.entityKind;
|
|
95
95
|
NeonTransaction[_c] = 'NeonHttpTransaction';
|
|
96
96
|
|
|
97
97
|
var _a;
|
|
@@ -111,10 +111,10 @@ class NeonHttpDriver {
|
|
|
111
111
|
serverless.types.setTypeParser(serverless.types.builtins.DATE, (val) => val);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
_a =
|
|
114
|
+
_a = index.entityKind;
|
|
115
115
|
NeonHttpDriver[_a] = 'NeonDriver';
|
|
116
116
|
function drizzle(client, config = {}) {
|
|
117
|
-
const dialect = new
|
|
117
|
+
const dialect = new index.PgDialect();
|
|
118
118
|
let logger;
|
|
119
119
|
if (config.logger === true) {
|
|
120
120
|
logger = new index.DefaultLogger();
|
|
@@ -124,7 +124,7 @@ function drizzle(client, config = {}) {
|
|
|
124
124
|
}
|
|
125
125
|
let schema;
|
|
126
126
|
if (config.schema) {
|
|
127
|
-
const tablesConfig =
|
|
127
|
+
const tablesConfig = index.extractTablesRelationalConfig(config.schema, index.createTableRelationsHelpers);
|
|
128
128
|
schema = {
|
|
129
129
|
fullSchema: config.schema,
|
|
130
130
|
schema: tablesConfig.tables,
|
|
@@ -133,7 +133,7 @@ function drizzle(client, config = {}) {
|
|
|
133
133
|
}
|
|
134
134
|
const driver = new NeonHttpDriver(client, dialect, { logger });
|
|
135
135
|
const session = driver.createSession(schema);
|
|
136
|
-
return new
|
|
136
|
+
return new index.PgDatabase(dialect, session, schema);
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
exports.NeonHttpDriver = NeonHttpDriver;
|
package/neon-http/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './driver';
|
|
2
|
-
export * from './session';
|
|
1
|
+
export * from './driver.js';
|
|
2
|
+
export * from './session.js';
|
package/neon-http/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { types } from '@neondatabase/serverless';
|
|
2
|
-
import { e as entityKind, f as fillPlaceholders, m as mapResultRow, a as extractTablesRelationalConfig, c as createTableRelationsHelpers, P as PgDialect } from '../alias-
|
|
2
|
+
import { e as entityKind, f as fillPlaceholders, m as mapResultRow, a as extractTablesRelationalConfig, c as createTableRelationsHelpers, P as PgDialect } from '../alias-e80df77c.mjs';
|
|
3
3
|
import { NoopLogger, DefaultLogger } from '../index.mjs';
|
|
4
|
-
import { P as PreparedQuery, a as PgSession, b as PgTransaction, c as PgDatabase } from '../session-
|
|
4
|
+
import { P as PreparedQuery, a as PgSession, b as PgTransaction, c as PgDatabase } from '../session-a706e83f.mjs';
|
|
5
|
+
import '@opentelemetry/api';
|
|
5
6
|
|
|
6
7
|
class NeonHttpPreparedQuery extends PreparedQuery {
|
|
7
8
|
client;
|
package/neon-http/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/neon-http/session.ts","../../src/neon-http/driver.ts"],"sourcesContent":[null,null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/neon-http/session.ts","../../src/neon-http/driver.ts"],"sourcesContent":[null,null],"names":[],"mappings":";;;;;;AAuBM,MAAO,qBAAqD,SAAQ,aAAgB,CAAA;AAOhF,IAAA,MAAA,CAAA;AACA,IAAA,WAAA,CAAA;AACA,IAAA,MAAA,CAAA;AACA,IAAA,MAAA,CAAA;AACA,IAAA,MAAA,CAAA;AACA,IAAA,IAAA,CAAA;AACA,IAAA,kBAAA,CAAA;AAZT,IAAA,QAAiB,UAAU,IAAY,uBAAuB,CAAC;AAEvD,IAAA,QAAQ,CAA4C;AACpD,IAAA,KAAK,CAA2C;AAExD,IAAA,WAAA,CACS,MAAsB,EACtB,WAAmB,EACnB,MAAiB,EACjB,MAAc,EACd,MAAyC,EACzC,IAAwB,EACxB,kBAAwD,EAAA;AAEhE,QAAA,KAAK,EAAE,CAAC;QARA,IAAM,CAAA,MAAA,GAAN,MAAM,CAAgB;QACtB,IAAW,CAAA,WAAA,GAAX,WAAW,CAAQ;QACnB,IAAM,CAAA,MAAA,GAAN,MAAM,CAAW;QACjB,IAAM,CAAA,MAAA,GAAN,MAAM,CAAQ;QACd,IAAM,CAAA,MAAA,GAAN,MAAM,CAAmC;QACzC,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAoB;QACxB,IAAkB,CAAA,kBAAA,GAAlB,kBAAkB,CAAsC;QAGhE,IAAI,CAAC,QAAQ,GAAG;AACf,YAAA,SAAS,EAAE,KAAK;AAChB,YAAA,WAAW,EAAE,IAAI;SACjB,CAA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,IAAI,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAA8B,CAAC;AAC9E;;;;"}
|
package/neon-http/migrator.cjs
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var migrator = require('../migrator.cjs');
|
|
4
|
-
var
|
|
4
|
+
var index = require('../index-b1dbb7ec.cjs');
|
|
5
|
+
require('./index.cjs');
|
|
5
6
|
require('node:crypto');
|
|
6
7
|
require('node:fs');
|
|
7
8
|
require('node:path');
|
|
9
|
+
require('@opentelemetry/api');
|
|
10
|
+
require('@neondatabase/serverless');
|
|
8
11
|
|
|
9
12
|
/**
|
|
10
13
|
* This function reads migrationFolder and execute each unapplied migration and mark it as executed in database
|
|
@@ -16,25 +19,25 @@ require('node:path');
|
|
|
16
19
|
*/
|
|
17
20
|
async function migrate(db, config) {
|
|
18
21
|
const migrations = migrator.readMigrationFiles(config);
|
|
19
|
-
const migrationTableCreate =
|
|
22
|
+
const migrationTableCreate = index.sql `
|
|
20
23
|
CREATE TABLE IF NOT EXISTS "drizzle"."__drizzle_migrations" (
|
|
21
24
|
id SERIAL PRIMARY KEY,
|
|
22
25
|
hash text NOT NULL,
|
|
23
26
|
created_at bigint
|
|
24
27
|
)
|
|
25
28
|
`;
|
|
26
|
-
await db.session.execute(
|
|
29
|
+
await db.session.execute(index.sql `CREATE SCHEMA IF NOT EXISTS "drizzle"`);
|
|
27
30
|
await db.session.execute(migrationTableCreate);
|
|
28
|
-
const dbMigrations = await db.session.all(
|
|
31
|
+
const dbMigrations = await db.session.all(index.sql `select id, hash, created_at from "drizzle"."__drizzle_migrations" order by created_at desc limit 1`);
|
|
29
32
|
const lastDbMigration = dbMigrations[0];
|
|
30
33
|
const rowsToInsert = [];
|
|
31
34
|
for await (const migration of migrations) {
|
|
32
35
|
if (!lastDbMigration
|
|
33
36
|
|| Number(lastDbMigration.created_at) < migration.folderMillis) {
|
|
34
37
|
for (const stmt of migration.sql) {
|
|
35
|
-
await db.session.execute(
|
|
38
|
+
await db.session.execute(index.sql.raw(stmt));
|
|
36
39
|
}
|
|
37
|
-
rowsToInsert.push(
|
|
40
|
+
rowsToInsert.push(index.sql `insert into "drizzle"."__drizzle_migrations" ("hash", "created_at") values(${migration.hash}, ${migration.folderMillis})`);
|
|
38
41
|
}
|
|
39
42
|
}
|
|
40
43
|
for await (const rowToInsert of rowsToInsert) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrator.cjs","sources":["../../src/neon-http/migrator.ts"],"sourcesContent":[null],"names":["readMigrationFiles","sql"],"mappings":"
|
|
1
|
+
{"version":3,"file":"migrator.cjs","sources":["../../src/neon-http/migrator.ts"],"sourcesContent":[null],"names":["readMigrationFiles","sql"],"mappings":";;;;;;;;;;;AAKA;;;;;;;AAOG;AACI,eAAe,OAAO,CAC5B,EAA6B,EAC7B,MAAgC,EAAA;AAEhC,IAAA,MAAM,UAAU,GAAGA,2BAAkB,CAAC,MAAM,CAAC,CAAC;IAC9C,MAAM,oBAAoB,GAAGC,SAAG,CAAA,CAAA;;;;;;EAM/B,CAAC;IACF,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAACA,SAAG,CAAA,CAAuC,qCAAA,CAAA,CAAC,CAAC;IACrE,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAE/C,IAAA,MAAM,YAAY,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,CACxCA,SAAG,CAAA,CAAA,kGAAA,CAAoG,CACvG,CAAC;AAEF,IAAA,MAAM,eAAe,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;IACxC,MAAM,YAAY,GAAU,EAAE,CAAC;AAC/B,IAAA,WAAW,MAAM,SAAS,IAAI,UAAU,EAAE;AACzC,QAAA,IACC,CAAC,eAAe;eACb,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC,YAAY,EAC7D;AACD,YAAA,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,GAAG,EAAE;AACjC,gBAAA,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAACA,SAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,aAAA;AAED,YAAA,YAAY,CAAC,IAAI,CAChBA,SAAG,CAAA,CAA8E,2EAAA,EAAA,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC,YAAY,CAAA,CAAA,CAAG,CAC7H,CAAC;AACF,SAAA;AACD,KAAA;AAED,IAAA,WAAW,MAAM,WAAW,IAAI,YAAY,EAAE;QAC7C,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;AACtC,KAAA;AACF;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MigrationConfig } from '../migrator.js';
|
|
2
|
+
import { type NeonHttpDatabase } from './driver.js';
|
|
3
|
+
/**
|
|
4
|
+
* This function reads migrationFolder and execute each unapplied migration and mark it as executed in database
|
|
5
|
+
*
|
|
6
|
+
* NOTE: The Neon HTTP driver does not support transactions. This means that if any part of a migration fails,
|
|
7
|
+
* no rollback will be executed. Currently, you will need to handle unsuccessful migration yourself.
|
|
8
|
+
* @param db - drizzle db instance
|
|
9
|
+
* @param config - path to migration folder generated by drizzle-kit
|
|
10
|
+
*/
|
|
11
|
+
export declare function migrate<TSchema extends Record<string, unknown>>(db: NeonHttpDatabase<TSchema>, config: string | MigrationConfig): Promise<void>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MigrationConfig } from '../migrator.js';
|
|
2
|
+
import { type NeonHttpDatabase } from './driver.js';
|
|
3
|
+
/**
|
|
4
|
+
* This function reads migrationFolder and execute each unapplied migration and mark it as executed in database
|
|
5
|
+
*
|
|
6
|
+
* NOTE: The Neon HTTP driver does not support transactions. This means that if any part of a migration fails,
|
|
7
|
+
* no rollback will be executed. Currently, you will need to handle unsuccessful migration yourself.
|
|
8
|
+
* @param db - drizzle db instance
|
|
9
|
+
* @param config - path to migration folder generated by drizzle-kit
|
|
10
|
+
*/
|
|
11
|
+
export declare function migrate<TSchema extends Record<string, unknown>>(db: NeonHttpDatabase<TSchema>, config: string | MigrationConfig): Promise<void>;
|
package/neon-http/migrator.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MigrationConfig } from '../migrator';
|
|
2
|
-
import { type NeonHttpDatabase } from './driver';
|
|
1
|
+
import type { MigrationConfig } from '../migrator.js';
|
|
2
|
+
import { type NeonHttpDatabase } from './driver.js';
|
|
3
3
|
/**
|
|
4
4
|
* This function reads migrationFolder and execute each unapplied migration and mark it as executed in database
|
|
5
5
|
*
|
package/neon-http/migrator.mjs
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { readMigrationFiles } from '../migrator.mjs';
|
|
2
|
-
import { s as sql } from '../alias-
|
|
2
|
+
import { s as sql } from '../alias-e80df77c.mjs';
|
|
3
|
+
import '@neondatabase/serverless';
|
|
4
|
+
import '@opentelemetry/api';
|
|
3
5
|
import 'node:crypto';
|
|
4
6
|
import 'node:fs';
|
|
5
7
|
import 'node:path';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrator.mjs","sources":["../../src/neon-http/migrator.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"migrator.mjs","sources":["../../src/neon-http/migrator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAKA;;;;;;;AAOG;AACI,eAAe,OAAO,CAC5B,EAA6B,EAC7B,MAAgC,EAAA;AAEhC,IAAA,MAAM,UAAU,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC9C,MAAM,oBAAoB,GAAG,GAAG,CAAA,CAAA;;;;;;EAM/B,CAAC;IACF,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAA,CAAuC,qCAAA,CAAA,CAAC,CAAC;IACrE,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAE/C,IAAA,MAAM,YAAY,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,CACxC,GAAG,CAAA,CAAA,kGAAA,CAAoG,CACvG,CAAC;AAEF,IAAA,MAAM,eAAe,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;IACxC,MAAM,YAAY,GAAU,EAAE,CAAC;AAC/B,IAAA,WAAW,MAAM,SAAS,IAAI,UAAU,EAAE;AACzC,QAAA,IACC,CAAC,eAAe;eACb,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC,YAAY,EAC7D;AACD,YAAA,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,GAAG,EAAE;AACjC,gBAAA,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,aAAA;AAED,YAAA,YAAY,CAAC,IAAI,CAChB,GAAG,CAAA,CAA8E,2EAAA,EAAA,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC,YAAY,CAAA,CAAA,CAAG,CAC7H,CAAC;AACF,SAAA;AACD,KAAA;AAED,IAAA,WAAW,MAAM,WAAW,IAAI,YAAY,EAAE;QAC7C,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;AACtC,KAAA;AACF;;;;"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type FullQueryResults, type QueryRows } from '@neondatabase/serverless';
|
|
2
|
+
import { entityKind } from '../entity.js';
|
|
3
|
+
import type { Logger } from '../logger.js';
|
|
4
|
+
import type { PgDialect } from '../pg-core/dialect.js';
|
|
5
|
+
import { PgTransaction } from '../pg-core/index.js';
|
|
6
|
+
import type { SelectedFieldsOrdered } from '../pg-core/query-builders/select.types.js';
|
|
7
|
+
import type { PgTransactionConfig, PreparedQueryConfig, QueryResultHKT } from '../pg-core/session.js';
|
|
8
|
+
import { PgSession, PreparedQuery } from '../pg-core/session.js';
|
|
9
|
+
import { type RelationalSchemaConfig, type TablesRelationalConfig } from '../relations.js';
|
|
10
|
+
import { type Query } from '../sql/index.js';
|
|
11
|
+
import { type Assume } from '../utils.js';
|
|
12
|
+
export type NeonHttpClient = {
|
|
13
|
+
<A extends boolean = false, F extends boolean = true>(strings: string, params?: any[], mode?: {
|
|
14
|
+
arrayMode?: A;
|
|
15
|
+
fullResults?: F;
|
|
16
|
+
}): Promise<F extends true ? FullQueryResults<A> : QueryRows<A>>;
|
|
17
|
+
};
|
|
18
|
+
export declare class NeonHttpPreparedQuery<T extends PreparedQueryConfig> extends PreparedQuery<T> {
|
|
19
|
+
private client;
|
|
20
|
+
private queryString;
|
|
21
|
+
private params;
|
|
22
|
+
private logger;
|
|
23
|
+
private fields;
|
|
24
|
+
private name;
|
|
25
|
+
private customResultMapper?;
|
|
26
|
+
static readonly [entityKind]: string;
|
|
27
|
+
private rawQuery;
|
|
28
|
+
private query;
|
|
29
|
+
constructor(client: NeonHttpClient, queryString: string, params: unknown[], logger: Logger, fields: SelectedFieldsOrdered | undefined, name: string | undefined, customResultMapper?: ((rows: unknown[][]) => T['execute']) | undefined);
|
|
30
|
+
execute(placeholderValues?: Record<string, unknown> | undefined): Promise<T['execute']>;
|
|
31
|
+
all(placeholderValues?: Record<string, unknown> | undefined): Promise<T['all']>;
|
|
32
|
+
values(placeholderValues?: Record<string, unknown> | undefined): Promise<T['values']>;
|
|
33
|
+
}
|
|
34
|
+
export interface NeonHttpSessionOptions {
|
|
35
|
+
logger?: Logger;
|
|
36
|
+
}
|
|
37
|
+
export declare class NeonHttpSession<TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> extends PgSession<NeonHttpQueryResultHKT, TFullSchema, TSchema> {
|
|
38
|
+
private client;
|
|
39
|
+
private schema;
|
|
40
|
+
private options;
|
|
41
|
+
static readonly [entityKind]: string;
|
|
42
|
+
private logger;
|
|
43
|
+
constructor(client: NeonHttpClient, dialect: PgDialect, schema: RelationalSchemaConfig<TSchema> | undefined, options?: NeonHttpSessionOptions);
|
|
44
|
+
prepareQuery<T extends PreparedQueryConfig = PreparedQueryConfig>(query: Query, fields: SelectedFieldsOrdered | undefined, name: string | undefined, customResultMapper?: (rows: unknown[][]) => T['execute']): PreparedQuery<T>;
|
|
45
|
+
query(query: string, params: unknown[]): Promise<FullQueryResults<true>>;
|
|
46
|
+
queryObjects(query: string, params: unknown[]): Promise<FullQueryResults<false>>;
|
|
47
|
+
transaction<T>(_transaction: (tx: NeonTransaction<TFullSchema, TSchema>) => Promise<T>, _config?: PgTransactionConfig): Promise<T>;
|
|
48
|
+
}
|
|
49
|
+
export declare class NeonTransaction<TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> extends PgTransaction<NeonHttpQueryResultHKT, TFullSchema, TSchema> {
|
|
50
|
+
static readonly [entityKind]: string;
|
|
51
|
+
transaction<T>(_transaction: (tx: NeonTransaction<TFullSchema, TSchema>) => Promise<T>): Promise<T>;
|
|
52
|
+
}
|
|
53
|
+
export interface NeonHttpQueryResultHKT extends QueryResultHKT {
|
|
54
|
+
type: FullQueryResults<Assume<this['row'], boolean>>;
|
|
55
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type FullQueryResults, type QueryRows } from '@neondatabase/serverless';
|
|
2
|
+
import { entityKind } from '../entity.js';
|
|
3
|
+
import type { Logger } from '../logger.js';
|
|
4
|
+
import type { PgDialect } from '../pg-core/dialect.js';
|
|
5
|
+
import { PgTransaction } from '../pg-core/index.js';
|
|
6
|
+
import type { SelectedFieldsOrdered } from '../pg-core/query-builders/select.types.js';
|
|
7
|
+
import type { PgTransactionConfig, PreparedQueryConfig, QueryResultHKT } from '../pg-core/session.js';
|
|
8
|
+
import { PgSession, PreparedQuery } from '../pg-core/session.js';
|
|
9
|
+
import { type RelationalSchemaConfig, type TablesRelationalConfig } from '../relations.js';
|
|
10
|
+
import { type Query } from '../sql/index.js';
|
|
11
|
+
import { type Assume } from '../utils.js';
|
|
12
|
+
export type NeonHttpClient = {
|
|
13
|
+
<A extends boolean = false, F extends boolean = true>(strings: string, params?: any[], mode?: {
|
|
14
|
+
arrayMode?: A;
|
|
15
|
+
fullResults?: F;
|
|
16
|
+
}): Promise<F extends true ? FullQueryResults<A> : QueryRows<A>>;
|
|
17
|
+
};
|
|
18
|
+
export declare class NeonHttpPreparedQuery<T extends PreparedQueryConfig> extends PreparedQuery<T> {
|
|
19
|
+
private client;
|
|
20
|
+
private queryString;
|
|
21
|
+
private params;
|
|
22
|
+
private logger;
|
|
23
|
+
private fields;
|
|
24
|
+
private name;
|
|
25
|
+
private customResultMapper?;
|
|
26
|
+
static readonly [entityKind]: string;
|
|
27
|
+
private rawQuery;
|
|
28
|
+
private query;
|
|
29
|
+
constructor(client: NeonHttpClient, queryString: string, params: unknown[], logger: Logger, fields: SelectedFieldsOrdered | undefined, name: string | undefined, customResultMapper?: ((rows: unknown[][]) => T['execute']) | undefined);
|
|
30
|
+
execute(placeholderValues?: Record<string, unknown> | undefined): Promise<T['execute']>;
|
|
31
|
+
all(placeholderValues?: Record<string, unknown> | undefined): Promise<T['all']>;
|
|
32
|
+
values(placeholderValues?: Record<string, unknown> | undefined): Promise<T['values']>;
|
|
33
|
+
}
|
|
34
|
+
export interface NeonHttpSessionOptions {
|
|
35
|
+
logger?: Logger;
|
|
36
|
+
}
|
|
37
|
+
export declare class NeonHttpSession<TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> extends PgSession<NeonHttpQueryResultHKT, TFullSchema, TSchema> {
|
|
38
|
+
private client;
|
|
39
|
+
private schema;
|
|
40
|
+
private options;
|
|
41
|
+
static readonly [entityKind]: string;
|
|
42
|
+
private logger;
|
|
43
|
+
constructor(client: NeonHttpClient, dialect: PgDialect, schema: RelationalSchemaConfig<TSchema> | undefined, options?: NeonHttpSessionOptions);
|
|
44
|
+
prepareQuery<T extends PreparedQueryConfig = PreparedQueryConfig>(query: Query, fields: SelectedFieldsOrdered | undefined, name: string | undefined, customResultMapper?: (rows: unknown[][]) => T['execute']): PreparedQuery<T>;
|
|
45
|
+
query(query: string, params: unknown[]): Promise<FullQueryResults<true>>;
|
|
46
|
+
queryObjects(query: string, params: unknown[]): Promise<FullQueryResults<false>>;
|
|
47
|
+
transaction<T>(_transaction: (tx: NeonTransaction<TFullSchema, TSchema>) => Promise<T>, _config?: PgTransactionConfig): Promise<T>;
|
|
48
|
+
}
|
|
49
|
+
export declare class NeonTransaction<TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> extends PgTransaction<NeonHttpQueryResultHKT, TFullSchema, TSchema> {
|
|
50
|
+
static readonly [entityKind]: string;
|
|
51
|
+
transaction<T>(_transaction: (tx: NeonTransaction<TFullSchema, TSchema>) => Promise<T>): Promise<T>;
|
|
52
|
+
}
|
|
53
|
+
export interface NeonHttpQueryResultHKT extends QueryResultHKT {
|
|
54
|
+
type: FullQueryResults<Assume<this['row'], boolean>>;
|
|
55
|
+
}
|
package/neon-http/session.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { type FullQueryResults, type QueryRows } from '@neondatabase/serverless';
|
|
2
|
-
import { entityKind } from '../entity';
|
|
3
|
-
import type { Logger } from '../logger';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import type { SelectedFieldsOrdered } from '../pg-core/query-builders/select.types';
|
|
7
|
-
import type { PgTransactionConfig, PreparedQueryConfig, QueryResultHKT } from '../pg-core/session';
|
|
8
|
-
import { PgSession, PreparedQuery } from '../pg-core/session';
|
|
9
|
-
import { type RelationalSchemaConfig, type TablesRelationalConfig } from '../relations';
|
|
10
|
-
import { type Query } from '../sql';
|
|
11
|
-
import { type Assume } from '../utils';
|
|
2
|
+
import { entityKind } from '../entity.js';
|
|
3
|
+
import type { Logger } from '../logger.js';
|
|
4
|
+
import type { PgDialect } from '../pg-core/dialect.js';
|
|
5
|
+
import { PgTransaction } from '../pg-core/index.js';
|
|
6
|
+
import type { SelectedFieldsOrdered } from '../pg-core/query-builders/select.types.js';
|
|
7
|
+
import type { PgTransactionConfig, PreparedQueryConfig, QueryResultHKT } from '../pg-core/session.js';
|
|
8
|
+
import { PgSession, PreparedQuery } from '../pg-core/session.js';
|
|
9
|
+
import { type RelationalSchemaConfig, type TablesRelationalConfig } from '../relations.js';
|
|
10
|
+
import { type Query } from '../sql/index.js';
|
|
11
|
+
import { type Assume } from '../utils.js';
|
|
12
12
|
export type NeonHttpClient = {
|
|
13
13
|
<A extends boolean = false, F extends boolean = true>(strings: string, params?: any[], mode?: {
|
|
14
14
|
arrayMode?: A;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { entityKind } from '../entity.js';
|
|
2
|
+
import type { Logger } from '../logger.js';
|
|
3
|
+
import { PgDatabase } from '../pg-core/db.js';
|
|
4
|
+
import { PgDialect } from '../pg-core/dialect.js';
|
|
5
|
+
import { type RelationalSchemaConfig, type TablesRelationalConfig } from '../relations.js';
|
|
6
|
+
import { type DrizzleConfig } from '../utils.js';
|
|
7
|
+
import type { NeonClient, NeonQueryResultHKT } from './session.js';
|
|
8
|
+
import { NeonSession } from './session.js';
|
|
9
|
+
export interface NeonDriverOptions {
|
|
10
|
+
logger?: Logger;
|
|
11
|
+
}
|
|
12
|
+
export declare class NeonDriver {
|
|
13
|
+
private client;
|
|
14
|
+
private dialect;
|
|
15
|
+
private options;
|
|
16
|
+
static readonly [entityKind]: string;
|
|
17
|
+
constructor(client: NeonClient, dialect: PgDialect, options?: NeonDriverOptions);
|
|
18
|
+
createSession(schema: RelationalSchemaConfig<TablesRelationalConfig> | undefined): NeonSession<Record<string, unknown>, TablesRelationalConfig>;
|
|
19
|
+
initMappers(): void;
|
|
20
|
+
}
|
|
21
|
+
export type NeonDatabase<TSchema extends Record<string, unknown> = Record<string, never>> = PgDatabase<NeonQueryResultHKT, TSchema>;
|
|
22
|
+
export declare function drizzle<TSchema extends Record<string, unknown> = Record<string, never>>(client: NeonClient, config?: DrizzleConfig<TSchema>): NeonDatabase<TSchema>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { entityKind } from '../entity.js';
|
|
2
|
+
import type { Logger } from '../logger.js';
|
|
3
|
+
import { PgDatabase } from '../pg-core/db.js';
|
|
4
|
+
import { PgDialect } from '../pg-core/dialect.js';
|
|
5
|
+
import { type RelationalSchemaConfig, type TablesRelationalConfig } from '../relations.js';
|
|
6
|
+
import { type DrizzleConfig } from '../utils.js';
|
|
7
|
+
import type { NeonClient, NeonQueryResultHKT } from './session.js';
|
|
8
|
+
import { NeonSession } from './session.js';
|
|
9
|
+
export interface NeonDriverOptions {
|
|
10
|
+
logger?: Logger;
|
|
11
|
+
}
|
|
12
|
+
export declare class NeonDriver {
|
|
13
|
+
private client;
|
|
14
|
+
private dialect;
|
|
15
|
+
private options;
|
|
16
|
+
static readonly [entityKind]: string;
|
|
17
|
+
constructor(client: NeonClient, dialect: PgDialect, options?: NeonDriverOptions);
|
|
18
|
+
createSession(schema: RelationalSchemaConfig<TablesRelationalConfig> | undefined): NeonSession<Record<string, unknown>, TablesRelationalConfig>;
|
|
19
|
+
initMappers(): void;
|
|
20
|
+
}
|
|
21
|
+
export type NeonDatabase<TSchema extends Record<string, unknown> = Record<string, never>> = PgDatabase<NeonQueryResultHKT, TSchema>;
|
|
22
|
+
export declare function drizzle<TSchema extends Record<string, unknown> = Record<string, never>>(client: NeonClient, config?: DrizzleConfig<TSchema>): NeonDatabase<TSchema>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { entityKind } from '../entity';
|
|
2
|
-
import type { Logger } from '../logger';
|
|
3
|
-
import { PgDatabase } from '../pg-core/db';
|
|
4
|
-
import { PgDialect } from '../pg-core/dialect';
|
|
5
|
-
import { type RelationalSchemaConfig, type TablesRelationalConfig } from '../relations';
|
|
6
|
-
import { type DrizzleConfig } from '../utils';
|
|
7
|
-
import type { NeonClient, NeonQueryResultHKT } from './session';
|
|
8
|
-
import { NeonSession } from './session';
|
|
1
|
+
import { entityKind } from '../entity.js';
|
|
2
|
+
import type { Logger } from '../logger.js';
|
|
3
|
+
import { PgDatabase } from '../pg-core/db.js';
|
|
4
|
+
import { PgDialect } from '../pg-core/dialect.js';
|
|
5
|
+
import { type RelationalSchemaConfig, type TablesRelationalConfig } from '../relations.js';
|
|
6
|
+
import { type DrizzleConfig } from '../utils.js';
|
|
7
|
+
import type { NeonClient, NeonQueryResultHKT } from './session.js';
|
|
8
|
+
import { NeonSession } from './session.js';
|
|
9
9
|
export interface NeonDriverOptions {
|
|
10
10
|
logger?: Logger;
|
|
11
11
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var serverless = require('@neondatabase/serverless');
|
|
4
|
-
var
|
|
5
|
-
|
|
4
|
+
var index = require('../index-b1dbb7ec.cjs');
|
|
5
|
+
require('@opentelemetry/api');
|
|
6
6
|
|
|
7
7
|
var _a$1, _b, _c;
|
|
8
|
-
class NeonPreparedQuery extends
|
|
8
|
+
class NeonPreparedQuery extends index.PreparedQuery {
|
|
9
9
|
constructor(client, queryString, params, logger, fields, name, customResultMapper) {
|
|
10
10
|
super();
|
|
11
11
|
this.client = client;
|
|
@@ -24,7 +24,7 @@ class NeonPreparedQuery extends alias.PreparedQuery {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
async execute(placeholderValues = {}) {
|
|
27
|
-
const params =
|
|
27
|
+
const params = index.fillPlaceholders(this.params, placeholderValues);
|
|
28
28
|
this.logger.logQuery(this.rawQuery.text, params);
|
|
29
29
|
const { fields, client, rawQuery, query, joinsNotNullableMap, customResultMapper } = this;
|
|
30
30
|
if (!fields && !customResultMapper) {
|
|
@@ -33,22 +33,22 @@ class NeonPreparedQuery extends alias.PreparedQuery {
|
|
|
33
33
|
const result = await client.query(query, params);
|
|
34
34
|
return customResultMapper
|
|
35
35
|
? customResultMapper(result.rows)
|
|
36
|
-
: result.rows.map((row) =>
|
|
36
|
+
: result.rows.map((row) => index.mapResultRow(fields, row, joinsNotNullableMap));
|
|
37
37
|
}
|
|
38
38
|
all(placeholderValues = {}) {
|
|
39
|
-
const params =
|
|
39
|
+
const params = index.fillPlaceholders(this.params, placeholderValues);
|
|
40
40
|
this.logger.logQuery(this.rawQuery.text, params);
|
|
41
41
|
return this.client.query(this.rawQuery, params).then((result) => result.rows);
|
|
42
42
|
}
|
|
43
43
|
values(placeholderValues = {}) {
|
|
44
|
-
const params =
|
|
44
|
+
const params = index.fillPlaceholders(this.params, placeholderValues);
|
|
45
45
|
this.logger.logQuery(this.rawQuery.text, params);
|
|
46
46
|
return this.client.query(this.query, params).then((result) => result.rows);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
_a$1 =
|
|
49
|
+
_a$1 = index.entityKind;
|
|
50
50
|
NeonPreparedQuery[_a$1] = 'NeonPreparedQuery';
|
|
51
|
-
class NeonSession extends
|
|
51
|
+
class NeonSession extends index.PgSession {
|
|
52
52
|
constructor(client, dialect, schema, options = {}) {
|
|
53
53
|
super(dialect);
|
|
54
54
|
this.client = client;
|
|
@@ -76,14 +76,14 @@ class NeonSession extends alias.PgSession {
|
|
|
76
76
|
? new NeonSession(await this.client.connect(), this.dialect, this.schema, this.options)
|
|
77
77
|
: this;
|
|
78
78
|
const tx = new NeonTransaction(this.dialect, session, this.schema);
|
|
79
|
-
await tx.execute(
|
|
79
|
+
await tx.execute(index.sql `begin ${tx.getTransactionConfigSQL(config)}`);
|
|
80
80
|
try {
|
|
81
81
|
const result = await transaction(tx);
|
|
82
|
-
await tx.execute(
|
|
82
|
+
await tx.execute(index.sql `commit`);
|
|
83
83
|
return result;
|
|
84
84
|
}
|
|
85
85
|
catch (error) {
|
|
86
|
-
await tx.execute(
|
|
86
|
+
await tx.execute(index.sql `rollback`);
|
|
87
87
|
throw error;
|
|
88
88
|
}
|
|
89
89
|
finally {
|
|
@@ -93,25 +93,25 @@ class NeonSession extends alias.PgSession {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
_b =
|
|
96
|
+
_b = index.entityKind;
|
|
97
97
|
NeonSession[_b] = 'NeonSession';
|
|
98
|
-
class NeonTransaction extends
|
|
98
|
+
class NeonTransaction extends index.PgTransaction {
|
|
99
99
|
async transaction(transaction) {
|
|
100
100
|
const savepointName = `sp${this.nestedIndex + 1}`;
|
|
101
101
|
const tx = new NeonTransaction(this.dialect, this.session, this.schema, this.nestedIndex + 1);
|
|
102
|
-
await tx.execute(
|
|
102
|
+
await tx.execute(index.sql.raw(`savepoint ${savepointName}`));
|
|
103
103
|
try {
|
|
104
104
|
const result = await transaction(tx);
|
|
105
|
-
await tx.execute(
|
|
105
|
+
await tx.execute(index.sql.raw(`release savepoint ${savepointName}`));
|
|
106
106
|
return result;
|
|
107
107
|
}
|
|
108
108
|
catch (e) {
|
|
109
|
-
await tx.execute(
|
|
109
|
+
await tx.execute(index.sql.raw(`rollback to savepoint ${savepointName}`));
|
|
110
110
|
throw e;
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
_c =
|
|
114
|
+
_c = index.entityKind;
|
|
115
115
|
NeonTransaction[_c] = 'NeonTransaction';
|
|
116
116
|
|
|
117
117
|
var _a;
|
|
@@ -131,10 +131,10 @@ class NeonDriver {
|
|
|
131
131
|
serverless.types.setTypeParser(serverless.types.builtins.DATE, (val) => val);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
_a =
|
|
134
|
+
_a = index.entityKind;
|
|
135
135
|
NeonDriver[_a] = 'NeonDriver';
|
|
136
136
|
function drizzle(client, config = {}) {
|
|
137
|
-
const dialect = new
|
|
137
|
+
const dialect = new index.PgDialect();
|
|
138
138
|
let logger;
|
|
139
139
|
if (config.logger === true) {
|
|
140
140
|
logger = new index.DefaultLogger();
|
|
@@ -144,7 +144,7 @@ function drizzle(client, config = {}) {
|
|
|
144
144
|
}
|
|
145
145
|
let schema;
|
|
146
146
|
if (config.schema) {
|
|
147
|
-
const tablesConfig =
|
|
147
|
+
const tablesConfig = index.extractTablesRelationalConfig(config.schema, index.createTableRelationsHelpers);
|
|
148
148
|
schema = {
|
|
149
149
|
fullSchema: config.schema,
|
|
150
150
|
schema: tablesConfig.tables,
|
|
@@ -153,7 +153,7 @@ function drizzle(client, config = {}) {
|
|
|
153
153
|
}
|
|
154
154
|
const driver = new NeonDriver(client, dialect, { logger });
|
|
155
155
|
const session = driver.createSession(schema);
|
|
156
|
-
return new
|
|
156
|
+
return new index.PgDatabase(dialect, session, schema);
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
exports.NeonDriver = NeonDriver;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './driver';
|
|
2
|
-
export * from './session';
|
|
1
|
+
export * from './driver.js';
|
|
2
|
+
export * from './session.js';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Pool, types } from '@neondatabase/serverless';
|
|
2
|
-
import { e as entityKind, f as fillPlaceholders, m as mapResultRow, s as sql, a as extractTablesRelationalConfig, c as createTableRelationsHelpers, P as PgDialect } from '../alias-
|
|
2
|
+
import { e as entityKind, f as fillPlaceholders, m as mapResultRow, s as sql, a as extractTablesRelationalConfig, c as createTableRelationsHelpers, P as PgDialect } from '../alias-e80df77c.mjs';
|
|
3
3
|
import { NoopLogger, DefaultLogger } from '../index.mjs';
|
|
4
|
-
import { P as PreparedQuery, a as PgSession, b as PgTransaction, c as PgDatabase } from '../session-
|
|
4
|
+
import { P as PreparedQuery, a as PgSession, b as PgTransaction, c as PgDatabase } from '../session-a706e83f.mjs';
|
|
5
|
+
import '@opentelemetry/api';
|
|
5
6
|
|
|
6
7
|
class NeonPreparedQuery extends PreparedQuery {
|
|
7
8
|
client;
|