drizzle-orm 1.0.0-beta.21 → 1.0.0-beta.21-4fa69ab
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/_relations.cjs.map +1 -1
- package/_relations.d.cts +2 -13
- package/_relations.d.ts +2 -13
- package/_relations.js.map +1 -1
- package/aws-data-api/common/index.cjs +2 -0
- package/aws-data-api/common/index.cjs.map +1 -1
- package/aws-data-api/common/index.js +2 -0
- package/aws-data-api/common/index.js.map +1 -1
- package/aws-data-api/pg/driver.cjs +93 -20
- package/aws-data-api/pg/driver.cjs.map +1 -1
- package/aws-data-api/pg/driver.d.cts +17 -13
- package/aws-data-api/pg/driver.d.ts +16 -12
- package/aws-data-api/pg/driver.js +93 -20
- package/aws-data-api/pg/driver.js.map +1 -1
- package/aws-data-api/pg/index.cjs +1 -1
- package/aws-data-api/pg/index.d.cts +3 -3
- package/aws-data-api/pg/index.d.ts +3 -3
- package/aws-data-api/pg/index.js +3 -3
- package/aws-data-api/pg/migrator.cjs.map +1 -1
- package/aws-data-api/pg/migrator.d.cts +1 -1
- package/aws-data-api/pg/migrator.d.ts +1 -1
- package/aws-data-api/pg/migrator.js.map +1 -1
- package/aws-data-api/pg/session.cjs +44 -113
- package/aws-data-api/pg/session.cjs.map +1 -1
- package/aws-data-api/pg/session.d.cts +12 -42
- package/aws-data-api/pg/session.d.ts +12 -42
- package/aws-data-api/pg/session.js +46 -114
- package/aws-data-api/pg/session.js.map +1 -1
- package/better-sqlite3/driver.cjs +5 -2
- package/better-sqlite3/driver.cjs.map +1 -1
- package/better-sqlite3/driver.d.ts +1 -1
- package/better-sqlite3/driver.js +5 -2
- package/better-sqlite3/driver.js.map +1 -1
- package/better-sqlite3/session.cjs +15 -14
- package/better-sqlite3/session.cjs.map +1 -1
- package/better-sqlite3/session.d.cts +10 -6
- package/better-sqlite3/session.d.ts +10 -6
- package/better-sqlite3/session.js +16 -15
- package/better-sqlite3/session.js.map +1 -1
- package/bun-sql/driver.cjs.map +1 -1
- package/bun-sql/driver.d.cts +7 -6
- package/bun-sql/driver.d.ts +7 -6
- package/bun-sql/driver.js.map +1 -1
- package/bun-sql/index.cjs +0 -1
- package/bun-sql/index.d.cts +2 -2
- package/bun-sql/index.d.ts +2 -2
- package/bun-sql/index.js +2 -2
- 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/mysql/driver.cjs +4 -3
- package/bun-sql/mysql/driver.cjs.map +1 -1
- package/bun-sql/mysql/driver.js +3 -2
- package/bun-sql/mysql/driver.js.map +1 -1
- package/bun-sql/mysql/session.cjs +36 -23
- package/bun-sql/mysql/session.cjs.map +1 -1
- package/bun-sql/mysql/session.d.cts +10 -4
- package/bun-sql/mysql/session.d.ts +11 -5
- package/bun-sql/mysql/session.js +37 -24
- package/bun-sql/mysql/session.js.map +1 -1
- package/bun-sql/postgres/driver.cjs +143 -19
- package/bun-sql/postgres/driver.cjs.map +1 -1
- package/bun-sql/postgres/driver.d.cts +10 -6
- package/bun-sql/postgres/driver.d.ts +10 -6
- package/bun-sql/postgres/driver.js +143 -19
- package/bun-sql/postgres/driver.js.map +1 -1
- package/bun-sql/postgres/index.cjs +1 -1
- package/bun-sql/postgres/index.d.cts +3 -3
- package/bun-sql/postgres/index.d.ts +3 -3
- package/bun-sql/postgres/index.js +3 -3
- package/bun-sql/postgres/migrator.cjs.map +1 -1
- package/bun-sql/postgres/migrator.d.cts +1 -1
- package/bun-sql/postgres/migrator.d.ts +1 -1
- package/bun-sql/postgres/migrator.js.map +1 -1
- package/bun-sql/postgres/session.cjs +16 -111
- package/bun-sql/postgres/session.cjs.map +1 -1
- package/bun-sql/postgres/session.d.cts +11 -33
- package/bun-sql/postgres/session.d.ts +10 -32
- package/bun-sql/postgres/session.js +17 -111
- package/bun-sql/postgres/session.js.map +1 -1
- package/bun-sql/session.cjs +0 -1
- package/bun-sql/session.d.cts +2 -2
- package/bun-sql/session.d.ts +2 -2
- package/bun-sql/session.js +2 -2
- package/bun-sql/sqlite/driver.cjs +4 -3
- package/bun-sql/sqlite/driver.cjs.map +1 -1
- package/bun-sql/sqlite/driver.d.ts +1 -1
- package/bun-sql/sqlite/driver.js +3 -2
- package/bun-sql/sqlite/driver.js.map +1 -1
- package/bun-sql/sqlite/session.cjs +17 -16
- package/bun-sql/sqlite/session.cjs.map +1 -1
- package/bun-sql/sqlite/session.d.cts +9 -6
- package/bun-sql/sqlite/session.d.ts +9 -6
- package/bun-sql/sqlite/session.js +18 -17
- package/bun-sql/sqlite/session.js.map +1 -1
- package/bun-sqlite/driver.cjs +5 -2
- package/bun-sqlite/driver.cjs.map +1 -1
- package/bun-sqlite/driver.d.ts +1 -1
- package/bun-sqlite/driver.js +5 -2
- package/bun-sqlite/driver.js.map +1 -1
- package/bun-sqlite/session.cjs +15 -14
- package/bun-sqlite/session.cjs.map +1 -1
- package/bun-sqlite/session.d.cts +10 -6
- package/bun-sqlite/session.d.ts +10 -6
- package/bun-sqlite/session.js +16 -15
- package/bun-sqlite/session.js.map +1 -1
- package/cache/core/cache-effect.d.cts +1 -1
- package/cache/core/cache-effect.d.ts +1 -1
- package/cache/upstash/cache.d.cts +1 -1
- package/cache/upstash/cache.d.ts +1 -1
- package/cockroach/driver.cjs +9 -3
- package/cockroach/driver.cjs.map +1 -1
- package/cockroach/driver.d.cts +1 -0
- package/cockroach/driver.d.ts +2 -1
- package/cockroach/driver.js +9 -3
- package/cockroach/driver.js.map +1 -1
- package/cockroach/session.cjs +7 -9
- package/cockroach/session.cjs.map +1 -1
- package/cockroach/session.d.cts +5 -3
- package/cockroach/session.d.ts +6 -4
- package/cockroach/session.js +8 -10
- package/cockroach/session.js.map +1 -1
- package/cockroach-core/columns/bigint.cjs +4 -4
- package/cockroach-core/columns/bigint.cjs.map +1 -1
- package/cockroach-core/columns/bigint.d.cts +2 -2
- package/cockroach-core/columns/bigint.d.ts +2 -2
- package/cockroach-core/columns/bigint.js +4 -4
- package/cockroach-core/columns/bigint.js.map +1 -1
- package/cockroach-core/columns/common.cjs +4 -4
- package/cockroach-core/columns/common.cjs.map +1 -1
- package/cockroach-core/columns/common.d.cts +2 -2
- package/cockroach-core/columns/common.d.ts +2 -2
- package/cockroach-core/columns/common.js +4 -4
- package/cockroach-core/columns/common.js.map +1 -1
- package/cockroach-core/columns/custom.cjs +4 -4
- package/cockroach-core/columns/custom.cjs.map +1 -1
- package/cockroach-core/columns/custom.d.cts +2 -2
- package/cockroach-core/columns/custom.d.ts +2 -2
- package/cockroach-core/columns/custom.js +4 -4
- package/cockroach-core/columns/custom.js.map +1 -1
- package/cockroach-core/columns/date.cjs +6 -6
- package/cockroach-core/columns/date.cjs.map +1 -1
- package/cockroach-core/columns/date.d.cts +3 -3
- package/cockroach-core/columns/date.d.ts +3 -3
- package/cockroach-core/columns/date.js +6 -6
- package/cockroach-core/columns/date.js.map +1 -1
- package/cockroach-core/columns/decimal.cjs +4 -4
- package/cockroach-core/columns/decimal.cjs.map +1 -1
- package/cockroach-core/columns/decimal.d.cts +2 -2
- package/cockroach-core/columns/decimal.d.ts +2 -2
- package/cockroach-core/columns/decimal.js +4 -4
- package/cockroach-core/columns/decimal.js.map +1 -1
- package/cockroach-core/columns/float.cjs +2 -2
- package/cockroach-core/columns/float.cjs.map +1 -1
- package/cockroach-core/columns/float.d.cts +1 -1
- package/cockroach-core/columns/float.d.ts +1 -1
- package/cockroach-core/columns/float.js +2 -2
- package/cockroach-core/columns/float.js.map +1 -1
- package/cockroach-core/columns/geometry.cjs +8 -8
- package/cockroach-core/columns/geometry.cjs.map +1 -1
- package/cockroach-core/columns/geometry.d.cts +5 -5
- package/cockroach-core/columns/geometry.d.ts +5 -5
- package/cockroach-core/columns/geometry.js +8 -8
- package/cockroach-core/columns/geometry.js.map +1 -1
- package/cockroach-core/columns/integer.cjs +2 -2
- package/cockroach-core/columns/integer.cjs.map +1 -1
- package/cockroach-core/columns/integer.d.cts +1 -1
- package/cockroach-core/columns/integer.d.ts +1 -1
- package/cockroach-core/columns/integer.js +2 -2
- package/cockroach-core/columns/integer.js.map +1 -1
- package/cockroach-core/columns/jsonb.cjs +4 -4
- package/cockroach-core/columns/jsonb.cjs.map +1 -1
- package/cockroach-core/columns/jsonb.d.cts +2 -2
- package/cockroach-core/columns/jsonb.d.ts +2 -2
- package/cockroach-core/columns/jsonb.js +4 -4
- package/cockroach-core/columns/jsonb.js.map +1 -1
- package/cockroach-core/columns/vector.cjs +4 -4
- package/cockroach-core/columns/vector.cjs.map +1 -1
- package/cockroach-core/columns/vector.d.cts +2 -2
- package/cockroach-core/columns/vector.d.ts +2 -2
- package/cockroach-core/columns/vector.js +4 -4
- package/cockroach-core/columns/vector.js.map +1 -1
- package/cockroach-core/db.cjs +1 -1
- package/cockroach-core/db.cjs.map +1 -1
- package/cockroach-core/db.js +1 -1
- package/cockroach-core/db.js.map +1 -1
- package/cockroach-core/dialect.cjs +1 -1
- package/cockroach-core/dialect.d.ts +1 -1
- package/cockroach-core/dialect.js +1 -1
- package/cockroach-core/query-builders/delete.cjs +6 -2
- package/cockroach-core/query-builders/delete.cjs.map +1 -1
- package/cockroach-core/query-builders/delete.d.cts +1 -1
- package/cockroach-core/query-builders/delete.d.ts +1 -1
- package/cockroach-core/query-builders/delete.js +6 -2
- package/cockroach-core/query-builders/delete.js.map +1 -1
- package/cockroach-core/query-builders/insert.cjs +6 -2
- package/cockroach-core/query-builders/insert.cjs.map +1 -1
- package/cockroach-core/query-builders/insert.js +6 -2
- package/cockroach-core/query-builders/insert.js.map +1 -1
- package/cockroach-core/query-builders/query.cjs +2 -2
- package/cockroach-core/query-builders/query.cjs.map +1 -1
- package/cockroach-core/query-builders/query.js +2 -2
- package/cockroach-core/query-builders/query.js.map +1 -1
- package/cockroach-core/query-builders/raw.cjs +0 -4
- package/cockroach-core/query-builders/raw.cjs.map +1 -1
- package/cockroach-core/query-builders/raw.js +0 -4
- package/cockroach-core/query-builders/raw.js.map +1 -1
- package/cockroach-core/query-builders/refresh-materialized-view.cjs +2 -2
- package/cockroach-core/query-builders/refresh-materialized-view.cjs.map +1 -1
- package/cockroach-core/query-builders/refresh-materialized-view.js +2 -2
- package/cockroach-core/query-builders/refresh-materialized-view.js.map +1 -1
- package/cockroach-core/query-builders/select.cjs +6 -2
- package/cockroach-core/query-builders/select.cjs.map +1 -1
- package/cockroach-core/query-builders/select.js +6 -2
- package/cockroach-core/query-builders/select.js.map +1 -1
- package/cockroach-core/query-builders/update.cjs +6 -2
- package/cockroach-core/query-builders/update.cjs.map +1 -1
- package/cockroach-core/query-builders/update.js +6 -2
- package/cockroach-core/query-builders/update.js.map +1 -1
- package/cockroach-core/session.cjs +2 -2
- package/cockroach-core/session.cjs.map +1 -1
- package/cockroach-core/session.d.cts +1 -1
- package/cockroach-core/session.d.ts +1 -1
- package/cockroach-core/session.js +2 -2
- package/cockroach-core/session.js.map +1 -1
- package/cockroach-core/table.cjs +1 -1
- package/cockroach-core/table.cjs.map +1 -1
- package/cockroach-core/table.js +1 -1
- package/cockroach-core/table.js.map +1 -1
- package/codecs.cjs +77 -0
- package/codecs.cjs.map +1 -0
- package/codecs.d.cts +68 -0
- package/codecs.d.ts +68 -0
- package/codecs.js +74 -0
- package/codecs.js.map +1 -0
- package/column.cjs +10 -5
- package/column.cjs.map +1 -1
- package/column.d.cts +3 -3
- package/column.d.ts +3 -3
- package/column.js +10 -5
- package/column.js.map +1 -1
- package/d1/driver.cjs +3 -2
- package/d1/driver.cjs.map +1 -1
- package/d1/driver.d.ts +1 -1
- package/d1/driver.js +3 -2
- package/d1/driver.js.map +1 -1
- package/d1/session.cjs +16 -14
- package/d1/session.cjs.map +1 -1
- package/d1/session.d.cts +9 -6
- package/d1/session.d.ts +9 -6
- package/d1/session.js +17 -15
- package/d1/session.js.map +1 -1
- package/durable-sqlite/driver.cjs +5 -2
- package/durable-sqlite/driver.cjs.map +1 -1
- package/durable-sqlite/driver.d.ts +1 -1
- package/durable-sqlite/driver.js +5 -2
- package/durable-sqlite/driver.js.map +1 -1
- package/durable-sqlite/session.cjs +15 -14
- package/durable-sqlite/session.cjs.map +1 -1
- package/durable-sqlite/session.d.cts +10 -6
- package/durable-sqlite/session.d.ts +10 -6
- package/durable-sqlite/session.js +16 -15
- package/durable-sqlite/session.js.map +1 -1
- package/effect-postgres/driver.cjs +99 -13
- package/effect-postgres/driver.cjs.map +1 -1
- package/effect-postgres/driver.d.cts +12 -8
- package/effect-postgres/driver.d.ts +12 -8
- package/effect-postgres/driver.js +99 -13
- package/effect-postgres/driver.js.map +1 -1
- package/effect-postgres/index.cjs +1 -1
- package/effect-postgres/index.d.cts +3 -3
- package/effect-postgres/index.d.ts +3 -3
- package/effect-postgres/index.js +3 -3
- package/effect-postgres/migrator.cjs.map +1 -1
- package/effect-postgres/migrator.d.cts +1 -1
- package/effect-postgres/migrator.d.ts +1 -1
- package/effect-postgres/migrator.js.map +1 -1
- package/effect-postgres/session.cjs +12 -71
- package/effect-postgres/session.cjs.map +1 -1
- package/effect-postgres/session.d.cts +14 -31
- package/effect-postgres/session.d.ts +16 -33
- package/effect-postgres/session.js +13 -71
- package/effect-postgres/session.js.map +1 -1
- package/expo-sqlite/driver.cjs +5 -2
- package/expo-sqlite/driver.cjs.map +1 -1
- package/expo-sqlite/driver.d.ts +1 -1
- package/expo-sqlite/driver.js +5 -2
- package/expo-sqlite/driver.js.map +1 -1
- package/expo-sqlite/session.cjs +15 -14
- package/expo-sqlite/session.cjs.map +1 -1
- package/expo-sqlite/session.d.cts +10 -6
- package/expo-sqlite/session.d.ts +10 -6
- package/expo-sqlite/session.js +16 -15
- package/expo-sqlite/session.js.map +1 -1
- package/gel/driver.cjs +4 -2
- package/gel/driver.cjs.map +1 -1
- package/gel/driver.d.cts +1 -0
- package/gel/driver.d.ts +2 -1
- package/gel/driver.js +4 -2
- package/gel/driver.js.map +1 -1
- package/gel/session.cjs +12 -12
- package/gel/session.cjs.map +1 -1
- package/gel/session.d.cts +8 -5
- package/gel/session.d.ts +9 -6
- package/gel/session.js +13 -13
- package/gel/session.js.map +1 -1
- package/gel-core/columns/bigintT.cjs +2 -2
- package/gel-core/columns/bigintT.cjs.map +1 -1
- package/gel-core/columns/bigintT.d.cts +1 -1
- package/gel-core/columns/bigintT.d.ts +1 -1
- package/gel-core/columns/bigintT.js +2 -2
- package/gel-core/columns/bigintT.js.map +1 -1
- package/gel-core/columns/common.cjs +2 -2
- package/gel-core/columns/common.cjs.map +1 -1
- package/gel-core/columns/common.d.cts +1 -1
- package/gel-core/columns/common.d.ts +1 -1
- package/gel-core/columns/common.js +2 -2
- package/gel-core/columns/common.js.map +1 -1
- package/gel-core/columns/custom.cjs +4 -4
- package/gel-core/columns/custom.cjs.map +1 -1
- package/gel-core/columns/custom.d.cts +2 -2
- package/gel-core/columns/custom.d.ts +2 -2
- package/gel-core/columns/custom.js +4 -4
- package/gel-core/columns/custom.js.map +1 -1
- package/gel-core/columns/double-precision.cjs +2 -2
- package/gel-core/columns/double-precision.cjs.map +1 -1
- package/gel-core/columns/double-precision.d.cts +1 -1
- package/gel-core/columns/double-precision.d.ts +1 -1
- package/gel-core/columns/double-precision.js +2 -2
- package/gel-core/columns/double-precision.js.map +1 -1
- package/gel-core/columns/timestamptz.cjs +2 -2
- package/gel-core/columns/timestamptz.cjs.map +1 -1
- package/gel-core/columns/timestamptz.d.cts +1 -1
- package/gel-core/columns/timestamptz.d.ts +1 -1
- package/gel-core/columns/timestamptz.js +2 -2
- package/gel-core/columns/timestamptz.js.map +1 -1
- package/gel-core/db.cjs +1 -1
- package/gel-core/db.cjs.map +1 -1
- package/gel-core/db.d.ts +1 -1
- package/gel-core/db.js +1 -1
- package/gel-core/db.js.map +1 -1
- package/gel-core/query-builders/_query.cjs +2 -2
- package/gel-core/query-builders/_query.cjs.map +1 -1
- package/gel-core/query-builders/_query.js +2 -2
- package/gel-core/query-builders/_query.js.map +1 -1
- package/gel-core/query-builders/delete.cjs +2 -2
- package/gel-core/query-builders/delete.cjs.map +1 -1
- package/gel-core/query-builders/delete.js +2 -2
- package/gel-core/query-builders/delete.js.map +1 -1
- package/gel-core/query-builders/insert.cjs +2 -2
- package/gel-core/query-builders/insert.cjs.map +1 -1
- 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 +13 -5
- package/gel-core/query-builders/query.cjs.map +1 -1
- package/gel-core/query-builders/query.d.ts +1 -1
- package/gel-core/query-builders/query.js +14 -6
- package/gel-core/query-builders/query.js.map +1 -1
- package/gel-core/query-builders/raw.cjs +0 -4
- package/gel-core/query-builders/raw.cjs.map +1 -1
- package/gel-core/query-builders/raw.js +0 -4
- package/gel-core/query-builders/raw.js.map +1 -1
- package/gel-core/query-builders/refresh-materialized-view.cjs +2 -2
- package/gel-core/query-builders/refresh-materialized-view.cjs.map +1 -1
- package/gel-core/query-builders/refresh-materialized-view.js +2 -2
- package/gel-core/query-builders/refresh-materialized-view.js.map +1 -1
- package/gel-core/query-builders/select.cjs +6 -2
- package/gel-core/query-builders/select.cjs.map +1 -1
- package/gel-core/query-builders/select.js +6 -2
- package/gel-core/query-builders/select.js.map +1 -1
- package/gel-core/query-builders/update.cjs +2 -2
- package/gel-core/query-builders/update.cjs.map +1 -1
- package/gel-core/query-builders/update.js +2 -2
- package/gel-core/query-builders/update.js.map +1 -1
- package/gel-core/session.cjs +2 -2
- package/gel-core/session.cjs.map +1 -1
- package/gel-core/session.d.cts +3 -3
- package/gel-core/session.d.ts +3 -3
- package/gel-core/session.js +2 -2
- package/gel-core/session.js.map +1 -1
- package/gel-core/table.cjs +1 -1
- package/gel-core/table.cjs.map +1 -1
- package/gel-core/table.js +1 -1
- package/gel-core/table.js.map +1 -1
- package/index.cjs +6 -0
- package/index.d.cts +6 -6
- package/index.d.ts +6 -6
- package/index.js +4 -4
- package/libsql/driver-core.cjs +3 -2
- package/libsql/driver-core.cjs.map +1 -1
- package/libsql/driver-core.d.ts +1 -1
- package/libsql/driver-core.js +3 -2
- package/libsql/driver-core.js.map +1 -1
- package/libsql/session.cjs +13 -14
- package/libsql/session.cjs.map +1 -1
- package/libsql/session.d.cts +9 -6
- package/libsql/session.d.ts +9 -6
- package/libsql/session.js +14 -15
- package/libsql/session.js.map +1 -1
- package/mssql-core/columns/bigint.cjs +2 -2
- package/mssql-core/columns/bigint.cjs.map +1 -1
- package/mssql-core/columns/bigint.d.cts +1 -1
- package/mssql-core/columns/bigint.d.ts +1 -1
- package/mssql-core/columns/bigint.js +2 -2
- package/mssql-core/columns/bigint.js.map +1 -1
- package/mssql-core/columns/custom.cjs +4 -4
- package/mssql-core/columns/custom.cjs.map +1 -1
- package/mssql-core/columns/custom.d.cts +2 -2
- package/mssql-core/columns/custom.d.ts +2 -2
- package/mssql-core/columns/custom.js +4 -4
- package/mssql-core/columns/custom.js.map +1 -1
- package/mssql-core/columns/date.cjs +4 -4
- package/mssql-core/columns/date.cjs.map +1 -1
- package/mssql-core/columns/date.d.cts +2 -2
- package/mssql-core/columns/date.d.ts +2 -2
- package/mssql-core/columns/date.js +4 -4
- package/mssql-core/columns/date.js.map +1 -1
- package/mssql-core/columns/datetime.cjs +2 -2
- package/mssql-core/columns/datetime.cjs.map +1 -1
- package/mssql-core/columns/datetime.d.cts +1 -1
- package/mssql-core/columns/datetime.d.ts +1 -1
- package/mssql-core/columns/datetime.js +2 -2
- package/mssql-core/columns/datetime.js.map +1 -1
- package/mssql-core/columns/datetime2.cjs +2 -2
- package/mssql-core/columns/datetime2.cjs.map +1 -1
- package/mssql-core/columns/datetime2.d.cts +1 -1
- package/mssql-core/columns/datetime2.d.ts +1 -1
- package/mssql-core/columns/datetime2.js +2 -2
- package/mssql-core/columns/datetime2.js.map +1 -1
- package/mssql-core/columns/datetimeoffset.cjs +2 -2
- package/mssql-core/columns/datetimeoffset.cjs.map +1 -1
- package/mssql-core/columns/datetimeoffset.d.cts +1 -1
- package/mssql-core/columns/datetimeoffset.d.ts +1 -1
- package/mssql-core/columns/datetimeoffset.js +2 -2
- package/mssql-core/columns/datetimeoffset.js.map +1 -1
- package/mssql-core/columns/decimal.cjs +4 -4
- package/mssql-core/columns/decimal.cjs.map +1 -1
- package/mssql-core/columns/decimal.d.cts +2 -2
- package/mssql-core/columns/decimal.d.ts +2 -2
- package/mssql-core/columns/decimal.js +4 -4
- package/mssql-core/columns/decimal.js.map +1 -1
- package/mssql-core/columns/numeric.cjs +4 -4
- package/mssql-core/columns/numeric.cjs.map +1 -1
- package/mssql-core/columns/numeric.d.cts +2 -2
- package/mssql-core/columns/numeric.d.ts +2 -2
- package/mssql-core/columns/numeric.js +4 -4
- package/mssql-core/columns/numeric.js.map +1 -1
- package/mssql-core/columns/smallint.cjs +2 -2
- package/mssql-core/columns/smallint.cjs.map +1 -1
- package/mssql-core/columns/smallint.d.cts +1 -1
- package/mssql-core/columns/smallint.d.ts +1 -1
- package/mssql-core/columns/smallint.js +2 -2
- package/mssql-core/columns/smallint.js.map +1 -1
- package/mssql-core/columns/time.cjs +2 -2
- package/mssql-core/columns/time.cjs.map +1 -1
- package/mssql-core/columns/time.d.cts +1 -1
- package/mssql-core/columns/time.d.ts +1 -1
- package/mssql-core/columns/time.js +2 -2
- package/mssql-core/columns/time.js.map +1 -1
- package/mssql-core/columns/tinyint.cjs +2 -2
- package/mssql-core/columns/tinyint.cjs.map +1 -1
- package/mssql-core/columns/tinyint.d.cts +1 -1
- package/mssql-core/columns/tinyint.d.ts +1 -1
- package/mssql-core/columns/tinyint.js +2 -2
- package/mssql-core/columns/tinyint.js.map +1 -1
- package/mssql-core/columns/varchar.cjs +4 -4
- package/mssql-core/columns/varchar.cjs.map +1 -1
- package/mssql-core/columns/varchar.d.cts +2 -2
- package/mssql-core/columns/varchar.d.ts +2 -2
- package/mssql-core/columns/varchar.js +4 -4
- package/mssql-core/columns/varchar.js.map +1 -1
- package/mssql-core/dialect.cjs +1 -1
- package/mssql-core/dialect.d.ts +1 -1
- package/mssql-core/dialect.js +1 -1
- package/mssql-core/query-builders/select.cjs +4 -0
- package/mssql-core/query-builders/select.cjs.map +1 -1
- package/mssql-core/query-builders/select.js +4 -0
- package/mssql-core/query-builders/select.js.map +1 -1
- package/mssql-core/query-builders/update.d.ts +1 -1
- package/mssql-core/table.cjs +1 -1
- package/mssql-core/table.cjs.map +1 -1
- package/mssql-core/table.js +1 -1
- package/mssql-core/table.js.map +1 -1
- package/mysql-core/columns/bigint.cjs +8 -8
- package/mysql-core/columns/bigint.cjs.map +1 -1
- package/mysql-core/columns/bigint.d.cts +4 -4
- package/mysql-core/columns/bigint.d.ts +4 -4
- package/mysql-core/columns/bigint.js +8 -8
- package/mysql-core/columns/bigint.js.map +1 -1
- package/mysql-core/columns/binary.cjs +2 -2
- package/mysql-core/columns/binary.cjs.map +1 -1
- package/mysql-core/columns/binary.d.cts +1 -1
- package/mysql-core/columns/binary.d.ts +1 -1
- package/mysql-core/columns/binary.js +2 -2
- package/mysql-core/columns/binary.js.map +1 -1
- package/mysql-core/columns/blob.cjs +4 -4
- package/mysql-core/columns/blob.cjs.map +1 -1
- package/mysql-core/columns/blob.d.cts +2 -2
- package/mysql-core/columns/blob.d.ts +2 -2
- package/mysql-core/columns/blob.js +4 -4
- package/mysql-core/columns/blob.js.map +1 -1
- package/mysql-core/columns/boolean.cjs +2 -2
- package/mysql-core/columns/boolean.cjs.map +1 -1
- package/mysql-core/columns/boolean.d.cts +1 -1
- package/mysql-core/columns/boolean.d.ts +1 -1
- package/mysql-core/columns/boolean.js +2 -2
- package/mysql-core/columns/boolean.js.map +1 -1
- package/mysql-core/columns/custom.cjs +4 -4
- package/mysql-core/columns/custom.cjs.map +1 -1
- package/mysql-core/columns/custom.d.cts +2 -2
- package/mysql-core/columns/custom.d.ts +2 -2
- package/mysql-core/columns/custom.js +4 -4
- package/mysql-core/columns/custom.js.map +1 -1
- package/mysql-core/columns/date.cjs +4 -4
- package/mysql-core/columns/date.cjs.map +1 -1
- package/mysql-core/columns/date.d.cts +2 -2
- package/mysql-core/columns/date.d.ts +2 -2
- package/mysql-core/columns/date.js +4 -4
- package/mysql-core/columns/date.js.map +1 -1
- package/mysql-core/columns/datetime.cjs +8 -8
- package/mysql-core/columns/datetime.cjs.map +1 -1
- package/mysql-core/columns/datetime.d.cts +4 -4
- package/mysql-core/columns/datetime.d.ts +4 -4
- package/mysql-core/columns/datetime.js +8 -8
- package/mysql-core/columns/datetime.js.map +1 -1
- package/mysql-core/columns/decimal.cjs +4 -4
- package/mysql-core/columns/decimal.cjs.map +1 -1
- package/mysql-core/columns/decimal.d.cts +2 -2
- package/mysql-core/columns/decimal.d.ts +2 -2
- package/mysql-core/columns/decimal.js +4 -4
- package/mysql-core/columns/decimal.js.map +1 -1
- package/mysql-core/columns/float.cjs +2 -2
- package/mysql-core/columns/float.cjs.map +1 -1
- package/mysql-core/columns/float.d.cts +1 -1
- package/mysql-core/columns/float.d.ts +1 -1
- package/mysql-core/columns/float.js +2 -2
- package/mysql-core/columns/float.js.map +1 -1
- package/mysql-core/columns/int.cjs +2 -2
- package/mysql-core/columns/int.cjs.map +1 -1
- package/mysql-core/columns/int.d.cts +1 -1
- package/mysql-core/columns/int.d.ts +1 -1
- package/mysql-core/columns/int.js +2 -2
- package/mysql-core/columns/int.js.map +1 -1
- package/mysql-core/columns/json.cjs +2 -2
- package/mysql-core/columns/json.cjs.map +1 -1
- package/mysql-core/columns/json.d.cts +1 -1
- package/mysql-core/columns/json.d.ts +1 -1
- package/mysql-core/columns/json.js +2 -2
- package/mysql-core/columns/json.js.map +1 -1
- package/mysql-core/columns/mediumint.cjs +2 -2
- package/mysql-core/columns/mediumint.cjs.map +1 -1
- package/mysql-core/columns/mediumint.d.cts +1 -1
- package/mysql-core/columns/mediumint.d.ts +1 -1
- package/mysql-core/columns/mediumint.js +2 -2
- package/mysql-core/columns/mediumint.js.map +1 -1
- package/mysql-core/columns/serial.cjs +2 -2
- package/mysql-core/columns/serial.cjs.map +1 -1
- package/mysql-core/columns/serial.d.cts +1 -1
- package/mysql-core/columns/serial.d.ts +1 -1
- package/mysql-core/columns/serial.js +2 -2
- package/mysql-core/columns/serial.js.map +1 -1
- package/mysql-core/columns/smallint.cjs +2 -2
- package/mysql-core/columns/smallint.cjs.map +1 -1
- package/mysql-core/columns/smallint.d.cts +1 -1
- package/mysql-core/columns/smallint.d.ts +1 -1
- package/mysql-core/columns/smallint.js +2 -2
- package/mysql-core/columns/smallint.js.map +1 -1
- package/mysql-core/columns/time.cjs +2 -2
- package/mysql-core/columns/time.cjs.map +1 -1
- package/mysql-core/columns/time.d.cts +1 -1
- package/mysql-core/columns/time.d.ts +1 -1
- package/mysql-core/columns/time.js +2 -2
- package/mysql-core/columns/time.js.map +1 -1
- package/mysql-core/columns/timestamp.cjs +8 -8
- package/mysql-core/columns/timestamp.cjs.map +1 -1
- package/mysql-core/columns/timestamp.d.cts +4 -4
- package/mysql-core/columns/timestamp.d.ts +4 -4
- package/mysql-core/columns/timestamp.js +8 -8
- package/mysql-core/columns/timestamp.js.map +1 -1
- package/mysql-core/columns/tinyint.cjs +2 -2
- package/mysql-core/columns/tinyint.cjs.map +1 -1
- package/mysql-core/columns/tinyint.d.cts +1 -1
- package/mysql-core/columns/tinyint.d.ts +1 -1
- package/mysql-core/columns/tinyint.js +2 -2
- package/mysql-core/columns/tinyint.js.map +1 -1
- package/mysql-core/columns/varbinary.cjs +2 -2
- package/mysql-core/columns/varbinary.cjs.map +1 -1
- package/mysql-core/columns/varbinary.d.cts +1 -1
- package/mysql-core/columns/varbinary.d.ts +1 -1
- package/mysql-core/columns/varbinary.js +2 -2
- package/mysql-core/columns/varbinary.js.map +1 -1
- package/mysql-core/columns/year.cjs +2 -2
- package/mysql-core/columns/year.cjs.map +1 -1
- package/mysql-core/columns/year.d.cts +1 -1
- package/mysql-core/columns/year.d.ts +1 -1
- package/mysql-core/columns/year.js +2 -2
- package/mysql-core/columns/year.js.map +1 -1
- package/mysql-core/db.d.ts +1 -1
- package/mysql-core/dialect.cjs +1 -1
- package/mysql-core/dialect.d.ts +1 -1
- package/mysql-core/dialect.js +1 -1
- package/mysql-core/query-builders/query.cjs +13 -5
- package/mysql-core/query-builders/query.cjs.map +1 -1
- package/mysql-core/query-builders/query.d.ts +1 -1
- package/mysql-core/query-builders/query.js +13 -5
- package/mysql-core/query-builders/query.js.map +1 -1
- package/mysql-core/query-builders/select.cjs +4 -0
- package/mysql-core/query-builders/select.cjs.map +1 -1
- package/mysql-core/query-builders/select.js +4 -0
- package/mysql-core/query-builders/select.js.map +1 -1
- package/mysql-core/session.cjs +1 -2
- package/mysql-core/session.cjs.map +1 -1
- package/mysql-core/session.d.cts +3 -4
- package/mysql-core/session.d.ts +3 -4
- package/mysql-core/session.js +1 -2
- package/mysql-core/session.js.map +1 -1
- package/mysql-core/table.cjs +1 -1
- package/mysql-core/table.cjs.map +1 -1
- package/mysql-core/table.js +1 -1
- package/mysql-core/table.js.map +1 -1
- package/mysql-proxy/driver.cjs +5 -2
- package/mysql-proxy/driver.cjs.map +1 -1
- package/mysql-proxy/driver.js +5 -2
- package/mysql-proxy/driver.js.map +1 -1
- package/mysql-proxy/session.cjs +25 -18
- package/mysql-proxy/session.cjs.map +1 -1
- package/mysql-proxy/session.d.cts +11 -4
- package/mysql-proxy/session.d.ts +12 -5
- package/mysql-proxy/session.js +26 -19
- package/mysql-proxy/session.js.map +1 -1
- package/mysql2/driver.cjs +3 -2
- package/mysql2/driver.cjs.map +1 -1
- package/mysql2/driver.d.cts +1 -0
- package/mysql2/driver.d.ts +3 -2
- package/mysql2/driver.js +3 -2
- package/mysql2/driver.js.map +1 -1
- package/mysql2/session.cjs +48 -38
- package/mysql2/session.cjs.map +1 -1
- package/mysql2/session.d.cts +11 -4
- package/mysql2/session.d.ts +12 -5
- package/mysql2/session.js +49 -39
- package/mysql2/session.js.map +1 -1
- package/neon-http/driver.cjs +34 -65
- package/neon-http/driver.cjs.map +1 -1
- package/neon-http/driver.d.cts +15 -19
- package/neon-http/driver.d.ts +16 -20
- package/neon-http/driver.js +34 -64
- package/neon-http/driver.js.map +1 -1
- package/neon-http/index.cjs +2 -4
- package/neon-http/index.d.cts +3 -3
- package/neon-http/index.d.ts +3 -3
- package/neon-http/index.js +3 -3
- package/neon-http/migrator.cjs +1 -1
- package/neon-http/migrator.cjs.map +1 -1
- package/neon-http/migrator.d.cts +1 -1
- package/neon-http/migrator.d.ts +1 -1
- package/neon-http/migrator.js +1 -1
- package/neon-http/migrator.js.map +1 -1
- package/neon-http/session.cjs +27 -116
- package/neon-http/session.cjs.map +1 -1
- package/neon-http/session.d.cts +10 -38
- package/neon-http/session.d.ts +10 -38
- package/neon-http/session.js +29 -116
- package/neon-http/session.js.map +1 -1
- package/neon-serverless/driver.cjs +14 -32
- package/neon-serverless/driver.cjs.map +1 -1
- package/neon-serverless/driver.d.cts +12 -17
- package/neon-serverless/driver.d.ts +13 -18
- package/neon-serverless/driver.js +14 -31
- package/neon-serverless/driver.js.map +1 -1
- package/neon-serverless/index.cjs +2 -3
- package/neon-serverless/index.d.cts +3 -3
- package/neon-serverless/index.d.ts +3 -3
- package/neon-serverless/index.js +3 -3
- package/neon-serverless/migrator.cjs.map +1 -1
- package/neon-serverless/migrator.d.cts +1 -1
- package/neon-serverless/migrator.d.ts +1 -1
- package/neon-serverless/migrator.js.map +1 -1
- package/neon-serverless/session.cjs +32 -108
- package/neon-serverless/session.cjs.map +1 -1
- package/neon-serverless/session.d.cts +9 -32
- package/neon-serverless/session.d.ts +9 -32
- package/neon-serverless/session.js +34 -109
- package/neon-serverless/session.js.map +1 -1
- package/netlify-db/driver.cjs +36 -43
- package/netlify-db/driver.cjs.map +1 -1
- package/netlify-db/driver.d.cts +29 -29
- package/netlify-db/driver.d.ts +31 -31
- package/netlify-db/driver.js +35 -42
- package/netlify-db/driver.js.map +1 -1
- package/netlify-db/index.cjs +3 -2
- package/netlify-db/index.d.cts +3 -3
- package/netlify-db/index.d.ts +3 -3
- package/netlify-db/index.js +2 -2
- package/netlify-db/migrator.cjs.map +1 -1
- package/netlify-db/migrator.d.cts +1 -1
- package/netlify-db/migrator.d.ts +1 -1
- package/netlify-db/migrator.js.map +1 -1
- package/netlify-db/session.cjs +61 -39
- package/netlify-db/session.cjs.map +1 -1
- package/netlify-db/session.d.cts +22 -23
- package/netlify-db/session.d.ts +23 -24
- package/netlify-db/session.js +63 -41
- package/netlify-db/session.js.map +1 -1
- package/node-mssql/driver.cjs +9 -3
- package/node-mssql/driver.cjs.map +1 -1
- package/node-mssql/driver.d.cts +1 -0
- package/node-mssql/driver.d.ts +2 -1
- package/node-mssql/driver.js +9 -3
- package/node-mssql/driver.js.map +1 -1
- package/node-mssql/session.cjs +6 -4
- package/node-mssql/session.cjs.map +1 -1
- package/node-mssql/session.d.cts +4 -1
- package/node-mssql/session.d.ts +5 -2
- package/node-mssql/session.js +7 -5
- package/node-mssql/session.js.map +1 -1
- package/node-postgres/driver.cjs +15 -18
- package/node-postgres/driver.cjs.map +1 -1
- package/node-postgres/driver.d.cts +11 -6
- package/node-postgres/driver.d.ts +12 -7
- package/node-postgres/driver.js +15 -18
- package/node-postgres/driver.js.map +1 -1
- package/node-postgres/index.cjs +2 -2
- package/node-postgres/index.d.cts +3 -3
- package/node-postgres/index.d.ts +3 -3
- package/node-postgres/index.js +3 -3
- package/node-postgres/migrator.cjs.map +1 -1
- package/node-postgres/migrator.d.cts +1 -1
- package/node-postgres/migrator.d.ts +1 -1
- package/node-postgres/migrator.js.map +1 -1
- package/node-postgres/session.cjs +32 -125
- package/node-postgres/session.cjs.map +1 -1
- package/node-postgres/session.d.cts +10 -30
- package/node-postgres/session.d.ts +9 -29
- package/node-postgres/session.js +34 -126
- package/node-postgres/session.js.map +1 -1
- package/node-sqlite/driver.cjs +1 -1
- package/node-sqlite/driver.d.ts +1 -1
- package/node-sqlite/driver.js +1 -1
- package/node-sqlite/session.cjs +4 -9
- package/node-sqlite/session.cjs.map +1 -1
- package/node-sqlite/session.d.cts +3 -4
- package/node-sqlite/session.d.ts +4 -5
- package/node-sqlite/session.js +4 -9
- package/node-sqlite/session.js.map +1 -1
- package/op-sqlite/driver.cjs +3 -2
- package/op-sqlite/driver.cjs.map +1 -1
- package/op-sqlite/driver.d.ts +1 -1
- package/op-sqlite/driver.js +3 -2
- package/op-sqlite/driver.js.map +1 -1
- package/op-sqlite/session.cjs +17 -15
- package/op-sqlite/session.cjs.map +1 -1
- package/op-sqlite/session.d.cts +10 -6
- package/op-sqlite/session.d.ts +10 -6
- package/op-sqlite/session.js +18 -16
- package/op-sqlite/session.js.map +1 -1
- package/operations.d.cts +3 -0
- package/operations.d.ts +3 -0
- package/package.json +43 -31
- package/pg-core/{utils/array.cjs → array.cjs} +1 -1
- package/pg-core/array.cjs.map +1 -0
- package/pg-core/{utils/array.d.cts → array.d.cts} +1 -1
- package/pg-core/{utils/array.d.ts → array.d.ts} +1 -1
- package/pg-core/{utils/array.js → array.js} +1 -1
- package/pg-core/array.js.map +1 -0
- package/pg-core/async/count.cjs +2 -9
- package/pg-core/async/count.cjs.map +1 -1
- package/pg-core/async/count.js +2 -9
- package/pg-core/async/count.js.map +1 -1
- package/pg-core/async/db.cjs +8 -28
- package/pg-core/async/db.cjs.map +1 -1
- package/pg-core/async/db.d.cts +5 -13
- package/pg-core/async/db.d.ts +6 -14
- package/pg-core/async/db.js +8 -28
- package/pg-core/async/db.js.map +1 -1
- package/pg-core/async/delete.cjs +7 -12
- package/pg-core/async/delete.cjs.map +1 -1
- package/pg-core/async/delete.js +7 -12
- package/pg-core/async/delete.js.map +1 -1
- package/pg-core/async/insert.cjs +7 -12
- package/pg-core/async/insert.cjs.map +1 -1
- package/pg-core/async/insert.js +7 -12
- package/pg-core/async/insert.js.map +1 -1
- package/pg-core/async/query.cjs +8 -14
- package/pg-core/async/query.cjs.map +1 -1
- package/pg-core/async/query.js +8 -14
- package/pg-core/async/query.js.map +1 -1
- package/pg-core/async/refresh-materialized-view.cjs +1 -9
- package/pg-core/async/refresh-materialized-view.cjs.map +1 -1
- package/pg-core/async/refresh-materialized-view.js +1 -9
- package/pg-core/async/refresh-materialized-view.js.map +1 -1
- package/pg-core/async/select.cjs +4 -13
- package/pg-core/async/select.cjs.map +1 -1
- package/pg-core/async/select.js +4 -13
- package/pg-core/async/select.js.map +1 -1
- package/pg-core/async/session.cjs +44 -20
- package/pg-core/async/session.cjs.map +1 -1
- package/pg-core/async/session.d.cts +25 -31
- package/pg-core/async/session.d.ts +26 -32
- package/pg-core/async/session.js +45 -21
- package/pg-core/async/session.js.map +1 -1
- package/pg-core/async/update.cjs +11 -15
- package/pg-core/async/update.cjs.map +1 -1
- package/pg-core/async/update.js +11 -15
- package/pg-core/async/update.js.map +1 -1
- package/pg-core/codecs.cjs +156 -0
- package/pg-core/codecs.cjs.map +1 -0
- package/pg-core/codecs.d.cts +27 -0
- package/pg-core/codecs.d.ts +27 -0
- package/pg-core/codecs.js +148 -0
- package/pg-core/codecs.js.map +1 -0
- package/pg-core/columns/bigint.cjs +10 -9
- package/pg-core/columns/bigint.cjs.map +1 -1
- package/pg-core/columns/bigint.d.cts +2 -3
- package/pg-core/columns/bigint.d.ts +2 -3
- package/pg-core/columns/bigint.js +10 -9
- package/pg-core/columns/bigint.js.map +1 -1
- package/pg-core/columns/bigserial.cjs +6 -6
- package/pg-core/columns/bigserial.cjs.map +1 -1
- package/pg-core/columns/bigserial.d.cts +1 -2
- package/pg-core/columns/bigserial.d.ts +1 -2
- package/pg-core/columns/bigserial.js +6 -6
- package/pg-core/columns/bigserial.js.map +1 -1
- package/pg-core/columns/boolean.cjs +2 -0
- package/pg-core/columns/boolean.cjs.map +1 -1
- package/pg-core/columns/boolean.js +2 -0
- package/pg-core/columns/boolean.js.map +1 -1
- package/pg-core/columns/bytea.cjs +2 -8
- package/pg-core/columns/bytea.cjs.map +1 -1
- package/pg-core/columns/bytea.d.cts +0 -1
- package/pg-core/columns/bytea.d.ts +0 -1
- package/pg-core/columns/bytea.js +2 -8
- package/pg-core/columns/bytea.js.map +1 -1
- package/pg-core/columns/char.cjs +2 -0
- package/pg-core/columns/char.cjs.map +1 -1
- package/pg-core/columns/char.js +2 -0
- package/pg-core/columns/char.js.map +1 -1
- package/pg-core/columns/cidr.cjs +2 -0
- package/pg-core/columns/cidr.cjs.map +1 -1
- package/pg-core/columns/cidr.js +2 -0
- package/pg-core/columns/cidr.js.map +1 -1
- package/pg-core/columns/common.cjs +10 -8
- package/pg-core/columns/common.cjs.map +1 -1
- package/pg-core/columns/common.d.cts +34 -39
- package/pg-core/columns/common.d.ts +34 -39
- package/pg-core/columns/common.js +10 -8
- package/pg-core/columns/common.js.map +1 -1
- package/pg-core/columns/custom.cjs +16 -46
- package/pg-core/columns/custom.cjs.map +1 -1
- package/pg-core/columns/custom.d.cts +17 -8
- package/pg-core/columns/custom.d.ts +17 -8
- package/pg-core/columns/custom.js +16 -46
- package/pg-core/columns/custom.js.map +1 -1
- package/pg-core/columns/date.cjs +11 -12
- package/pg-core/columns/date.cjs.map +1 -1
- package/pg-core/columns/date.d.cts +3 -4
- package/pg-core/columns/date.d.ts +3 -4
- package/pg-core/columns/date.js +11 -12
- package/pg-core/columns/date.js.map +1 -1
- package/pg-core/columns/double-precision.cjs +2 -4
- package/pg-core/columns/double-precision.cjs.map +1 -1
- package/pg-core/columns/double-precision.d.cts +0 -1
- package/pg-core/columns/double-precision.d.ts +0 -1
- package/pg-core/columns/double-precision.js +2 -4
- package/pg-core/columns/double-precision.js.map +1 -1
- package/pg-core/columns/enum.cjs +4 -0
- package/pg-core/columns/enum.cjs.map +1 -1
- package/pg-core/columns/enum.js +4 -0
- package/pg-core/columns/enum.js.map +1 -1
- package/pg-core/columns/index.d.cts +2 -2
- package/pg-core/columns/index.d.ts +2 -2
- package/pg-core/columns/inet.cjs +2 -0
- package/pg-core/columns/inet.cjs.map +1 -1
- package/pg-core/columns/inet.js +2 -0
- package/pg-core/columns/inet.js.map +1 -1
- package/pg-core/columns/integer.cjs +2 -4
- package/pg-core/columns/integer.cjs.map +1 -1
- package/pg-core/columns/integer.d.cts +0 -1
- package/pg-core/columns/integer.d.ts +0 -1
- package/pg-core/columns/integer.js +2 -4
- package/pg-core/columns/integer.js.map +1 -1
- package/pg-core/columns/interval.cjs +2 -0
- package/pg-core/columns/interval.cjs.map +1 -1
- package/pg-core/columns/interval.js +2 -0
- package/pg-core/columns/interval.js.map +1 -1
- package/pg-core/columns/json.cjs +2 -11
- package/pg-core/columns/json.cjs.map +1 -1
- package/pg-core/columns/json.d.cts +0 -2
- package/pg-core/columns/json.d.ts +0 -2
- package/pg-core/columns/json.js +2 -11
- package/pg-core/columns/json.js.map +1 -1
- package/pg-core/columns/jsonb.cjs +2 -11
- package/pg-core/columns/jsonb.cjs.map +1 -1
- package/pg-core/columns/jsonb.d.cts +0 -2
- package/pg-core/columns/jsonb.d.ts +0 -2
- package/pg-core/columns/jsonb.js +2 -11
- package/pg-core/columns/jsonb.js.map +1 -1
- package/pg-core/columns/line.cjs +12 -8
- package/pg-core/columns/line.cjs.map +1 -1
- package/pg-core/columns/line.d.cts +5 -5
- package/pg-core/columns/line.d.ts +5 -5
- package/pg-core/columns/line.js +12 -8
- package/pg-core/columns/line.js.map +1 -1
- package/pg-core/columns/macaddr.cjs +2 -0
- package/pg-core/columns/macaddr.cjs.map +1 -1
- package/pg-core/columns/macaddr.js +2 -0
- package/pg-core/columns/macaddr.js.map +1 -1
- package/pg-core/columns/macaddr8.cjs +2 -0
- package/pg-core/columns/macaddr8.cjs.map +1 -1
- package/pg-core/columns/macaddr8.js +2 -0
- package/pg-core/columns/macaddr8.js.map +1 -1
- package/pg-core/columns/numeric.cjs +12 -15
- package/pg-core/columns/numeric.cjs.map +1 -1
- package/pg-core/columns/numeric.d.cts +4 -5
- package/pg-core/columns/numeric.d.ts +4 -5
- package/pg-core/columns/numeric.js +12 -15
- package/pg-core/columns/numeric.js.map +1 -1
- package/pg-core/columns/point.cjs +19 -21
- package/pg-core/columns/point.cjs.map +1 -1
- package/pg-core/columns/point.d.cts +5 -11
- package/pg-core/columns/point.d.ts +5 -11
- package/pg-core/columns/point.js +19 -21
- package/pg-core/columns/point.js.map +1 -1
- package/pg-core/columns/postgis_extension/geometry.cjs +12 -9
- package/pg-core/columns/postgis_extension/geometry.cjs.map +1 -1
- package/pg-core/columns/postgis_extension/geometry.d.cts +5 -5
- package/pg-core/columns/postgis_extension/geometry.d.ts +5 -5
- package/pg-core/columns/postgis_extension/geometry.js +12 -9
- package/pg-core/columns/postgis_extension/geometry.js.map +1 -1
- package/pg-core/columns/real.cjs +2 -4
- package/pg-core/columns/real.cjs.map +1 -1
- package/pg-core/columns/real.d.cts +0 -1
- package/pg-core/columns/real.d.ts +0 -1
- package/pg-core/columns/real.js +2 -4
- package/pg-core/columns/real.js.map +1 -1
- package/pg-core/columns/serial.cjs +2 -0
- package/pg-core/columns/serial.cjs.map +1 -1
- package/pg-core/columns/serial.js +2 -0
- package/pg-core/columns/serial.js.map +1 -1
- package/pg-core/columns/smallint.cjs +2 -4
- package/pg-core/columns/smallint.cjs.map +1 -1
- package/pg-core/columns/smallint.d.cts +0 -1
- package/pg-core/columns/smallint.d.ts +0 -1
- package/pg-core/columns/smallint.js +2 -4
- package/pg-core/columns/smallint.js.map +1 -1
- package/pg-core/columns/smallserial.cjs +2 -0
- package/pg-core/columns/smallserial.cjs.map +1 -1
- package/pg-core/columns/smallserial.js +2 -0
- package/pg-core/columns/smallserial.js.map +1 -1
- package/pg-core/columns/text.cjs +2 -0
- package/pg-core/columns/text.cjs.map +1 -1
- package/pg-core/columns/text.js +2 -0
- package/pg-core/columns/text.js.map +1 -1
- package/pg-core/columns/time.cjs +2 -0
- package/pg-core/columns/time.cjs.map +1 -1
- package/pg-core/columns/time.js +2 -0
- package/pg-core/columns/time.js.map +1 -1
- package/pg-core/columns/timestamp.cjs +13 -14
- package/pg-core/columns/timestamp.cjs.map +1 -1
- package/pg-core/columns/timestamp.d.cts +3 -4
- package/pg-core/columns/timestamp.d.ts +3 -4
- package/pg-core/columns/timestamp.js +13 -14
- package/pg-core/columns/timestamp.js.map +1 -1
- package/pg-core/columns/uuid.cjs +2 -0
- package/pg-core/columns/uuid.cjs.map +1 -1
- package/pg-core/columns/uuid.js +2 -0
- package/pg-core/columns/uuid.js.map +1 -1
- package/pg-core/columns/varchar.cjs +2 -0
- package/pg-core/columns/varchar.cjs.map +1 -1
- package/pg-core/columns/varchar.js +2 -0
- package/pg-core/columns/varchar.js.map +1 -1
- package/pg-core/columns/vector_extension/bit.cjs +2 -0
- package/pg-core/columns/vector_extension/bit.cjs.map +1 -1
- package/pg-core/columns/vector_extension/bit.js +2 -0
- package/pg-core/columns/vector_extension/bit.js.map +1 -1
- package/pg-core/columns/vector_extension/halfvec.cjs +6 -4
- package/pg-core/columns/vector_extension/halfvec.cjs.map +1 -1
- package/pg-core/columns/vector_extension/halfvec.d.cts +2 -2
- package/pg-core/columns/vector_extension/halfvec.d.ts +2 -2
- package/pg-core/columns/vector_extension/halfvec.js +6 -4
- package/pg-core/columns/vector_extension/halfvec.js.map +1 -1
- package/pg-core/columns/vector_extension/sparsevec.cjs +2 -0
- package/pg-core/columns/vector_extension/sparsevec.cjs.map +1 -1
- package/pg-core/columns/vector_extension/sparsevec.js +2 -0
- package/pg-core/columns/vector_extension/sparsevec.js.map +1 -1
- package/pg-core/columns/vector_extension/vector.cjs +6 -4
- package/pg-core/columns/vector_extension/vector.cjs.map +1 -1
- package/pg-core/columns/vector_extension/vector.d.cts +2 -2
- package/pg-core/columns/vector_extension/vector.d.ts +2 -2
- package/pg-core/columns/vector_extension/vector.js +6 -4
- package/pg-core/columns/vector_extension/vector.js.map +1 -1
- package/pg-core/dialect.cjs +73 -226
- package/pg-core/dialect.cjs.map +1 -1
- package/pg-core/dialect.d.cts +27 -34
- package/pg-core/dialect.d.ts +27 -34
- package/pg-core/dialect.js +78 -230
- package/pg-core/dialect.js.map +1 -1
- package/pg-core/effect/count.cjs +1 -1
- package/pg-core/effect/count.cjs.map +1 -1
- package/pg-core/effect/count.d.cts +2 -2
- package/pg-core/effect/count.d.ts +2 -2
- package/pg-core/effect/count.js +1 -1
- package/pg-core/effect/count.js.map +1 -1
- package/pg-core/effect/db.cjs +9 -18
- package/pg-core/effect/db.cjs.map +1 -1
- package/pg-core/effect/db.d.cts +7 -11
- package/pg-core/effect/db.d.ts +6 -10
- package/pg-core/effect/db.js +9 -18
- package/pg-core/effect/db.js.map +1 -1
- package/pg-core/effect/delete.cjs +7 -5
- package/pg-core/effect/delete.cjs.map +1 -1
- package/pg-core/effect/delete.d.cts +1 -1
- package/pg-core/effect/delete.d.ts +1 -1
- package/pg-core/effect/delete.js +7 -5
- package/pg-core/effect/delete.js.map +1 -1
- package/pg-core/effect/insert.cjs +7 -5
- package/pg-core/effect/insert.cjs.map +1 -1
- package/pg-core/effect/insert.d.cts +1 -1
- package/pg-core/effect/insert.d.ts +1 -1
- package/pg-core/effect/insert.js +7 -5
- package/pg-core/effect/insert.js.map +1 -1
- package/pg-core/effect/query.cjs +7 -6
- package/pg-core/effect/query.cjs.map +1 -1
- package/pg-core/effect/query.d.cts +1 -1
- package/pg-core/effect/query.d.ts +1 -1
- package/pg-core/effect/query.js +7 -6
- package/pg-core/effect/query.js.map +1 -1
- package/pg-core/effect/refresh-materialized-view.cjs +1 -2
- package/pg-core/effect/refresh-materialized-view.cjs.map +1 -1
- package/pg-core/effect/refresh-materialized-view.d.cts +1 -1
- package/pg-core/effect/refresh-materialized-view.d.ts +1 -1
- package/pg-core/effect/refresh-materialized-view.js +1 -2
- package/pg-core/effect/refresh-materialized-view.js.map +1 -1
- package/pg-core/effect/select.cjs +3 -5
- package/pg-core/effect/select.cjs.map +1 -1
- package/pg-core/effect/select.d.cts +1 -1
- package/pg-core/effect/select.d.ts +1 -1
- package/pg-core/effect/select.js +3 -5
- package/pg-core/effect/select.js.map +1 -1
- package/pg-core/effect/session.cjs +28 -17
- package/pg-core/effect/session.cjs.map +1 -1
- package/pg-core/effect/session.d.cts +24 -28
- package/pg-core/effect/session.d.ts +25 -29
- package/pg-core/effect/session.js +29 -18
- package/pg-core/effect/session.js.map +1 -1
- package/pg-core/effect/update.cjs +8 -8
- package/pg-core/effect/update.cjs.map +1 -1
- package/pg-core/effect/update.d.cts +1 -1
- package/pg-core/effect/update.d.ts +1 -1
- package/pg-core/effect/update.js +8 -8
- package/pg-core/effect/update.js.map +1 -1
- package/pg-core/index.cjs +4 -4
- package/pg-core/index.d.cts +4 -4
- package/pg-core/index.d.ts +4 -4
- package/pg-core/index.js +1 -1
- package/pg-core/query-builders/delete.cjs +6 -2
- package/pg-core/query-builders/delete.cjs.map +1 -1
- package/pg-core/query-builders/delete.d.cts +2 -0
- package/pg-core/query-builders/delete.d.ts +2 -0
- package/pg-core/query-builders/delete.js +6 -2
- package/pg-core/query-builders/delete.js.map +1 -1
- package/pg-core/query-builders/insert.cjs +7 -2
- package/pg-core/query-builders/insert.cjs.map +1 -1
- package/pg-core/query-builders/insert.d.cts +2 -0
- package/pg-core/query-builders/insert.d.ts +2 -0
- package/pg-core/query-builders/insert.js +7 -2
- package/pg-core/query-builders/insert.js.map +1 -1
- package/pg-core/query-builders/query-builder.cjs +2 -1
- package/pg-core/query-builders/query-builder.cjs.map +1 -1
- package/pg-core/query-builders/query-builder.js +2 -1
- package/pg-core/query-builders/query-builder.js.map +1 -1
- package/pg-core/query-builders/query.cjs +0 -1
- package/pg-core/query-builders/query.cjs.map +1 -1
- package/pg-core/query-builders/query.d.cts +2 -1
- package/pg-core/query-builders/query.d.ts +2 -1
- package/pg-core/query-builders/query.js +0 -1
- package/pg-core/query-builders/query.js.map +1 -1
- package/pg-core/query-builders/raw.cjs +0 -4
- package/pg-core/query-builders/raw.cjs.map +1 -1
- package/pg-core/query-builders/raw.js +0 -4
- package/pg-core/query-builders/raw.js.map +1 -1
- package/pg-core/query-builders/select.cjs +6 -2
- package/pg-core/query-builders/select.cjs.map +1 -1
- package/pg-core/query-builders/select.d.cts +1 -0
- package/pg-core/query-builders/select.d.ts +1 -0
- package/pg-core/query-builders/select.js +6 -2
- package/pg-core/query-builders/select.js.map +1 -1
- package/pg-core/query-builders/select.types.d.cts +1 -0
- package/pg-core/query-builders/select.types.d.ts +1 -0
- package/pg-core/query-builders/update.cjs +6 -2
- package/pg-core/query-builders/update.cjs.map +1 -1
- package/pg-core/query-builders/update.d.cts +2 -0
- package/pg-core/query-builders/update.d.ts +2 -0
- package/pg-core/query-builders/update.js +6 -2
- package/pg-core/query-builders/update.js.map +1 -1
- package/pg-core/session.cjs +3 -5
- package/pg-core/session.cjs.map +1 -1
- package/pg-core/session.d.cts +4 -7
- package/pg-core/session.d.ts +4 -7
- package/pg-core/session.js +3 -5
- package/pg-core/session.js.map +1 -1
- package/pg-core/table.cjs +1 -1
- package/pg-core/table.cjs.map +1 -1
- package/pg-core/table.js +1 -1
- package/pg-core/table.js.map +1 -1
- package/pg-core/utils.cjs.map +1 -1
- package/pg-core/utils.d.cts +7 -1
- package/pg-core/utils.d.ts +7 -1
- package/pg-core/utils.js.map +1 -1
- package/pg-core/view.cjs +2 -2
- package/pg-core/view.cjs.map +1 -1
- package/pg-core/view.js +2 -2
- package/pg-core/view.js.map +1 -1
- package/pg-proxy/driver.cjs +10 -15
- package/pg-proxy/driver.cjs.map +1 -1
- package/pg-proxy/driver.d.cts +6 -3
- package/pg-proxy/driver.d.ts +6 -3
- package/pg-proxy/driver.js +10 -14
- package/pg-proxy/driver.js.map +1 -1
- package/pg-proxy/index.cjs +0 -2
- package/pg-proxy/index.d.cts +2 -2
- package/pg-proxy/index.d.ts +2 -2
- package/pg-proxy/index.js +2 -2
- package/pg-proxy/migrator.cjs.map +1 -1
- package/pg-proxy/migrator.d.cts +1 -1
- package/pg-proxy/migrator.d.ts +1 -1
- package/pg-proxy/migrator.js.map +1 -1
- package/pg-proxy/session.cjs +8 -84
- package/pg-proxy/session.cjs.map +1 -1
- package/pg-proxy/session.d.cts +9 -32
- package/pg-proxy/session.d.ts +9 -32
- package/pg-proxy/session.js +10 -84
- package/pg-proxy/session.js.map +1 -1
- package/pglite/driver.cjs +71 -33
- package/pglite/driver.cjs.map +1 -1
- package/pglite/driver.d.cts +12 -17
- package/pglite/driver.d.ts +13 -18
- package/pglite/driver.js +71 -32
- package/pglite/driver.js.map +1 -1
- package/pglite/index.cjs +2 -3
- package/pglite/index.d.cts +3 -3
- package/pglite/index.d.ts +3 -3
- package/pglite/index.js +3 -3
- package/pglite/migrator.cjs.map +1 -1
- package/pglite/migrator.d.cts +1 -1
- package/pglite/migrator.d.ts +1 -1
- package/pglite/migrator.js.map +1 -1
- package/pglite/session.cjs +24 -85
- package/pglite/session.cjs.map +1 -1
- package/pglite/session.d.cts +9 -30
- package/pglite/session.d.ts +9 -30
- package/pglite/session.js +26 -86
- package/pglite/session.js.map +1 -1
- package/planetscale-serverless/driver.cjs +3 -2
- package/planetscale-serverless/driver.cjs.map +1 -1
- package/planetscale-serverless/driver.d.cts +1 -0
- package/planetscale-serverless/driver.d.ts +1 -0
- package/planetscale-serverless/driver.js +3 -2
- package/planetscale-serverless/driver.js.map +1 -1
- package/planetscale-serverless/session.cjs +26 -19
- package/planetscale-serverless/session.cjs.map +1 -1
- package/planetscale-serverless/session.d.cts +12 -6
- package/planetscale-serverless/session.d.ts +13 -7
- package/planetscale-serverless/session.js +27 -20
- package/planetscale-serverless/session.js.map +1 -1
- package/postgres-js/driver.cjs +124 -19
- package/postgres-js/driver.cjs.map +1 -1
- package/postgres-js/driver.d.cts +10 -6
- package/postgres-js/driver.d.ts +10 -6
- package/postgres-js/driver.js +124 -19
- package/postgres-js/driver.js.map +1 -1
- package/postgres-js/index.cjs +2 -2
- package/postgres-js/index.d.cts +3 -3
- package/postgres-js/index.d.ts +3 -3
- package/postgres-js/index.js +3 -3
- package/postgres-js/migrator.cjs.map +1 -1
- package/postgres-js/migrator.d.cts +1 -1
- package/postgres-js/migrator.d.ts +1 -1
- package/postgres-js/migrator.js.map +1 -1
- package/postgres-js/session.cjs +16 -111
- package/postgres-js/session.cjs.map +1 -1
- package/postgres-js/session.d.cts +10 -31
- package/postgres-js/session.d.ts +9 -30
- package/postgres-js/session.js +17 -111
- package/postgres-js/session.js.map +1 -1
- package/prisma/mysql/session.cjs +2 -1
- package/prisma/mysql/session.cjs.map +1 -1
- package/prisma/mysql/session.d.cts +1 -0
- package/prisma/mysql/session.d.ts +2 -1
- package/prisma/mysql/session.js +2 -1
- package/prisma/mysql/session.js.map +1 -1
- package/prisma/pg/driver.cjs +9 -3
- package/prisma/pg/driver.cjs.map +1 -1
- package/prisma/pg/driver.d.cts +7 -3
- package/prisma/pg/driver.d.ts +7 -3
- package/prisma/pg/driver.js +9 -4
- package/prisma/pg/driver.js.map +1 -1
- package/prisma/pg/index.cjs +2 -2
- package/prisma/pg/index.d.cts +3 -3
- package/prisma/pg/index.d.ts +3 -3
- package/prisma/pg/index.js +3 -3
- package/prisma/pg/session.cjs +1 -25
- package/prisma/pg/session.cjs.map +1 -1
- package/prisma/pg/session.d.cts +3 -15
- package/prisma/pg/session.d.ts +2 -14
- package/prisma/pg/session.js +2 -25
- package/prisma/pg/session.js.map +1 -1
- package/prisma/sqlite/session.cjs +0 -3
- package/prisma/sqlite/session.cjs.map +1 -1
- package/prisma/sqlite/session.d.cts +0 -1
- package/prisma/sqlite/session.d.ts +1 -2
- package/prisma/sqlite/session.js +0 -3
- package/prisma/sqlite/session.js.map +1 -1
- package/query-builders/query-builder.cjs +4 -0
- package/query-builders/query-builder.cjs.map +1 -1
- package/query-builders/query-builder.js +4 -0
- package/query-builders/query-builder.js.map +1 -1
- package/relations.cjs +84 -23
- package/relations.cjs.map +1 -1
- package/relations.d.cts +41 -16
- package/relations.d.ts +41 -16
- package/relations.js +83 -24
- package/relations.js.map +1 -1
- package/row-mappers/index.cjs +1 -1
- package/row-mappers/index.cjs.map +1 -1
- package/row-mappers/index.js +1 -1
- package/row-mappers/index.js.map +1 -1
- package/singlestore/driver.cjs +4 -2
- package/singlestore/driver.cjs.map +1 -1
- package/singlestore/driver.d.cts +2 -1
- package/singlestore/driver.d.ts +3 -2
- package/singlestore/driver.js +4 -2
- package/singlestore/driver.js.map +1 -1
- package/singlestore/session.cjs +16 -6
- package/singlestore/session.cjs.map +1 -1
- package/singlestore/session.d.cts +8 -4
- package/singlestore/session.d.ts +8 -4
- package/singlestore/session.js +17 -7
- package/singlestore/session.js.map +1 -1
- package/singlestore-core/columns/bigint.cjs +4 -4
- package/singlestore-core/columns/bigint.cjs.map +1 -1
- package/singlestore-core/columns/bigint.d.cts +2 -2
- package/singlestore-core/columns/bigint.d.ts +2 -2
- package/singlestore-core/columns/bigint.js +4 -4
- package/singlestore-core/columns/bigint.js.map +1 -1
- package/singlestore-core/columns/binary.cjs +2 -2
- package/singlestore-core/columns/binary.cjs.map +1 -1
- package/singlestore-core/columns/binary.d.cts +1 -1
- package/singlestore-core/columns/binary.d.ts +1 -1
- package/singlestore-core/columns/binary.js +2 -2
- package/singlestore-core/columns/binary.js.map +1 -1
- package/singlestore-core/columns/boolean.cjs +2 -2
- package/singlestore-core/columns/boolean.cjs.map +1 -1
- package/singlestore-core/columns/boolean.d.cts +1 -1
- package/singlestore-core/columns/boolean.d.ts +1 -1
- package/singlestore-core/columns/boolean.js +2 -2
- package/singlestore-core/columns/boolean.js.map +1 -1
- package/singlestore-core/columns/custom.cjs +4 -4
- package/singlestore-core/columns/custom.cjs.map +1 -1
- package/singlestore-core/columns/custom.d.cts +2 -2
- package/singlestore-core/columns/custom.d.ts +2 -2
- package/singlestore-core/columns/custom.js +4 -4
- 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.d.cts +1 -1
- package/singlestore-core/columns/date.d.ts +1 -1
- package/singlestore-core/columns/date.js +2 -2
- package/singlestore-core/columns/date.js.map +1 -1
- package/singlestore-core/columns/datetime.cjs +6 -6
- package/singlestore-core/columns/datetime.cjs.map +1 -1
- package/singlestore-core/columns/datetime.d.cts +3 -3
- package/singlestore-core/columns/datetime.d.ts +3 -3
- package/singlestore-core/columns/datetime.js +6 -6
- package/singlestore-core/columns/datetime.js.map +1 -1
- package/singlestore-core/columns/decimal.cjs +4 -4
- package/singlestore-core/columns/decimal.cjs.map +1 -1
- package/singlestore-core/columns/decimal.d.cts +2 -2
- package/singlestore-core/columns/decimal.d.ts +2 -2
- package/singlestore-core/columns/decimal.js +4 -4
- package/singlestore-core/columns/decimal.js.map +1 -1
- package/singlestore-core/columns/float.cjs +2 -2
- package/singlestore-core/columns/float.cjs.map +1 -1
- package/singlestore-core/columns/float.d.cts +1 -1
- package/singlestore-core/columns/float.d.ts +1 -1
- package/singlestore-core/columns/float.js +2 -2
- package/singlestore-core/columns/float.js.map +1 -1
- package/singlestore-core/columns/int.cjs +2 -2
- package/singlestore-core/columns/int.cjs.map +1 -1
- package/singlestore-core/columns/int.d.cts +1 -1
- package/singlestore-core/columns/int.d.ts +1 -1
- package/singlestore-core/columns/int.js +2 -2
- package/singlestore-core/columns/int.js.map +1 -1
- package/singlestore-core/columns/json.cjs +2 -2
- package/singlestore-core/columns/json.cjs.map +1 -1
- package/singlestore-core/columns/json.d.cts +1 -1
- package/singlestore-core/columns/json.d.ts +1 -1
- package/singlestore-core/columns/json.js +2 -2
- package/singlestore-core/columns/json.js.map +1 -1
- package/singlestore-core/columns/mediumint.cjs +2 -2
- package/singlestore-core/columns/mediumint.cjs.map +1 -1
- package/singlestore-core/columns/mediumint.d.cts +1 -1
- package/singlestore-core/columns/mediumint.d.ts +1 -1
- package/singlestore-core/columns/mediumint.js +2 -2
- package/singlestore-core/columns/mediumint.js.map +1 -1
- package/singlestore-core/columns/serial.cjs +2 -2
- package/singlestore-core/columns/serial.cjs.map +1 -1
- package/singlestore-core/columns/serial.d.cts +1 -1
- package/singlestore-core/columns/serial.d.ts +1 -1
- package/singlestore-core/columns/serial.js +2 -2
- package/singlestore-core/columns/serial.js.map +1 -1
- package/singlestore-core/columns/smallint.cjs +2 -2
- package/singlestore-core/columns/smallint.cjs.map +1 -1
- package/singlestore-core/columns/smallint.d.cts +1 -1
- package/singlestore-core/columns/smallint.d.ts +1 -1
- package/singlestore-core/columns/smallint.js +2 -2
- package/singlestore-core/columns/smallint.js.map +1 -1
- package/singlestore-core/columns/timestamp.cjs +6 -6
- package/singlestore-core/columns/timestamp.cjs.map +1 -1
- package/singlestore-core/columns/timestamp.d.cts +3 -3
- package/singlestore-core/columns/timestamp.d.ts +3 -3
- package/singlestore-core/columns/timestamp.js +6 -6
- package/singlestore-core/columns/timestamp.js.map +1 -1
- package/singlestore-core/columns/tinyint.cjs +2 -2
- package/singlestore-core/columns/tinyint.cjs.map +1 -1
- package/singlestore-core/columns/tinyint.d.cts +1 -1
- package/singlestore-core/columns/tinyint.d.ts +1 -1
- package/singlestore-core/columns/tinyint.js +2 -2
- package/singlestore-core/columns/tinyint.js.map +1 -1
- package/singlestore-core/columns/varbinary.cjs +2 -2
- package/singlestore-core/columns/varbinary.cjs.map +1 -1
- package/singlestore-core/columns/varbinary.d.cts +1 -1
- package/singlestore-core/columns/varbinary.d.ts +1 -1
- package/singlestore-core/columns/varbinary.js +2 -2
- package/singlestore-core/columns/varbinary.js.map +1 -1
- package/singlestore-core/columns/vector.cjs +8 -8
- package/singlestore-core/columns/vector.cjs.map +1 -1
- package/singlestore-core/columns/vector.d.cts +4 -4
- package/singlestore-core/columns/vector.d.ts +4 -4
- package/singlestore-core/columns/vector.js +8 -8
- package/singlestore-core/columns/vector.js.map +1 -1
- package/singlestore-core/columns/year.cjs +2 -2
- package/singlestore-core/columns/year.cjs.map +1 -1
- package/singlestore-core/columns/year.d.cts +1 -1
- package/singlestore-core/columns/year.d.ts +1 -1
- package/singlestore-core/columns/year.js +2 -2
- package/singlestore-core/columns/year.js.map +1 -1
- package/singlestore-core/db.d.ts +1 -1
- package/singlestore-core/dialect.cjs +1 -1
- package/singlestore-core/dialect.d.ts +1 -1
- package/singlestore-core/dialect.js +1 -1
- package/singlestore-core/query-builders/query.cjs +13 -5
- package/singlestore-core/query-builders/query.cjs.map +1 -1
- package/singlestore-core/query-builders/query.d.ts +1 -1
- package/singlestore-core/query-builders/query.js +13 -5
- package/singlestore-core/query-builders/query.js.map +1 -1
- package/singlestore-core/query-builders/select.cjs +4 -0
- package/singlestore-core/query-builders/select.cjs.map +1 -1
- package/singlestore-core/query-builders/select.js +4 -0
- package/singlestore-core/query-builders/select.js.map +1 -1
- package/singlestore-core/session.cjs.map +1 -1
- package/singlestore-core/session.d.cts +2 -2
- package/singlestore-core/session.d.ts +2 -2
- package/singlestore-core/session.js.map +1 -1
- package/singlestore-core/table.cjs +1 -1
- package/singlestore-core/table.cjs.map +1 -1
- package/singlestore-core/table.js +1 -1
- package/singlestore-core/table.js.map +1 -1
- package/singlestore-proxy/driver.cjs +5 -2
- package/singlestore-proxy/driver.cjs.map +1 -1
- package/singlestore-proxy/driver.js +5 -2
- package/singlestore-proxy/driver.js.map +1 -1
- package/singlestore-proxy/session.cjs +11 -6
- package/singlestore-proxy/session.cjs.map +1 -1
- package/singlestore-proxy/session.d.cts +9 -4
- package/singlestore-proxy/session.d.ts +9 -4
- package/singlestore-proxy/session.js +12 -7
- package/singlestore-proxy/session.js.map +1 -1
- package/sql/index.cjs +1 -0
- package/sql/index.d.cts +2 -2
- package/sql/index.d.ts +2 -2
- package/sql/index.js +2 -2
- package/sql/sql.cjs +32 -11
- package/sql/sql.cjs.map +1 -1
- package/sql/sql.d.cts +15 -5
- package/sql/sql.d.ts +15 -5
- package/sql/sql.js +32 -12
- package/sql/sql.js.map +1 -1
- package/sql-js/driver.cjs +5 -2
- package/sql-js/driver.cjs.map +1 -1
- package/sql-js/driver.d.ts +1 -1
- package/sql-js/driver.js +5 -2
- package/sql-js/driver.js.map +1 -1
- package/sql-js/session.cjs +14 -14
- package/sql-js/session.cjs.map +1 -1
- package/sql-js/session.d.cts +10 -6
- package/sql-js/session.d.ts +10 -6
- package/sql-js/session.js +15 -15
- package/sql-js/session.js.map +1 -1
- package/sqlite-cloud/driver.cjs +3 -2
- package/sqlite-cloud/driver.cjs.map +1 -1
- package/sqlite-cloud/driver.d.ts +1 -1
- package/sqlite-cloud/driver.js +3 -2
- package/sqlite-cloud/driver.js.map +1 -1
- package/sqlite-cloud/session.cjs +20 -19
- package/sqlite-cloud/session.cjs.map +1 -1
- package/sqlite-cloud/session.d.cts +9 -6
- package/sqlite-cloud/session.d.ts +9 -6
- package/sqlite-cloud/session.js +21 -20
- package/sqlite-cloud/session.js.map +1 -1
- package/sqlite-core/columns/blob.cjs +10 -10
- package/sqlite-core/columns/blob.cjs.map +1 -1
- package/sqlite-core/columns/blob.d.cts +5 -5
- package/sqlite-core/columns/blob.d.ts +5 -5
- package/sqlite-core/columns/blob.js +10 -10
- package/sqlite-core/columns/blob.js.map +1 -1
- package/sqlite-core/columns/custom.cjs +4 -4
- package/sqlite-core/columns/custom.cjs.map +1 -1
- package/sqlite-core/columns/custom.d.cts +2 -2
- package/sqlite-core/columns/custom.d.ts +2 -2
- package/sqlite-core/columns/custom.js +4 -4
- package/sqlite-core/columns/custom.js.map +1 -1
- package/sqlite-core/columns/integer.cjs +8 -8
- package/sqlite-core/columns/integer.cjs.map +1 -1
- package/sqlite-core/columns/integer.d.cts +4 -4
- package/sqlite-core/columns/integer.d.ts +4 -4
- package/sqlite-core/columns/integer.js +8 -8
- package/sqlite-core/columns/integer.js.map +1 -1
- package/sqlite-core/columns/numeric.cjs +4 -4
- package/sqlite-core/columns/numeric.cjs.map +1 -1
- package/sqlite-core/columns/numeric.d.cts +2 -2
- package/sqlite-core/columns/numeric.d.ts +2 -2
- package/sqlite-core/columns/numeric.js +4 -4
- package/sqlite-core/columns/numeric.js.map +1 -1
- package/sqlite-core/columns/text.cjs +4 -4
- package/sqlite-core/columns/text.cjs.map +1 -1
- package/sqlite-core/columns/text.d.cts +2 -2
- package/sqlite-core/columns/text.d.ts +2 -2
- package/sqlite-core/columns/text.js +4 -4
- package/sqlite-core/columns/text.js.map +1 -1
- package/sqlite-core/db.d.ts +1 -1
- package/sqlite-core/dialect.cjs +2 -2
- package/sqlite-core/dialect.d.ts +1 -1
- package/sqlite-core/dialect.js +2 -2
- package/sqlite-core/query-builders/_query.cjs +1 -1
- package/sqlite-core/query-builders/_query.cjs.map +1 -1
- package/sqlite-core/query-builders/_query.js +1 -1
- package/sqlite-core/query-builders/_query.js.map +1 -1
- package/sqlite-core/query-builders/delete.cjs +1 -1
- package/sqlite-core/query-builders/delete.cjs.map +1 -1
- package/sqlite-core/query-builders/delete.js +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.js +1 -1
- package/sqlite-core/query-builders/insert.js.map +1 -1
- package/sqlite-core/query-builders/query.cjs +13 -5
- package/sqlite-core/query-builders/query.cjs.map +1 -1
- package/sqlite-core/query-builders/query.d.ts +1 -1
- package/sqlite-core/query-builders/query.js +13 -5
- package/sqlite-core/query-builders/query.js.map +1 -1
- package/sqlite-core/query-builders/raw.cjs +0 -4
- package/sqlite-core/query-builders/raw.cjs.map +1 -1
- package/sqlite-core/query-builders/raw.js +0 -4
- package/sqlite-core/query-builders/raw.js.map +1 -1
- package/sqlite-core/query-builders/select.cjs +5 -1
- package/sqlite-core/query-builders/select.cjs.map +1 -1
- package/sqlite-core/query-builders/select.js +5 -1
- package/sqlite-core/query-builders/select.js.map +1 -1
- package/sqlite-core/query-builders/update.cjs +1 -1
- package/sqlite-core/query-builders/update.cjs.map +1 -1
- package/sqlite-core/query-builders/update.js +1 -1
- package/sqlite-core/query-builders/update.js.map +1 -1
- package/sqlite-core/session.cjs +8 -8
- package/sqlite-core/session.cjs.map +1 -1
- package/sqlite-core/session.d.cts +5 -5
- package/sqlite-core/session.d.ts +5 -5
- package/sqlite-core/session.js +8 -8
- package/sqlite-core/session.js.map +1 -1
- package/sqlite-core/table.cjs +1 -1
- package/sqlite-core/table.cjs.map +1 -1
- package/sqlite-core/table.js +1 -1
- package/sqlite-core/table.js.map +1 -1
- package/sqlite-proxy/driver.cjs +3 -2
- package/sqlite-proxy/driver.cjs.map +1 -1
- package/sqlite-proxy/driver.d.ts +1 -1
- package/sqlite-proxy/driver.js +3 -2
- package/sqlite-proxy/driver.js.map +1 -1
- package/sqlite-proxy/session.cjs +19 -16
- package/sqlite-proxy/session.cjs.map +1 -1
- package/sqlite-proxy/session.d.cts +11 -7
- package/sqlite-proxy/session.d.ts +11 -7
- package/sqlite-proxy/session.js +20 -17
- package/sqlite-proxy/session.js.map +1 -1
- package/table.d.cts +1 -1
- package/table.d.ts +1 -1
- package/tidb-serverless/driver.cjs +3 -2
- package/tidb-serverless/driver.cjs.map +1 -1
- package/tidb-serverless/driver.d.cts +1 -0
- package/tidb-serverless/driver.d.ts +1 -0
- package/tidb-serverless/driver.js +3 -2
- package/tidb-serverless/driver.js.map +1 -1
- package/tidb-serverless/session.cjs +24 -36
- package/tidb-serverless/session.cjs.map +1 -1
- package/tidb-serverless/session.d.cts +10 -4
- package/tidb-serverless/session.d.ts +11 -5
- package/tidb-serverless/session.js +25 -37
- package/tidb-serverless/session.js.map +1 -1
- package/tursodatabase/driver-core.cjs +3 -2
- package/tursodatabase/driver-core.cjs.map +1 -1
- package/tursodatabase/driver-core.d.ts +1 -1
- package/tursodatabase/driver-core.js +3 -2
- package/tursodatabase/driver-core.js.map +1 -1
- package/tursodatabase/session.cjs +19 -18
- package/tursodatabase/session.cjs.map +1 -1
- package/tursodatabase/session.d.cts +9 -6
- package/tursodatabase/session.d.ts +9 -6
- package/tursodatabase/session.js +20 -19
- package/tursodatabase/session.js.map +1 -1
- package/up-migrations/effect-pg.cjs +3 -3
- package/up-migrations/effect-pg.cjs.map +1 -1
- package/up-migrations/effect-pg.js +3 -3
- package/up-migrations/effect-pg.js.map +1 -1
- package/up-migrations/pg.cjs +3 -8
- package/up-migrations/pg.cjs.map +1 -1
- package/up-migrations/pg.d.cts +1 -1
- package/up-migrations/pg.d.ts +1 -1
- package/up-migrations/pg.js +3 -8
- package/up-migrations/pg.js.map +1 -1
- package/up-migrations/sqlite.d.ts +2 -2
- package/utils.cjs +128 -6
- package/utils.cjs.map +1 -1
- package/utils.d.cts +10 -3
- package/utils.d.ts +10 -3
- package/utils.js +126 -7
- package/utils.js.map +1 -1
- package/vercel-postgres/driver.cjs +14 -32
- package/vercel-postgres/driver.cjs.map +1 -1
- package/vercel-postgres/driver.d.cts +12 -17
- package/vercel-postgres/driver.d.ts +13 -18
- package/vercel-postgres/driver.js +14 -31
- package/vercel-postgres/driver.js.map +1 -1
- package/vercel-postgres/index.cjs +2 -3
- package/vercel-postgres/index.d.cts +3 -3
- package/vercel-postgres/index.d.ts +3 -3
- package/vercel-postgres/index.js +3 -3
- package/vercel-postgres/migrator.cjs.map +1 -1
- package/vercel-postgres/migrator.d.cts +1 -1
- package/vercel-postgres/migrator.d.ts +1 -1
- package/vercel-postgres/migrator.js.map +1 -1
- package/vercel-postgres/session.cjs +32 -110
- package/vercel-postgres/session.cjs.map +1 -1
- package/vercel-postgres/session.d.cts +9 -32
- package/vercel-postgres/session.d.ts +9 -32
- package/vercel-postgres/session.js +34 -111
- package/vercel-postgres/session.js.map +1 -1
- package/xata-http/driver.cjs +91 -31
- package/xata-http/driver.cjs.map +1 -1
- package/xata-http/driver.d.cts +10 -16
- package/xata-http/driver.d.ts +11 -17
- package/xata-http/driver.js +91 -30
- package/xata-http/driver.js.map +1 -1
- package/xata-http/index.cjs +2 -4
- package/xata-http/index.d.cts +3 -3
- package/xata-http/index.d.ts +3 -3
- package/xata-http/index.js +3 -3
- package/xata-http/migrator.cjs +1 -1
- package/xata-http/migrator.cjs.map +1 -1
- package/xata-http/migrator.d.cts +1 -1
- package/xata-http/migrator.d.ts +1 -1
- package/xata-http/migrator.js +1 -1
- package/xata-http/migrator.js.map +1 -1
- package/xata-http/session.cjs +23 -109
- package/xata-http/session.cjs.map +1 -1
- package/xata-http/session.d.cts +7 -33
- package/xata-http/session.d.ts +6 -32
- package/xata-http/session.js +25 -109
- package/xata-http/session.js.map +1 -1
- package/pg-core/query-builders/_query.cjs +0 -101
- package/pg-core/query-builders/_query.cjs.map +0 -1
- package/pg-core/query-builders/_query.d.cts +0 -55
- package/pg-core/query-builders/_query.d.ts +0 -55
- package/pg-core/query-builders/_query.js +0 -97
- package/pg-core/query-builders/_query.js.map +0 -1
- package/pg-core/utils/array.cjs.map +0 -1
- package/pg-core/utils/array.js.map +0 -1
- package/pg-core/utils/index.cjs +0 -6
- package/pg-core/utils/index.d.cts +0 -2
- package/pg-core/utils/index.d.ts +0 -2
- package/pg-core/utils/index.js +0 -3
package/pglite/driver.d.ts
CHANGED
|
@@ -1,44 +1,39 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Codec } from "../codecs.js";
|
|
2
|
+
import { PgliteQueryResultHKT } from "./session.js";
|
|
2
3
|
import { entityKind } from "../entity.js";
|
|
3
|
-
import
|
|
4
|
-
import * as V1 from "../_relations.js";
|
|
4
|
+
import * as __utils_ts0 from "../utils.js";
|
|
5
5
|
import { Logger } from "../logger.js";
|
|
6
6
|
import { PgAsyncDatabase } from "../pg-core/async/db.js";
|
|
7
|
-
import
|
|
7
|
+
import * as __pg_core_codecs_ts0 from "../pg-core/codecs.js";
|
|
8
|
+
import { AnyRelations, EmptyRelations } from "../relations.js";
|
|
8
9
|
import { PGlite, PGliteOptions } from "@electric-sql/pglite";
|
|
9
10
|
import { Cache } from "../cache/core/cache.js";
|
|
10
|
-
import {
|
|
11
|
+
import { DrizzlePgConfig } from "../pg-core/utils.js";
|
|
11
12
|
|
|
12
13
|
//#region src/pglite/driver.d.ts
|
|
13
14
|
interface PgDriverOptions {
|
|
14
15
|
logger?: Logger;
|
|
15
16
|
cache?: Cache;
|
|
17
|
+
useJitMapper?: boolean;
|
|
16
18
|
}
|
|
17
|
-
declare class
|
|
18
|
-
private client;
|
|
19
|
-
private dialect;
|
|
20
|
-
private options;
|
|
21
|
-
static readonly [entityKind]: string;
|
|
22
|
-
constructor(client: PgliteClient, dialect: PgDialect, options?: PgDriverOptions);
|
|
23
|
-
createSession(relations: AnyRelations, schema: V1.RelationalSchemaConfig<V1.TablesRelationalConfig> | undefined): PgliteSession<Record<string, unknown>, AnyRelations, V1.TablesRelationalConfig>;
|
|
24
|
-
}
|
|
25
|
-
declare class PgliteDatabase<TSchema extends Record<string, unknown> = Record<string, never>, TRelations extends AnyRelations = EmptyRelations> extends PgAsyncDatabase<PgliteQueryResultHKT, TSchema, TRelations> {
|
|
19
|
+
declare class PgliteDatabase<TRelations extends AnyRelations = EmptyRelations> extends PgAsyncDatabase<PgliteQueryResultHKT, TRelations> {
|
|
26
20
|
static readonly [entityKind]: string;
|
|
27
21
|
}
|
|
28
|
-
declare
|
|
22
|
+
declare const pgliteCodecs: __utils_ts0.PartialWithUndefined<Record<__pg_core_codecs_ts0.PostgresType, Codec>>;
|
|
23
|
+
declare function drizzle<TRelations extends AnyRelations = EmptyRelations, TClient extends PGlite = PGlite>(...params: [] | [string] | [string, DrizzlePgConfig<TRelations>] | [(DrizzlePgConfig<TRelations> & ({
|
|
29
24
|
connection?: (PGliteOptions & {
|
|
30
25
|
dataDir?: string;
|
|
31
26
|
}) | string;
|
|
32
27
|
} | {
|
|
33
28
|
client: TClient;
|
|
34
|
-
}))]): PgliteDatabase<
|
|
29
|
+
}))]): PgliteDatabase<TRelations> & {
|
|
35
30
|
$client: TClient;
|
|
36
31
|
};
|
|
37
32
|
declare namespace drizzle {
|
|
38
|
-
function mock<
|
|
33
|
+
function mock<TRelations extends AnyRelations = EmptyRelations>(config?: DrizzlePgConfig<TRelations>): PgliteDatabase<TRelations> & {
|
|
39
34
|
$client: '$client is not available on drizzle.mock()';
|
|
40
35
|
};
|
|
41
36
|
}
|
|
42
37
|
//#endregion
|
|
43
|
-
export { PgDriverOptions, PgliteDatabase,
|
|
38
|
+
export { PgDriverOptions, PgliteDatabase, drizzle, pgliteCodecs };
|
|
44
39
|
//# sourceMappingURL=driver.d.ts.map
|
package/pglite/driver.js
CHANGED
|
@@ -1,48 +1,87 @@
|
|
|
1
1
|
import { PgliteSession } from "./session.js";
|
|
2
2
|
import { entityKind } from "../entity.js";
|
|
3
|
-
import
|
|
3
|
+
import { base64ToUint8Array } from "../utils.js";
|
|
4
4
|
import { DefaultLogger } from "../logger.js";
|
|
5
|
+
import { makePgArray } from "../pg-core/array.js";
|
|
5
6
|
import { PgAsyncDatabase } from "../pg-core/async/db.js";
|
|
7
|
+
import { arrayCompatNormalize, castToText, castToTextArr, genericPgCodecs, refineGenericPgCodecs } from "../pg-core/codecs.js";
|
|
6
8
|
import { PgDialect } from "../pg-core/dialect.js";
|
|
7
9
|
import { PGlite } from "@electric-sql/pglite";
|
|
8
10
|
|
|
9
11
|
//#region src/pglite/driver.ts
|
|
10
|
-
var PgliteDriver = class {
|
|
11
|
-
static [entityKind] = "PgliteDriver";
|
|
12
|
-
constructor(client, dialect, options = {}) {
|
|
13
|
-
this.client = client;
|
|
14
|
-
this.dialect = dialect;
|
|
15
|
-
this.options = options;
|
|
16
|
-
}
|
|
17
|
-
createSession(relations, schema) {
|
|
18
|
-
return new PgliteSession(this.client, this.dialect, relations, schema, {
|
|
19
|
-
logger: this.options.logger,
|
|
20
|
-
cache: this.options.cache
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
12
|
var PgliteDatabase = class extends PgAsyncDatabase {
|
|
25
13
|
static [entityKind] = "PgliteDatabase";
|
|
26
14
|
};
|
|
15
|
+
const pgliteCodecs = refineGenericPgCodecs({
|
|
16
|
+
bigint: {
|
|
17
|
+
cast: castToText,
|
|
18
|
+
castArray: castToTextArr
|
|
19
|
+
},
|
|
20
|
+
bigserial: {
|
|
21
|
+
cast: castToText,
|
|
22
|
+
castArray: castToTextArr
|
|
23
|
+
},
|
|
24
|
+
bytea: {
|
|
25
|
+
normalizeInJson: typeof Buffer === "undefined" ? base64ToUint8Array : genericPgCodecs.bytea?.normalizeInJson,
|
|
26
|
+
normalizeArrayInJson: typeof Buffer === "undefined" ? arrayCompatNormalize(base64ToUint8Array) : genericPgCodecs.bytea?.normalizeArrayInJson,
|
|
27
|
+
normalize: typeof Buffer === "undefined" ? genericPgCodecs.bytea?.normalize : (v) => Buffer.from(v),
|
|
28
|
+
normalizeArray: typeof Buffer === "undefined" ? genericPgCodecs.bytea?.normalizeArray : arrayCompatNormalize((v) => Buffer.from(v))
|
|
29
|
+
},
|
|
30
|
+
json: { normalizeParam: (v) => typeof v === "object" ? v : JSON.stringify(v) },
|
|
31
|
+
jsonb: { normalizeParam: (v) => typeof v === "object" ? v : JSON.stringify(v) },
|
|
32
|
+
geometry: {
|
|
33
|
+
castParam: (name) => `${name}::geometry`,
|
|
34
|
+
castArrayParam: (name, dimensions) => `${name}::geometry${"[]".repeat(dimensions)}`,
|
|
35
|
+
normalizeParamArray: makePgArray
|
|
36
|
+
},
|
|
37
|
+
bit: { normalizeArray: void 0 },
|
|
38
|
+
halfvec: {
|
|
39
|
+
castParam: (name) => `${name}::halfvec`,
|
|
40
|
+
castArrayParam: (name, dimensions) => `${name}::halfvec${"[]".repeat(dimensions)}`,
|
|
41
|
+
normalizeParamArray: makePgArray
|
|
42
|
+
},
|
|
43
|
+
vector: {
|
|
44
|
+
castParam: (name) => `${name}::vector`,
|
|
45
|
+
castArrayParam: (name, dimensions) => `${name}::vector${"[]".repeat(dimensions)}`,
|
|
46
|
+
normalizeParamArray: makePgArray
|
|
47
|
+
},
|
|
48
|
+
sparsevec: {
|
|
49
|
+
castParam: (name) => `${name}::sparsevec`,
|
|
50
|
+
castArrayParam: (name, dimensions) => `${name}::sparsevec${"[]".repeat(dimensions)}`,
|
|
51
|
+
normalizeParamArray: makePgArray
|
|
52
|
+
},
|
|
53
|
+
point: {
|
|
54
|
+
cast: void 0,
|
|
55
|
+
castArray: void 0,
|
|
56
|
+
castInJson: void 0,
|
|
57
|
+
castArrayInJson: void 0
|
|
58
|
+
},
|
|
59
|
+
line: {
|
|
60
|
+
cast: void 0,
|
|
61
|
+
castArray: void 0,
|
|
62
|
+
castInJson: void 0,
|
|
63
|
+
castArrayInJson: void 0
|
|
64
|
+
},
|
|
65
|
+
macaddr8: {
|
|
66
|
+
castArrayInJson: void 0,
|
|
67
|
+
castArray: void 0
|
|
68
|
+
}
|
|
69
|
+
});
|
|
27
70
|
function construct(client, config = {}) {
|
|
28
|
-
const dialect = new PgDialect({
|
|
71
|
+
const dialect = new PgDialect({
|
|
72
|
+
casing: config.casing,
|
|
73
|
+
useJitMappers: config.useJitMappers,
|
|
74
|
+
codecs: config.codecs ?? pgliteCodecs
|
|
75
|
+
});
|
|
29
76
|
let logger;
|
|
30
77
|
if (config.logger === true) logger = new DefaultLogger();
|
|
31
78
|
else if (config.logger !== false) logger = config.logger;
|
|
32
|
-
let schema;
|
|
33
|
-
if (config.schema) {
|
|
34
|
-
const tablesConfig = V1.extractTablesRelationalConfig(config.schema, V1.createTableRelationsHelpers);
|
|
35
|
-
schema = {
|
|
36
|
-
fullSchema: config.schema,
|
|
37
|
-
schema: tablesConfig.tables,
|
|
38
|
-
tableNamesMap: tablesConfig.tableNamesMap
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
79
|
const relations = config.relations ?? {};
|
|
42
|
-
const db = new PgliteDatabase(dialect, new
|
|
80
|
+
const db = new PgliteDatabase(dialect, new PgliteSession(client, dialect, relations, {
|
|
43
81
|
logger,
|
|
82
|
+
useJitMapper: config.useJitMappers ?? false,
|
|
44
83
|
cache: config.cache
|
|
45
|
-
})
|
|
84
|
+
}), relations);
|
|
46
85
|
db.$client = client;
|
|
47
86
|
db.$cache = config.cache;
|
|
48
87
|
if (db.$cache) db.$cache["invalidate"] = config.cache?.onMutate;
|
|
@@ -50,13 +89,13 @@ function construct(client, config = {}) {
|
|
|
50
89
|
}
|
|
51
90
|
function drizzle(...params) {
|
|
52
91
|
if (params[0] === void 0 || typeof params[0] === "string") return construct(new PGlite(params[0]), params[1]);
|
|
53
|
-
const { connection, client, ...
|
|
54
|
-
if (client) return construct(client,
|
|
92
|
+
const { connection, client, ...DrizzlePgConfig } = params[0];
|
|
93
|
+
if (client) return construct(client, DrizzlePgConfig);
|
|
55
94
|
if (typeof connection === "object") {
|
|
56
95
|
const { dataDir, ...options } = connection;
|
|
57
|
-
return construct(new PGlite(dataDir, options),
|
|
96
|
+
return construct(new PGlite(dataDir, options), DrizzlePgConfig);
|
|
58
97
|
}
|
|
59
|
-
return construct(new PGlite(connection),
|
|
98
|
+
return construct(new PGlite(connection), DrizzlePgConfig);
|
|
60
99
|
}
|
|
61
100
|
(function(_drizzle) {
|
|
62
101
|
function mock(config) {
|
|
@@ -66,5 +105,5 @@ function drizzle(...params) {
|
|
|
66
105
|
})(drizzle || (drizzle = {}));
|
|
67
106
|
|
|
68
107
|
//#endregion
|
|
69
|
-
export { PgliteDatabase,
|
|
108
|
+
export { PgliteDatabase, drizzle, pgliteCodecs };
|
|
70
109
|
//# sourceMappingURL=driver.js.map
|
package/pglite/driver.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.js","names":[],"sources":["../../src/pglite/driver.ts"],"sourcesContent":["import { PGlite, type PGliteOptions } from '@electric-sql/pglite';\nimport
|
|
1
|
+
{"version":3,"file":"driver.js","names":[],"sources":["../../src/pglite/driver.ts"],"sourcesContent":["import { PGlite, type PGliteOptions } from '@electric-sql/pglite';\nimport type { Cache } from '~/cache/core/cache.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { Logger } from '~/logger.ts';\nimport { DefaultLogger } from '~/logger.ts';\nimport { makePgArray } from '~/pg-core/array.ts';\nimport { PgAsyncDatabase } from '~/pg-core/async/db.ts';\nimport {\n\tarrayCompatNormalize,\n\tcastToText,\n\tcastToTextArr,\n\tgenericPgCodecs,\n\trefineGenericPgCodecs,\n} from '~/pg-core/codecs.ts';\nimport { PgDialect } from '~/pg-core/dialect.ts';\nimport type { DrizzlePgConfig } from '~/pg-core/utils.ts';\nimport type { AnyRelations, EmptyRelations } from '~/relations.ts';\nimport { base64ToUint8Array } from '~/utils.ts';\nimport type { PgliteClient, PgliteQueryResultHKT } from './session.ts';\nimport { PgliteSession } from './session.ts';\n\nexport interface PgDriverOptions {\n\tlogger?: Logger;\n\tcache?: Cache;\n\tuseJitMapper?: boolean;\n}\n\nexport class PgliteDatabase<\n\tTRelations extends AnyRelations = EmptyRelations,\n> extends PgAsyncDatabase<PgliteQueryResultHKT, TRelations> {\n\tstatic override readonly [entityKind]: string = 'PgliteDatabase';\n}\n\nexport const pgliteCodecs = refineGenericPgCodecs({\n\tbigint: {\n\t\tcast: castToText,\n\t\tcastArray: castToTextArr,\n\t},\n\tbigserial: {\n\t\tcast: castToText,\n\t\tcastArray: castToTextArr,\n\t},\n\tbytea: {\n\t\tnormalizeInJson: typeof Buffer === 'undefined' ? base64ToUint8Array : genericPgCodecs.bytea?.normalizeInJson,\n\t\tnormalizeArrayInJson: typeof Buffer === 'undefined'\n\t\t\t? arrayCompatNormalize(base64ToUint8Array)\n\t\t\t: genericPgCodecs.bytea?.normalizeArrayInJson,\n\t\tnormalize: typeof Buffer === 'undefined'\n\t\t\t? genericPgCodecs.bytea?.normalize\n\t\t\t: (v: Uint8Array) => Buffer.from(v),\n\t\tnormalizeArray: typeof Buffer === 'undefined'\n\t\t\t? genericPgCodecs.bytea?.normalizeArray\n\t\t\t: arrayCompatNormalize((v: Uint8Array) => Buffer.from(v)),\n\t},\n\tjson: {\n\t\tnormalizeParam: (v) => typeof v === 'object' ? v : JSON.stringify(v),\n\t},\n\tjsonb: {\n\t\tnormalizeParam: (v) => typeof v === 'object' ? v : JSON.stringify(v),\n\t},\n\tgeometry: {\n\t\tcastParam: (name) => `${name}::geometry`,\n\t\tcastArrayParam: (name, dimensions) => `${name}::geometry${'[]'.repeat(dimensions)}`,\n\t\tnormalizeParamArray: makePgArray,\n\t},\n\tbit: {\n\t\tnormalizeArray: undefined,\n\t},\n\thalfvec: {\n\t\tcastParam: (name) => `${name}::halfvec`,\n\t\tcastArrayParam: (name, dimensions) => `${name}::halfvec${'[]'.repeat(dimensions)}`,\n\t\tnormalizeParamArray: makePgArray,\n\t},\n\tvector: {\n\t\tcastParam: (name) => `${name}::vector`,\n\t\tcastArrayParam: (name, dimensions) => `${name}::vector${'[]'.repeat(dimensions)}`,\n\t\tnormalizeParamArray: makePgArray,\n\t},\n\tsparsevec: {\n\t\tcastParam: (name) => `${name}::sparsevec`,\n\t\tcastArrayParam: (name, dimensions) => `${name}::sparsevec${'[]'.repeat(dimensions)}`,\n\t\tnormalizeParamArray: makePgArray,\n\t},\n\tpoint: {\n\t\tcast: undefined,\n\t\tcastArray: undefined,\n\t\tcastInJson: undefined,\n\t\tcastArrayInJson: undefined,\n\t},\n\tline: {\n\t\tcast: undefined,\n\t\tcastArray: undefined,\n\t\tcastInJson: undefined,\n\t\tcastArrayInJson: undefined,\n\t},\n\tmacaddr8: {\n\t\tcastArrayInJson: undefined,\n\t\tcastArray: undefined,\n\t},\n});\n\nfunction construct<TRelations extends AnyRelations = EmptyRelations>(\n\tclient: PgliteClient,\n\tconfig: DrizzlePgConfig<TRelations> = {},\n): PgliteDatabase<TRelations> & {\n\t$client: PgliteClient;\n} {\n\tconst dialect = new PgDialect({\n\t\tcasing: config.casing,\n\t\tuseJitMappers: config.useJitMappers,\n\t\tcodecs: config.codecs ?? pgliteCodecs,\n\t});\n\tlet logger;\n\tif (config.logger === true) {\n\t\tlogger = new DefaultLogger();\n\t} else if (config.logger !== false) {\n\t\tlogger = config.logger;\n\t}\n\n\tconst relations = config.relations ?? {} as TRelations;\n\tconst session = new PgliteSession(client, dialect, relations, {\n\t\tlogger,\n\t\tuseJitMapper: config.useJitMappers ?? false,\n\t\tcache: config.cache,\n\t});\n\tconst db = new PgliteDatabase(\n\t\tdialect,\n\t\tsession,\n\t\trelations,\n\t) as PgliteDatabase<TRelations>;\n\t(<any> db).$client = client;\n\t(<any> db).$cache = config.cache;\n\tif ((<any> db).$cache) {\n\t\t(<any> db).$cache['invalidate'] = config.cache?.onMutate;\n\t}\n\t// (<any> db).$cache = { invalidate: (<any> config).cache?.onMutate };\n\t// if (config.cache) {\n\t// \tfor (\n\t// \t\tconst key of Object.getOwnPropertyNames(Object.getPrototypeOf(config.cache)).filter((key) =>\n\t// \t\t\tkey !== 'constructor'\n\t// \t\t)\n\t// \t) {\n\t// \t\t(<any> db).$cache[key as keyof typeof config.cache] = (<any> config).cache[key];\n\t// \t}\n\t// }\n\n\treturn db as any;\n}\n\nexport function drizzle<\n\tTRelations extends AnyRelations = EmptyRelations,\n\tTClient extends PGlite = PGlite,\n>(\n\t...params:\n\t\t| []\n\t\t| [\n\t\t\tstring,\n\t\t]\n\t\t| [\n\t\t\tstring,\n\t\t\tDrizzlePgConfig<TRelations>,\n\t\t]\n\t\t| [\n\t\t\t(\n\t\t\t\t& DrizzlePgConfig<TRelations>\n\t\t\t\t& ({\n\t\t\t\t\tconnection?: (PGliteOptions & { dataDir?: string }) | string;\n\t\t\t\t} | {\n\t\t\t\t\tclient: TClient;\n\t\t\t\t})\n\t\t\t),\n\t\t]\n): PgliteDatabase<TRelations> & {\n\t$client: TClient;\n} {\n\tif (params[0] === undefined || typeof params[0] === 'string') {\n\t\tconst instance = new PGlite(params[0]);\n\t\treturn construct(instance, params[1]) as any;\n\t}\n\n\tconst { connection, client, ...DrizzlePgConfig } = params[0] as\n\t\t& {\n\t\t\tconnection?: PGliteOptions & { dataDir: string };\n\t\t\tclient?: TClient;\n\t\t}\n\t\t& DrizzlePgConfig<TRelations>;\n\n\tif (client) return construct(client, DrizzlePgConfig) as any;\n\n\tif (typeof connection === 'object') {\n\t\tconst { dataDir, ...options } = connection;\n\n\t\tconst instance = new PGlite(dataDir, options);\n\n\t\treturn construct(instance, DrizzlePgConfig) as any;\n\t}\n\n\tconst instance = new PGlite(connection);\n\n\treturn construct(instance, DrizzlePgConfig) as any;\n}\n\nexport namespace drizzle {\n\texport function mock<\n\t\tTRelations extends AnyRelations = EmptyRelations,\n\t>(\n\t\tconfig?: DrizzlePgConfig<TRelations>,\n\t): PgliteDatabase<TRelations> & {\n\t\t$client: '$client is not available on drizzle.mock()';\n\t} {\n\t\treturn construct({} as any, config) as any;\n\t}\n}\n"],"mappings":";;;;;;;;;;;AA2BA,IAAa,iBAAb,cAEU,gBAAkD;CAC3D,QAA0B,cAAsB;;AAGjD,MAAa,eAAe,sBAAsB;CACjD,QAAQ;EACP,MAAM;EACN,WAAW;EACX;CACD,WAAW;EACV,MAAM;EACN,WAAW;EACX;CACD,OAAO;EACN,iBAAiB,OAAO,WAAW,cAAc,qBAAqB,gBAAgB,OAAO;EAC7F,sBAAsB,OAAO,WAAW,cACrC,qBAAqB,mBAAmB,GACxC,gBAAgB,OAAO;EAC1B,WAAW,OAAO,WAAW,cAC1B,gBAAgB,OAAO,aACtB,MAAkB,OAAO,KAAK,EAAE;EACpC,gBAAgB,OAAO,WAAW,cAC/B,gBAAgB,OAAO,iBACvB,sBAAsB,MAAkB,OAAO,KAAK,EAAE,CAAC;EAC1D;CACD,MAAM,EACL,iBAAiB,MAAM,OAAO,MAAM,WAAW,IAAI,KAAK,UAAU,EAAE,EACpE;CACD,OAAO,EACN,iBAAiB,MAAM,OAAO,MAAM,WAAW,IAAI,KAAK,UAAU,EAAE,EACpE;CACD,UAAU;EACT,YAAY,SAAS,GAAG,KAAK;EAC7B,iBAAiB,MAAM,eAAe,GAAG,KAAK,YAAY,KAAK,OAAO,WAAW;EACjF,qBAAqB;EACrB;CACD,KAAK,EACJ,gBAAgB,QAChB;CACD,SAAS;EACR,YAAY,SAAS,GAAG,KAAK;EAC7B,iBAAiB,MAAM,eAAe,GAAG,KAAK,WAAW,KAAK,OAAO,WAAW;EAChF,qBAAqB;EACrB;CACD,QAAQ;EACP,YAAY,SAAS,GAAG,KAAK;EAC7B,iBAAiB,MAAM,eAAe,GAAG,KAAK,UAAU,KAAK,OAAO,WAAW;EAC/E,qBAAqB;EACrB;CACD,WAAW;EACV,YAAY,SAAS,GAAG,KAAK;EAC7B,iBAAiB,MAAM,eAAe,GAAG,KAAK,aAAa,KAAK,OAAO,WAAW;EAClF,qBAAqB;EACrB;CACD,OAAO;EACN,MAAM;EACN,WAAW;EACX,YAAY;EACZ,iBAAiB;EACjB;CACD,MAAM;EACL,MAAM;EACN,WAAW;EACX,YAAY;EACZ,iBAAiB;EACjB;CACD,UAAU;EACT,iBAAiB;EACjB,WAAW;EACX;CACD,CAAC;AAEF,SAAS,UACR,QACA,SAAsC,EAAE,EAGvC;CACD,MAAM,UAAU,IAAI,UAAU;EAC7B,QAAQ,OAAO;EACf,eAAe,OAAO;EACtB,QAAQ,OAAO,UAAU;EACzB,CAAC;CACF,IAAI;AACJ,KAAI,OAAO,WAAW,KACrB,UAAS,IAAI,eAAe;UAClB,OAAO,WAAW,MAC5B,UAAS,OAAO;CAGjB,MAAM,YAAY,OAAO,aAAa,EAAE;CAMxC,MAAM,KAAK,IAAI,eACd,SANe,IAAI,cAAc,QAAQ,SAAS,WAAW;EAC7D;EACA,cAAc,OAAO,iBAAiB;EACtC,OAAO,OAAO;EACd,CAAC,EAID,UACA;AACD,CAAO,GAAI,UAAU;AACrB,CAAO,GAAI,SAAS,OAAO;AAC3B,KAAW,GAAI,OACd,CAAO,GAAI,OAAO,gBAAgB,OAAO,OAAO;AAajD,QAAO;;AAGR,SAAgB,QAIf,GAAG,QAqBF;AACD,KAAI,OAAO,OAAO,UAAa,OAAO,OAAO,OAAO,SAEnD,QAAO,UADU,IAAI,OAAO,OAAO,GAAG,EACX,OAAO,GAAG;CAGtC,MAAM,EAAE,YAAY,QAAQ,GAAG,oBAAoB,OAAO;AAO1D,KAAI,OAAQ,QAAO,UAAU,QAAQ,gBAAgB;AAErD,KAAI,OAAO,eAAe,UAAU;EACnC,MAAM,EAAE,SAAS,GAAG,YAAY;AAIhC,SAAO,UAFU,IAAI,OAAO,SAAS,QAAQ,EAElB,gBAAgB;;AAK5C,QAAO,UAFU,IAAI,OAAO,WAAW,EAEZ,gBAAgB;;;CAIpC,SAAS,KAGf,QAGC;AACD,SAAO,UAAU,EAAE,EAAS,OAAO"}
|
package/pglite/index.cjs
CHANGED
|
@@ -3,8 +3,6 @@ const require_pglite_session = require('./session.cjs');
|
|
|
3
3
|
const require_pglite_driver = require('./driver.cjs');
|
|
4
4
|
|
|
5
5
|
exports.PgliteDatabase = require_pglite_driver.PgliteDatabase;
|
|
6
|
-
exports.PgliteDriver = require_pglite_driver.PgliteDriver;
|
|
7
|
-
exports.PglitePreparedQuery = require_pglite_session.PglitePreparedQuery;
|
|
8
6
|
exports.PgliteSession = require_pglite_session.PgliteSession;
|
|
9
7
|
exports.PgliteTransaction = require_pglite_session.PgliteTransaction;
|
|
10
8
|
Object.defineProperty(exports, 'drizzle', {
|
|
@@ -12,4 +10,5 @@ Object.defineProperty(exports, 'drizzle', {
|
|
|
12
10
|
get: function () {
|
|
13
11
|
return require_pglite_driver.drizzle;
|
|
14
12
|
}
|
|
15
|
-
});
|
|
13
|
+
});
|
|
14
|
+
exports.pgliteCodecs = require_pglite_driver.pgliteCodecs;
|
package/pglite/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { PgliteClient,
|
|
2
|
-
import { PgDriverOptions, PgliteDatabase,
|
|
3
|
-
export { PgDriverOptions, PgliteClient, PgliteDatabase,
|
|
1
|
+
import { PgliteClient, PgliteQueryResultHKT, PgliteSession, PgliteSessionOptions, PgliteTransaction } from "./session.cjs";
|
|
2
|
+
import { PgDriverOptions, PgliteDatabase, drizzle, pgliteCodecs } from "./driver.cjs";
|
|
3
|
+
export { PgDriverOptions, PgliteClient, PgliteDatabase, PgliteQueryResultHKT, PgliteSession, PgliteSessionOptions, PgliteTransaction, drizzle, pgliteCodecs };
|
package/pglite/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { PgliteClient,
|
|
2
|
-
import { PgDriverOptions, PgliteDatabase,
|
|
3
|
-
export { PgDriverOptions, PgliteClient, PgliteDatabase,
|
|
1
|
+
import { PgliteClient, PgliteQueryResultHKT, PgliteSession, PgliteSessionOptions, PgliteTransaction } from "./session.js";
|
|
2
|
+
import { PgDriverOptions, PgliteDatabase, drizzle, pgliteCodecs } from "./driver.js";
|
|
3
|
+
export { PgDriverOptions, PgliteClient, PgliteDatabase, PgliteQueryResultHKT, PgliteSession, PgliteSessionOptions, PgliteTransaction, drizzle, pgliteCodecs };
|
package/pglite/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PgliteDatabase,
|
|
1
|
+
import { PgliteSession, PgliteTransaction } from "./session.js";
|
|
2
|
+
import { PgliteDatabase, drizzle, pgliteCodecs } from "./driver.js";
|
|
3
3
|
|
|
4
|
-
export { PgliteDatabase,
|
|
4
|
+
export { PgliteDatabase, PgliteSession, PgliteTransaction, drizzle, pgliteCodecs };
|
package/pglite/migrator.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrator.cjs","names":[],"sources":["../../src/pglite/migrator.ts"],"sourcesContent":["import type { MigrationConfig } from '~/migrator.ts';\nimport { readMigrationFiles } from '~/migrator.ts';\nimport { migrate as coreMigrate } from '~/pg-core/async/session.ts';\nimport type { AnyRelations } from '~/relations.ts';\nimport type { PgliteDatabase } from './driver.ts';\n\nexport async function migrate<
|
|
1
|
+
{"version":3,"file":"migrator.cjs","names":[],"sources":["../../src/pglite/migrator.ts"],"sourcesContent":["import type { MigrationConfig } from '~/migrator.ts';\nimport { readMigrationFiles } from '~/migrator.ts';\nimport { migrate as coreMigrate } from '~/pg-core/async/session.ts';\nimport type { AnyRelations } from '~/relations.ts';\nimport type { PgliteDatabase } from './driver.ts';\n\nexport async function migrate<TRelations extends AnyRelations>(\n\tdb: PgliteDatabase<TRelations>,\n\tconfig: MigrationConfig,\n) {\n\tconst migrations = readMigrationFiles(config);\n\treturn await coreMigrate(migrations, db, config);\n}\n"],"mappings":";;;;;;AAMA,eAAsB,QACrB,IACA,QACC;AAED,QAAO,oFAD+B,OAAO,EACR,IAAI,OAAO"}
|
package/pglite/migrator.d.cts
CHANGED
|
@@ -4,7 +4,7 @@ import { MigrationConfig } from "../migrator.cjs";
|
|
|
4
4
|
import { AnyRelations } from "../relations.cjs";
|
|
5
5
|
|
|
6
6
|
//#region src/pglite/migrator.d.ts
|
|
7
|
-
declare function migrate<
|
|
7
|
+
declare function migrate<TRelations extends AnyRelations>(db: PgliteDatabase<TRelations>, config: MigrationConfig): Promise<void | __migrator_ts0.MigratorInitFailResponse>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { migrate };
|
|
10
10
|
//# sourceMappingURL=migrator.d.cts.map
|
package/pglite/migrator.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { MigrationConfig } from "../migrator.js";
|
|
|
4
4
|
import { AnyRelations } from "../relations.js";
|
|
5
5
|
|
|
6
6
|
//#region src/pglite/migrator.d.ts
|
|
7
|
-
declare function migrate<
|
|
7
|
+
declare function migrate<TRelations extends AnyRelations>(db: PgliteDatabase<TRelations>, config: MigrationConfig): Promise<void | __migrator_ts0.MigratorInitFailResponse>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { migrate };
|
|
10
10
|
//# sourceMappingURL=migrator.d.ts.map
|
package/pglite/migrator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrator.js","names":["coreMigrate"],"sources":["../../src/pglite/migrator.ts"],"sourcesContent":["import type { MigrationConfig } from '~/migrator.ts';\nimport { readMigrationFiles } from '~/migrator.ts';\nimport { migrate as coreMigrate } from '~/pg-core/async/session.ts';\nimport type { AnyRelations } from '~/relations.ts';\nimport type { PgliteDatabase } from './driver.ts';\n\nexport async function migrate<
|
|
1
|
+
{"version":3,"file":"migrator.js","names":["coreMigrate"],"sources":["../../src/pglite/migrator.ts"],"sourcesContent":["import type { MigrationConfig } from '~/migrator.ts';\nimport { readMigrationFiles } from '~/migrator.ts';\nimport { migrate as coreMigrate } from '~/pg-core/async/session.ts';\nimport type { AnyRelations } from '~/relations.ts';\nimport type { PgliteDatabase } from './driver.ts';\n\nexport async function migrate<TRelations extends AnyRelations>(\n\tdb: PgliteDatabase<TRelations>,\n\tconfig: MigrationConfig,\n) {\n\tconst migrations = readMigrationFiles(config);\n\treturn await coreMigrate(migrations, db, config);\n}\n"],"mappings":";;;;AAMA,eAAsB,QACrB,IACA,QACC;AAED,QAAO,MAAMA,UADM,mBAAmB,OAAO,EACR,IAAI,OAAO"}
|
package/pglite/session.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
let __entity_ts = require("../entity.cjs");
|
|
4
|
-
let __utils_ts = require("../utils.cjs");
|
|
5
4
|
let __sql_sql_ts = require("../sql/sql.cjs");
|
|
6
5
|
let __logger_ts = require("../logger.cjs");
|
|
7
6
|
let __pg_core_async_session_ts = require("../pg-core/async/session.cjs");
|
|
@@ -9,101 +8,42 @@ let _electric_sql_pglite = require("@electric-sql/pglite");
|
|
|
9
8
|
let __cache_core_cache_ts = require("../cache/core/cache.cjs");
|
|
10
9
|
|
|
11
10
|
//#region src/pglite/session.ts
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
this.customResultMapper = customResultMapper;
|
|
23
|
-
this.isRqbV2Query = isRqbV2Query;
|
|
24
|
-
this.rawQueryConfig = {
|
|
25
|
-
rowMode: "object",
|
|
26
|
-
parsers: {
|
|
27
|
-
[_electric_sql_pglite.types.TIMESTAMP]: (value) => value,
|
|
28
|
-
[_electric_sql_pglite.types.TIMESTAMPTZ]: (value) => value,
|
|
29
|
-
[_electric_sql_pglite.types.INTERVAL]: (value) => value,
|
|
30
|
-
[_electric_sql_pglite.types.DATE]: (value) => value,
|
|
31
|
-
[1231]: (value) => value,
|
|
32
|
-
[1115]: (value) => value,
|
|
33
|
-
[1185]: (value) => value,
|
|
34
|
-
[1187]: (value) => value,
|
|
35
|
-
[1182]: (value) => value
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
this.queryConfig = {
|
|
39
|
-
rowMode: "array",
|
|
40
|
-
parsers: {
|
|
41
|
-
[_electric_sql_pglite.types.TIMESTAMP]: (value) => value,
|
|
42
|
-
[_electric_sql_pglite.types.TIMESTAMPTZ]: (value) => value,
|
|
43
|
-
[_electric_sql_pglite.types.INTERVAL]: (value) => value,
|
|
44
|
-
[_electric_sql_pglite.types.DATE]: (value) => value,
|
|
45
|
-
[1231]: (value) => value,
|
|
46
|
-
[1115]: (value) => value,
|
|
47
|
-
[1185]: (value) => value,
|
|
48
|
-
[1187]: (value) => value,
|
|
49
|
-
[1182]: (value) => value
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
async execute(placeholderValues = {}) {
|
|
54
|
-
if (this.isRqbV2Query) return this.executeRqbV2(placeholderValues);
|
|
55
|
-
const params = (0, __sql_sql_ts.fillPlaceholders)(this.query.params, placeholderValues);
|
|
56
|
-
this.logger.logQuery(this.query.sql, params);
|
|
57
|
-
const { fields, client, queryConfig, joinsNotNullableMap, customResultMapper, query, rawQueryConfig } = this;
|
|
58
|
-
if (!fields && !customResultMapper) return this.queryWithCache(query.sql, params, async () => {
|
|
59
|
-
return await client.query(query.sql, params, rawQueryConfig);
|
|
60
|
-
});
|
|
61
|
-
const result = await this.queryWithCache(query.sql, params, async () => {
|
|
62
|
-
return await client.query(query.sql, params, queryConfig);
|
|
63
|
-
});
|
|
64
|
-
return customResultMapper ? customResultMapper(result.rows) : result.rows.map((row) => (0, __utils_ts.mapResultRow)(fields, row, joinsNotNullableMap));
|
|
65
|
-
}
|
|
66
|
-
async executeRqbV2(placeholderValues = {}) {
|
|
67
|
-
const params = (0, __sql_sql_ts.fillPlaceholders)(this.query.params, placeholderValues);
|
|
68
|
-
this.logger.logQuery(this.query.sql, params);
|
|
69
|
-
const { rawQueryConfig, client, customResultMapper, query } = this;
|
|
70
|
-
return customResultMapper((await client.query(query.sql, params, rawQueryConfig)).rows);
|
|
71
|
-
}
|
|
72
|
-
all(placeholderValues = {}) {
|
|
73
|
-
const params = (0, __sql_sql_ts.fillPlaceholders)(this.query.params, placeholderValues);
|
|
74
|
-
this.logger.logQuery(this.query.sql, params);
|
|
75
|
-
return this.queryWithCache(this.query.sql, params, async () => {
|
|
76
|
-
return await this.client.query(this.query.sql, params, this.rawQueryConfig);
|
|
77
|
-
}).then((result) => result.rows);
|
|
78
|
-
}
|
|
79
|
-
/** @internal */
|
|
80
|
-
isResponseInArrayMode() {
|
|
81
|
-
return this._isResponseInArrayMode;
|
|
82
|
-
}
|
|
11
|
+
const parsers = {
|
|
12
|
+
[_electric_sql_pglite.types.TIMESTAMP]: (value) => value,
|
|
13
|
+
[_electric_sql_pglite.types.TIMESTAMPTZ]: (value) => value,
|
|
14
|
+
[_electric_sql_pglite.types.INTERVAL]: (value) => value,
|
|
15
|
+
[_electric_sql_pglite.types.DATE]: (value) => value,
|
|
16
|
+
[1231]: (value) => value,
|
|
17
|
+
[1115]: (value) => value,
|
|
18
|
+
[1185]: (value) => value,
|
|
19
|
+
[1187]: (value) => value,
|
|
20
|
+
[1182]: (value) => value
|
|
83
21
|
};
|
|
84
22
|
var PgliteSession = class PgliteSession extends __pg_core_async_session_ts.PgAsyncSession {
|
|
85
23
|
static [__entity_ts.entityKind] = "PgliteSession";
|
|
86
24
|
logger;
|
|
87
25
|
cache;
|
|
88
|
-
constructor(client, dialect, relations,
|
|
26
|
+
constructor(client, dialect, relations, options = {}) {
|
|
89
27
|
super(dialect);
|
|
90
28
|
this.client = client;
|
|
91
29
|
this.relations = relations;
|
|
92
|
-
this.schema = schema;
|
|
93
30
|
this.options = options;
|
|
94
31
|
this.logger = options.logger ?? new __logger_ts.NoopLogger();
|
|
95
32
|
this.cache = options.cache ?? new __cache_core_cache_ts.NoopCache();
|
|
96
33
|
}
|
|
97
|
-
prepareQuery(query,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
34
|
+
prepareQuery(query, mode, _name, mapper, queryMetadata, cacheConfig) {
|
|
35
|
+
const executor = async (params) => {
|
|
36
|
+
return this.client.query(query.sql, params, {
|
|
37
|
+
rowMode: mode === "arrays" ? "array" : "object",
|
|
38
|
+
parsers
|
|
39
|
+
}).then((r) => mode === "raw" ? r : r.rows);
|
|
40
|
+
};
|
|
41
|
+
return new __pg_core_async_session_ts.PgAsyncPreparedQuery(executor, query, mapper, mode, this.logger, this.cache, queryMetadata, cacheConfig);
|
|
102
42
|
}
|
|
103
43
|
async transaction(transaction, config) {
|
|
104
44
|
return this.client.transaction(async (client) => {
|
|
105
|
-
const session = new PgliteSession(client, this.dialect, this.relations, this.
|
|
106
|
-
const tx = new PgliteTransaction(this.dialect, session, this.relations,
|
|
45
|
+
const session = new PgliteSession(client, this.dialect, this.relations, this.options);
|
|
46
|
+
const tx = new PgliteTransaction(this.dialect, session, this.relations, void 0, false);
|
|
107
47
|
if (config) await tx.setTransaction(config);
|
|
108
48
|
return transaction(tx);
|
|
109
49
|
});
|
|
@@ -111,9 +51,9 @@ var PgliteSession = class PgliteSession extends __pg_core_async_session_ts.PgAsy
|
|
|
111
51
|
};
|
|
112
52
|
var PgliteTransaction = class PgliteTransaction extends __pg_core_async_session_ts.PgAsyncTransaction {
|
|
113
53
|
static [__entity_ts.entityKind] = "PgliteTransaction";
|
|
114
|
-
async
|
|
54
|
+
transaction = async (transaction) => {
|
|
115
55
|
const savepointName = `sp${this.nestedIndex + 1}`;
|
|
116
|
-
const tx = new PgliteTransaction(this.dialect, this.session, this.relations, this.
|
|
56
|
+
const tx = new PgliteTransaction(this.dialect, this.session, this._.relations, this.nestedIndex + 1, false);
|
|
117
57
|
await tx.execute(__sql_sql_ts.sql.raw(`savepoint ${savepointName}`));
|
|
118
58
|
try {
|
|
119
59
|
const result = await transaction(tx);
|
|
@@ -123,11 +63,10 @@ var PgliteTransaction = class PgliteTransaction extends __pg_core_async_session_
|
|
|
123
63
|
await tx.execute(__sql_sql_ts.sql.raw(`rollback to savepoint ${savepointName}`));
|
|
124
64
|
throw err;
|
|
125
65
|
}
|
|
126
|
-
}
|
|
66
|
+
};
|
|
127
67
|
};
|
|
128
68
|
|
|
129
69
|
//#endregion
|
|
130
|
-
exports.PglitePreparedQuery = PglitePreparedQuery;
|
|
131
70
|
exports.PgliteSession = PgliteSession;
|
|
132
71
|
exports.PgliteTransaction = PgliteTransaction;
|
|
133
72
|
//# sourceMappingURL=session.cjs.map
|
package/pglite/session.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.cjs","names":["PgAsyncPreparedQuery","entityKind","types","PgAsyncSession","NoopLogger","NoopCache","PgAsyncTransaction","sql"],"sources":["../../src/pglite/session.ts"],"sourcesContent":["import type { PGlite, QueryOptions, Results, Row, Transaction } from '@electric-sql/pglite';\nimport type * as V1 from '~/_relations.ts';\nimport { entityKind } from '~/entity.ts';\nimport { type Logger, NoopLogger } from '~/logger.ts';\nimport { PgAsyncPreparedQuery, PgAsyncSession } from '~/pg-core/async/session.ts';\nimport { PgAsyncTransaction } from '~/pg-core/async/session.ts';\nimport type { PgDialect } from '~/pg-core/dialect.ts';\nimport type { SelectedFieldsOrdered } from '~/pg-core/query-builders/select.types.ts';\nimport type { PgQueryResultHKT, PgTransactionConfig, PreparedQueryConfig } from '~/pg-core/session.ts';\nimport { fillPlaceholders, type Query, sql } from '~/sql/sql.ts';\nimport { type Assume, mapResultRow } from '~/utils.ts';\n\nimport { types } from '@electric-sql/pglite';\nimport { type Cache, NoopCache } from '~/cache/core/cache.ts';\nimport type { WithCacheConfig } from '~/cache/core/types.ts';\nimport type { AnyRelations } from '~/relations.ts';\n\nexport type PgliteClient = PGlite;\n\nexport class PglitePreparedQuery<T extends PreparedQueryConfig, TIsRqbV2 extends boolean = false>\n\textends PgAsyncPreparedQuery<T>\n{\n\tstatic override readonly [entityKind]: string = 'PglitePreparedQuery';\n\n\tprivate rawQueryConfig: QueryOptions;\n\tprivate queryConfig: QueryOptions;\n\n\tconstructor(\n\t\tprivate client: PgliteClient | Transaction,\n\t\tquery: Query,\n\t\tprivate logger: Logger,\n\t\tcache: Cache,\n\t\tqueryMetadata: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t} | undefined,\n\t\tcacheConfig: WithCacheConfig | undefined,\n\t\tprivate fields: SelectedFieldsOrdered | undefined,\n\t\tname: string | undefined,\n\t\tprivate _isResponseInArrayMode: boolean,\n\t\tprivate customResultMapper?: (\n\t\t\trows: TIsRqbV2 extends true ? Record<string, unknown>[] : unknown[][],\n\t\t) => T['execute'],\n\t\tprivate isRqbV2Query?: TIsRqbV2,\n\t) {\n\t\tsuper(query, cache, queryMetadata, cacheConfig);\n\t\tthis.rawQueryConfig = {\n\t\t\trowMode: 'object',\n\t\t\tparsers: {\n\t\t\t\t[types.TIMESTAMP]: (value) => value,\n\t\t\t\t[types.TIMESTAMPTZ]: (value) => value,\n\t\t\t\t[types.INTERVAL]: (value) => value,\n\t\t\t\t[types.DATE]: (value) => value,\n\t\t\t\t// numeric[]\n\t\t\t\t[1231]: (value) => value,\n\t\t\t\t// timestamp[]\n\t\t\t\t[1115]: (value) => value,\n\t\t\t\t// timestamp with timezone[]\n\t\t\t\t[1185]: (value) => value,\n\t\t\t\t// interval[]\n\t\t\t\t[1187]: (value) => value,\n\t\t\t\t// date[]\n\t\t\t\t[1182]: (value) => value,\n\t\t\t},\n\t\t};\n\t\tthis.queryConfig = {\n\t\t\trowMode: 'array',\n\t\t\tparsers: {\n\t\t\t\t[types.TIMESTAMP]: (value) => value,\n\t\t\t\t[types.TIMESTAMPTZ]: (value) => value,\n\t\t\t\t[types.INTERVAL]: (value) => value,\n\t\t\t\t[types.DATE]: (value) => value,\n\t\t\t\t// numeric[]\n\t\t\t\t[1231]: (value) => value,\n\t\t\t\t// timestamp[]\n\t\t\t\t[1115]: (value) => value,\n\t\t\t\t// timestamp with timezone[]\n\t\t\t\t[1185]: (value) => value,\n\t\t\t\t// interval[]\n\t\t\t\t[1187]: (value) => value,\n\t\t\t\t// date[]\n\t\t\t\t[1182]: (value) => value,\n\t\t\t},\n\t\t};\n\t}\n\n\tasync execute(placeholderValues: Record<string, unknown> | undefined = {}): Promise<T['execute']> {\n\t\tif (this.isRqbV2Query) return this.executeRqbV2(placeholderValues);\n\n\t\tconst params = fillPlaceholders(this.query.params, placeholderValues);\n\n\t\tthis.logger.logQuery(this.query.sql, params);\n\n\t\tconst { fields, client, queryConfig, joinsNotNullableMap, customResultMapper, query, rawQueryConfig } = this;\n\n\t\tif (!fields && !customResultMapper) {\n\t\t\treturn this.queryWithCache(query.sql, params, async () => {\n\t\t\t\treturn await client.query<any[]>(query.sql, params, rawQueryConfig);\n\t\t\t});\n\t\t}\n\n\t\tconst result = await this.queryWithCache(query.sql, params, async () => {\n\t\t\treturn await client.query<any[]>(query.sql, params, queryConfig);\n\t\t});\n\n\t\treturn customResultMapper\n\t\t\t? (customResultMapper as (rows: unknown[][]) => T['execute'])(result.rows)\n\t\t\t: result.rows.map((row) => mapResultRow<T['execute']>(fields!, row, joinsNotNullableMap));\n\t}\n\n\tprivate async executeRqbV2(placeholderValues: Record<string, unknown> | undefined = {}): Promise<T['execute']> {\n\t\tconst params = fillPlaceholders(this.query.params, placeholderValues);\n\n\t\tthis.logger.logQuery(this.query.sql, params);\n\n\t\tconst { rawQueryConfig, client, customResultMapper, query } = this;\n\n\t\tconst result = await client.query<Record<string, unknown>>(query.sql, params, rawQueryConfig);\n\n\t\treturn (customResultMapper as (rows: Record<string, unknown>[]) => T['execute'])(result.rows);\n\t}\n\n\tall(placeholderValues: Record<string, unknown> | undefined = {}): Promise<T['all']> {\n\t\tconst params = fillPlaceholders(this.query.params, placeholderValues);\n\t\tthis.logger.logQuery(this.query.sql, params);\n\t\treturn this.queryWithCache(this.query.sql, params, async () => {\n\t\t\treturn await this.client.query<any[]>(this.query.sql, params, this.rawQueryConfig);\n\t\t}).then((result) => result.rows);\n\t}\n\n\t/** @internal */\n\tisResponseInArrayMode(): boolean {\n\t\treturn this._isResponseInArrayMode;\n\t}\n}\n\nexport interface PgliteSessionOptions {\n\tlogger?: Logger;\n\tcache?: Cache;\n}\n\nexport class PgliteSession<\n\tTFullSchema extends Record<string, unknown>,\n\tTRelations extends AnyRelations,\n\tTSchema extends V1.TablesRelationalConfig,\n> extends PgAsyncSession<PgliteQueryResultHKT, TFullSchema, TRelations, TSchema> {\n\tstatic override readonly [entityKind]: string = 'PgliteSession';\n\n\tprivate logger: Logger;\n\tprivate cache: Cache;\n\n\tconstructor(\n\t\tprivate client: PgliteClient | Transaction,\n\t\tdialect: PgDialect,\n\t\tprivate relations: TRelations,\n\t\tprivate schema: V1.RelationalSchemaConfig<TSchema> | undefined,\n\t\tprivate options: PgliteSessionOptions = {},\n\t) {\n\t\tsuper(dialect);\n\t\tthis.logger = options.logger ?? new NoopLogger();\n\t\tthis.cache = options.cache ?? new NoopCache();\n\t}\n\n\tprepareQuery<T extends PreparedQueryConfig = PreparedQueryConfig>(\n\t\tquery: Query,\n\t\tfields: SelectedFieldsOrdered | undefined,\n\t\tname: string | undefined,\n\t\tisResponseInArrayMode: boolean,\n\t\tcustomResultMapper?: (rows: unknown[][]) => T['execute'],\n\t\tqueryMetadata?: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t},\n\t\tcacheConfig?: WithCacheConfig,\n\t): PgAsyncPreparedQuery<T> {\n\t\treturn new PglitePreparedQuery(\n\t\t\tthis.client,\n\t\t\tquery,\n\t\t\tthis.logger,\n\t\t\tthis.cache,\n\t\t\tqueryMetadata,\n\t\t\tcacheConfig,\n\t\t\tfields,\n\t\t\tname,\n\t\t\tisResponseInArrayMode,\n\t\t\tcustomResultMapper,\n\t\t);\n\t}\n\n\tprepareRelationalQuery<T extends PreparedQueryConfig = PreparedQueryConfig>(\n\t\tquery: Query,\n\t\tfields: SelectedFieldsOrdered | undefined,\n\t\tname: string | undefined,\n\t\tcustomResultMapper: (rows: Record<string, unknown>[]) => T['execute'],\n\t): PgAsyncPreparedQuery<T> {\n\t\treturn new PglitePreparedQuery(\n\t\t\tthis.client,\n\t\t\tquery,\n\t\t\tthis.logger,\n\t\t\tthis.cache,\n\t\t\tundefined,\n\t\t\tundefined,\n\t\t\tfields,\n\t\t\tname,\n\t\t\tfalse,\n\t\t\tcustomResultMapper,\n\t\t\ttrue,\n\t\t);\n\t}\n\n\toverride async transaction<T>(\n\t\ttransaction: (tx: PgliteTransaction<TFullSchema, TRelations, TSchema>) => Promise<T>,\n\t\tconfig?: PgTransactionConfig | undefined,\n\t): Promise<T> {\n\t\treturn (this.client as PgliteClient).transaction(async (client) => {\n\t\t\tconst session = new PgliteSession<TFullSchema, TRelations, TSchema>(\n\t\t\t\tclient,\n\t\t\t\tthis.dialect,\n\t\t\t\tthis.relations,\n\t\t\t\tthis.schema,\n\t\t\t\tthis.options,\n\t\t\t);\n\t\t\tconst tx = new PgliteTransaction<TFullSchema, TRelations, TSchema>(\n\t\t\t\tthis.dialect,\n\t\t\t\tsession,\n\t\t\t\tthis.relations,\n\t\t\t\tthis.schema,\n\t\t\t);\n\t\t\tif (config) {\n\t\t\t\tawait tx.setTransaction(config);\n\t\t\t}\n\t\t\treturn transaction(tx);\n\t\t}) as Promise<T>;\n\t}\n}\n\nexport class PgliteTransaction<\n\tTFullSchema extends Record<string, unknown>,\n\tTRelations extends AnyRelations,\n\tTSchema extends V1.TablesRelationalConfig,\n> extends PgAsyncTransaction<PgliteQueryResultHKT, TFullSchema, TRelations, TSchema> {\n\tstatic override readonly [entityKind]: string = 'PgliteTransaction';\n\n\toverride async transaction<T>(\n\t\ttransaction: (tx: PgliteTransaction<TFullSchema, TRelations, TSchema>) => Promise<T>,\n\t): Promise<T> {\n\t\tconst savepointName = `sp${this.nestedIndex + 1}`;\n\t\tconst tx = new PgliteTransaction<TFullSchema, TRelations, TSchema>(\n\t\t\tthis.dialect,\n\t\t\tthis.session,\n\t\t\tthis.relations,\n\t\t\tthis.schema,\n\t\t\tthis.nestedIndex + 1,\n\t\t);\n\t\tawait tx.execute(sql.raw(`savepoint ${savepointName}`));\n\t\ttry {\n\t\t\tconst result = await transaction(tx);\n\t\t\tawait tx.execute(sql.raw(`release savepoint ${savepointName}`));\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tawait tx.execute(sql.raw(`rollback to savepoint ${savepointName}`));\n\t\t\tthrow err;\n\t\t}\n\t}\n}\n\nexport interface PgliteQueryResultHKT extends PgQueryResultHKT {\n\ttype: Results<Assume<this['row'], Row>>;\n}\n"],"mappings":";;;;;;;;;;;AAmBA,IAAa,sBAAb,cACSA,gDACT;CACC,QAA0BC,0BAAsB;CAEhD,AAAQ;CACR,AAAQ;CAER,YACC,AAAQ,QACR,OACA,AAAQ,QACR,OACA,eAIA,aACA,AAAQ,QACR,MACA,AAAQ,wBACR,AAAQ,oBAGR,AAAQ,cACP;AACD,QAAM,OAAO,OAAO,eAAe,YAAY;EAjBvC;EAEA;EAOA;EAEA;EACA;EAGA;AAGR,OAAK,iBAAiB;GACrB,SAAS;GACT,SAAS;KACPC,2BAAM,aAAa,UAAU;KAC7BA,2BAAM,eAAe,UAAU;KAC/BA,2BAAM,YAAY,UAAU;KAC5BA,2BAAM,QAAQ,UAAU;KAExB,QAAQ,UAAU;KAElB,QAAQ,UAAU;KAElB,QAAQ,UAAU;KAElB,QAAQ,UAAU;KAElB,QAAQ,UAAU;IACnB;GACD;AACD,OAAK,cAAc;GAClB,SAAS;GACT,SAAS;KACPA,2BAAM,aAAa,UAAU;KAC7BA,2BAAM,eAAe,UAAU;KAC/BA,2BAAM,YAAY,UAAU;KAC5BA,2BAAM,QAAQ,UAAU;KAExB,QAAQ,UAAU;KAElB,QAAQ,UAAU;KAElB,QAAQ,UAAU;KAElB,QAAQ,UAAU;KAElB,QAAQ,UAAU;IACnB;GACD;;CAGF,MAAM,QAAQ,oBAAyD,EAAE,EAAyB;AACjG,MAAI,KAAK,aAAc,QAAO,KAAK,aAAa,kBAAkB;EAElE,MAAM,4CAA0B,KAAK,MAAM,QAAQ,kBAAkB;AAErE,OAAK,OAAO,SAAS,KAAK,MAAM,KAAK,OAAO;EAE5C,MAAM,EAAE,QAAQ,QAAQ,aAAa,qBAAqB,oBAAoB,OAAO,mBAAmB;AAExG,MAAI,CAAC,UAAU,CAAC,mBACf,QAAO,KAAK,eAAe,MAAM,KAAK,QAAQ,YAAY;AACzD,UAAO,MAAM,OAAO,MAAa,MAAM,KAAK,QAAQ,eAAe;IAClE;EAGH,MAAM,SAAS,MAAM,KAAK,eAAe,MAAM,KAAK,QAAQ,YAAY;AACvE,UAAO,MAAM,OAAO,MAAa,MAAM,KAAK,QAAQ,YAAY;IAC/D;AAEF,SAAO,qBACH,mBAA2D,OAAO,KAAK,GACxE,OAAO,KAAK,KAAK,qCAAmC,QAAS,KAAK,oBAAoB,CAAC;;CAG3F,MAAc,aAAa,oBAAyD,EAAE,EAAyB;EAC9G,MAAM,4CAA0B,KAAK,MAAM,QAAQ,kBAAkB;AAErE,OAAK,OAAO,SAAS,KAAK,MAAM,KAAK,OAAO;EAE5C,MAAM,EAAE,gBAAgB,QAAQ,oBAAoB,UAAU;AAI9D,SAAQ,oBAFO,MAAM,OAAO,MAA+B,MAAM,KAAK,QAAQ,eAAe,EAEL,KAAK;;CAG9F,IAAI,oBAAyD,EAAE,EAAqB;EACnF,MAAM,4CAA0B,KAAK,MAAM,QAAQ,kBAAkB;AACrE,OAAK,OAAO,SAAS,KAAK,MAAM,KAAK,OAAO;AAC5C,SAAO,KAAK,eAAe,KAAK,MAAM,KAAK,QAAQ,YAAY;AAC9D,UAAO,MAAM,KAAK,OAAO,MAAa,KAAK,MAAM,KAAK,QAAQ,KAAK,eAAe;IACjF,CAAC,MAAM,WAAW,OAAO,KAAK;;;CAIjC,wBAAiC;AAChC,SAAO,KAAK;;;AASd,IAAa,gBAAb,MAAa,sBAIHC,0CAAuE;CAChF,QAA0BF,0BAAsB;CAEhD,AAAQ;CACR,AAAQ;CAER,YACC,AAAQ,QACR,SACA,AAAQ,WACR,AAAQ,QACR,AAAQ,UAAgC,EAAE,EACzC;AACD,QAAM,QAAQ;EANN;EAEA;EACA;EACA;AAGR,OAAK,SAAS,QAAQ,UAAU,IAAIG,wBAAY;AAChD,OAAK,QAAQ,QAAQ,SAAS,IAAIC,iCAAW;;CAG9C,aACC,OACA,QACA,MACA,uBACA,oBACA,eAIA,aAC0B;AAC1B,SAAO,IAAI,oBACV,KAAK,QACL,OACA,KAAK,QACL,KAAK,OACL,eACA,aACA,QACA,MACA,uBACA,mBACA;;CAGF,uBACC,OACA,QACA,MACA,oBAC0B;AAC1B,SAAO,IAAI,oBACV,KAAK,QACL,OACA,KAAK,QACL,KAAK,OACL,QACA,QACA,QACA,MACA,OACA,oBACA,KACA;;CAGF,MAAe,YACd,aACA,QACa;AACb,SAAQ,KAAK,OAAwB,YAAY,OAAO,WAAW;GAClE,MAAM,UAAU,IAAI,cACnB,QACA,KAAK,SACL,KAAK,WACL,KAAK,QACL,KAAK,QACL;GACD,MAAM,KAAK,IAAI,kBACd,KAAK,SACL,SACA,KAAK,WACL,KAAK,OACL;AACD,OAAI,OACH,OAAM,GAAG,eAAe,OAAO;AAEhC,UAAO,YAAY,GAAG;IACrB;;;AAIJ,IAAa,oBAAb,MAAa,0BAIHC,8CAA2E;CACpF,QAA0BL,0BAAsB;CAEhD,MAAe,YACd,aACa;EACb,MAAM,gBAAgB,KAAK,KAAK,cAAc;EAC9C,MAAM,KAAK,IAAI,kBACd,KAAK,SACL,KAAK,SACL,KAAK,WACL,KAAK,QACL,KAAK,cAAc,EACnB;AACD,QAAM,GAAG,QAAQM,iBAAI,IAAI,aAAa,gBAAgB,CAAC;AACvD,MAAI;GACH,MAAM,SAAS,MAAM,YAAY,GAAG;AACpC,SAAM,GAAG,QAAQA,iBAAI,IAAI,qBAAqB,gBAAgB,CAAC;AAC/D,UAAO;WACC,KAAK;AACb,SAAM,GAAG,QAAQA,iBAAI,IAAI,yBAAyB,gBAAgB,CAAC;AACnE,SAAM"}
|
|
1
|
+
{"version":3,"file":"session.cjs","names":["types","PgAsyncSession","entityKind","NoopLogger","NoopCache","PgAsyncPreparedQuery","PgAsyncTransaction","sql"],"sources":["../../src/pglite/session.ts"],"sourcesContent":["import type { ParserOptions, PGlite, Results, Row, Transaction } from '@electric-sql/pglite';\nimport { types } from '@electric-sql/pglite';\nimport { type Cache, NoopCache } from '~/cache/core/cache.ts';\nimport type { WithCacheConfig } from '~/cache/core/types.ts';\nimport { entityKind } from '~/entity.ts';\nimport { type Logger, NoopLogger } from '~/logger.ts';\nimport { PgAsyncPreparedQuery, PgAsyncSession } from '~/pg-core/async/session.ts';\nimport { PgAsyncTransaction } from '~/pg-core/async/session.ts';\nimport type { PgDialect } from '~/pg-core/dialect.ts';\nimport type { PgQueryResultHKT, PgTransactionConfig, PreparedQueryConfig } from '~/pg-core/session.ts';\nimport type { AnyRelations } from '~/relations.ts';\nimport { type Query, sql } from '~/sql/sql.ts';\nimport type { Assume } from '~/utils.ts';\n\nexport type PgliteClient = PGlite;\n\nconst parsers: ParserOptions = {\n\t[types.TIMESTAMP]: (value) => value,\n\t[types.TIMESTAMPTZ]: (value) => value,\n\t[types.INTERVAL]: (value) => value,\n\t[types.DATE]: (value) => value,\n\t// numeric[]\n\t[1231]: (value) => value,\n\t// timestamp[]\n\t[1115]: (value) => value,\n\t// timestamp with timezone[]\n\t[1185]: (value) => value,\n\t// interval[]\n\t[1187]: (value) => value,\n\t// date[]\n\t[1182]: (value) => value,\n};\n\nexport interface PgliteSessionOptions {\n\tlogger?: Logger;\n\tcache?: Cache;\n\tuseJitMapper?: boolean;\n}\n\nexport class PgliteSession<TRelations extends AnyRelations> extends PgAsyncSession<PgliteQueryResultHKT, TRelations> {\n\tstatic override readonly [entityKind]: string = 'PgliteSession';\n\n\tprivate logger: Logger;\n\tprivate cache: Cache;\n\n\tconstructor(\n\t\tprivate client: PgliteClient | Transaction,\n\t\tdialect: PgDialect,\n\t\tprivate relations: TRelations,\n\t\tprivate options: PgliteSessionOptions = {},\n\t) {\n\t\tsuper(dialect);\n\t\tthis.logger = options.logger ?? new NoopLogger();\n\t\tthis.cache = options.cache ?? new NoopCache();\n\t}\n\n\tprepareQuery<T extends PreparedQueryConfig = PreparedQueryConfig>(\n\t\tquery: Query,\n\t\tmode: 'arrays' | 'objects' | 'raw',\n\t\t_name: string | boolean,\n\t\tmapper: ((rows: any[]) => any) | undefined,\n\t\tqueryMetadata?: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t},\n\t\tcacheConfig?: WithCacheConfig,\n\t): PgAsyncPreparedQuery<T> {\n\t\tconst executor = async (params?: unknown[]) => {\n\t\t\treturn this.client.query(query.sql, params, {\n\t\t\t\trowMode: mode === 'arrays' ? 'array' : 'object',\n\t\t\t\tparsers,\n\t\t\t}).then((r) => mode === 'raw' ? r : r.rows);\n\t\t};\n\n\t\treturn new PgAsyncPreparedQuery<T>(\n\t\t\texecutor,\n\t\t\tquery,\n\t\t\tmapper,\n\t\t\tmode,\n\t\t\tthis.logger,\n\t\t\tthis.cache,\n\t\t\tqueryMetadata,\n\t\t\tcacheConfig,\n\t\t);\n\t}\n\n\toverride async transaction<T>(\n\t\ttransaction: (tx: PgliteTransaction<TRelations>) => Promise<T>,\n\t\tconfig?: PgTransactionConfig | undefined,\n\t): Promise<T> {\n\t\treturn (this.client as PgliteClient).transaction(async (client) => {\n\t\t\tconst session = new PgliteSession<TRelations>(\n\t\t\t\tclient,\n\t\t\t\tthis.dialect,\n\t\t\t\tthis.relations,\n\t\t\t\tthis.options,\n\t\t\t);\n\t\t\tconst tx = new PgliteTransaction<TRelations>(\n\t\t\t\tthis.dialect,\n\t\t\t\tsession,\n\t\t\t\tthis.relations,\n\t\t\t\tundefined,\n\t\t\t\tfalse,\n\t\t\t);\n\t\t\tif (config) {\n\t\t\t\tawait tx.setTransaction(config);\n\t\t\t}\n\t\t\treturn transaction(tx);\n\t\t}) as Promise<T>;\n\t}\n}\n\nexport class PgliteTransaction<\n\tTRelations extends AnyRelations,\n> extends PgAsyncTransaction<PgliteQueryResultHKT, TRelations> {\n\tstatic override readonly [entityKind]: string = 'PgliteTransaction';\n\n\toverride transaction = async <T>(\n\t\ttransaction: (tx: PgliteTransaction<TRelations>) => Promise<T>,\n\t): Promise<T> => {\n\t\tconst savepointName = `sp${this.nestedIndex + 1}`;\n\t\tconst tx = new PgliteTransaction<TRelations>(\n\t\t\tthis.dialect,\n\t\t\tthis.session,\n\t\t\tthis._.relations,\n\t\t\tthis.nestedIndex + 1,\n\t\t\tfalse,\n\t\t);\n\t\tawait tx.execute(sql.raw(`savepoint ${savepointName}`));\n\t\ttry {\n\t\t\tconst result = await transaction(tx);\n\t\t\tawait tx.execute(sql.raw(`release savepoint ${savepointName}`));\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tawait tx.execute(sql.raw(`rollback to savepoint ${savepointName}`));\n\t\t\tthrow err;\n\t\t}\n\t};\n}\n\nexport interface PgliteQueryResultHKT extends PgQueryResultHKT {\n\ttype: Results<Assume<this['row'], Row>>;\n}\n"],"mappings":";;;;;;;;;;AAgBA,MAAM,UAAyB;EAC7BA,2BAAM,aAAa,UAAU;EAC7BA,2BAAM,eAAe,UAAU;EAC/BA,2BAAM,YAAY,UAAU;EAC5BA,2BAAM,QAAQ,UAAU;EAExB,QAAQ,UAAU;EAElB,QAAQ,UAAU;EAElB,QAAQ,UAAU;EAElB,QAAQ,UAAU;EAElB,QAAQ,UAAU;CACnB;AAQD,IAAa,gBAAb,MAAa,sBAAuDC,0CAAiD;CACpH,QAA0BC,0BAAsB;CAEhD,AAAQ;CACR,AAAQ;CAER,YACC,AAAQ,QACR,SACA,AAAQ,WACR,AAAQ,UAAgC,EAAE,EACzC;AACD,QAAM,QAAQ;EALN;EAEA;EACA;AAGR,OAAK,SAAS,QAAQ,UAAU,IAAIC,wBAAY;AAChD,OAAK,QAAQ,QAAQ,SAAS,IAAIC,iCAAW;;CAG9C,aACC,OACA,MACA,OACA,QACA,eAIA,aAC0B;EAC1B,MAAM,WAAW,OAAO,WAAuB;AAC9C,UAAO,KAAK,OAAO,MAAM,MAAM,KAAK,QAAQ;IAC3C,SAAS,SAAS,WAAW,UAAU;IACvC;IACA,CAAC,CAAC,MAAM,MAAM,SAAS,QAAQ,IAAI,EAAE,KAAK;;AAG5C,SAAO,IAAIC,gDACV,UACA,OACA,QACA,MACA,KAAK,QACL,KAAK,OACL,eACA,YACA;;CAGF,MAAe,YACd,aACA,QACa;AACb,SAAQ,KAAK,OAAwB,YAAY,OAAO,WAAW;GAClE,MAAM,UAAU,IAAI,cACnB,QACA,KAAK,SACL,KAAK,WACL,KAAK,QACL;GACD,MAAM,KAAK,IAAI,kBACd,KAAK,SACL,SACA,KAAK,WACL,QACA,MACA;AACD,OAAI,OACH,OAAM,GAAG,eAAe,OAAO;AAEhC,UAAO,YAAY,GAAG;IACrB;;;AAIJ,IAAa,oBAAb,MAAa,0BAEHC,8CAAqD;CAC9D,QAA0BJ,0BAAsB;CAEhD,AAAS,cAAc,OACtB,gBACgB;EAChB,MAAM,gBAAgB,KAAK,KAAK,cAAc;EAC9C,MAAM,KAAK,IAAI,kBACd,KAAK,SACL,KAAK,SACL,KAAK,EAAE,WACP,KAAK,cAAc,GACnB,MACA;AACD,QAAM,GAAG,QAAQK,iBAAI,IAAI,aAAa,gBAAgB,CAAC;AACvD,MAAI;GACH,MAAM,SAAS,MAAM,YAAY,GAAG;AACpC,SAAM,GAAG,QAAQA,iBAAI,IAAI,qBAAqB,gBAAgB,CAAC;AAC/D,UAAO;WACC,KAAK;AACb,SAAM,GAAG,QAAQA,iBAAI,IAAI,yBAAyB,gBAAgB,CAAC;AACnE,SAAM"}
|
package/pglite/session.d.cts
CHANGED
|
@@ -1,64 +1,43 @@
|
|
|
1
1
|
import { entityKind } from "../entity.cjs";
|
|
2
2
|
import { Query } from "../sql/sql.cjs";
|
|
3
3
|
import { Assume } from "../utils.cjs";
|
|
4
|
-
import * as V1 from "../_relations.cjs";
|
|
5
4
|
import { Cache } from "../cache/core/cache.cjs";
|
|
6
5
|
import { WithCacheConfig } from "../cache/core/types.cjs";
|
|
7
6
|
import { AnyRelations } from "../relations.cjs";
|
|
8
7
|
import { PgDialect } from "../pg-core/dialect.cjs";
|
|
9
8
|
import { PgQueryResultHKT, PgTransactionConfig, PreparedQueryConfig } from "../pg-core/session.cjs";
|
|
10
|
-
import { SelectedFieldsOrdered } from "../pg-core/query-builders/select.types.cjs";
|
|
11
|
-
import { PgAsyncPreparedQuery, PgAsyncSession, PgAsyncTransaction } from "../pg-core/async/session.cjs";
|
|
12
9
|
import { Logger } from "../logger.cjs";
|
|
10
|
+
import { PgAsyncPreparedQuery, PgAsyncSession, PgAsyncTransaction } from "../pg-core/async/session.cjs";
|
|
13
11
|
import { PGlite, Results, Row, Transaction } from "@electric-sql/pglite";
|
|
14
12
|
|
|
15
13
|
//#region src/pglite/session.d.ts
|
|
16
14
|
type PgliteClient = PGlite;
|
|
17
|
-
declare class PglitePreparedQuery<T extends PreparedQueryConfig, TIsRqbV2 extends boolean = false> extends PgAsyncPreparedQuery<T> {
|
|
18
|
-
private client;
|
|
19
|
-
private logger;
|
|
20
|
-
private fields;
|
|
21
|
-
private _isResponseInArrayMode;
|
|
22
|
-
private customResultMapper?;
|
|
23
|
-
private isRqbV2Query?;
|
|
24
|
-
static readonly [entityKind]: string;
|
|
25
|
-
private rawQueryConfig;
|
|
26
|
-
private queryConfig;
|
|
27
|
-
constructor(client: PgliteClient | Transaction, query: Query, logger: Logger, cache: Cache, queryMetadata: {
|
|
28
|
-
type: 'select' | 'update' | 'delete' | 'insert';
|
|
29
|
-
tables: string[];
|
|
30
|
-
} | undefined, cacheConfig: WithCacheConfig | undefined, fields: SelectedFieldsOrdered | undefined, name: string | undefined, _isResponseInArrayMode: boolean, customResultMapper?: ((rows: TIsRqbV2 extends true ? Record<string, unknown>[] : unknown[][]) => T["execute"]) | undefined, isRqbV2Query?: TIsRqbV2 | undefined);
|
|
31
|
-
execute(placeholderValues?: Record<string, unknown> | undefined): Promise<T['execute']>;
|
|
32
|
-
private executeRqbV2;
|
|
33
|
-
all(placeholderValues?: Record<string, unknown> | undefined): Promise<T['all']>;
|
|
34
|
-
}
|
|
35
15
|
interface PgliteSessionOptions {
|
|
36
16
|
logger?: Logger;
|
|
37
17
|
cache?: Cache;
|
|
18
|
+
useJitMapper?: boolean;
|
|
38
19
|
}
|
|
39
|
-
declare class PgliteSession<
|
|
20
|
+
declare class PgliteSession<TRelations extends AnyRelations> extends PgAsyncSession<PgliteQueryResultHKT, TRelations> {
|
|
40
21
|
private client;
|
|
41
22
|
private relations;
|
|
42
|
-
private schema;
|
|
43
23
|
private options;
|
|
44
24
|
static readonly [entityKind]: string;
|
|
45
25
|
private logger;
|
|
46
26
|
private cache;
|
|
47
|
-
constructor(client: PgliteClient | Transaction, dialect: PgDialect, relations: TRelations,
|
|
48
|
-
prepareQuery<T extends PreparedQueryConfig = PreparedQueryConfig>(query: Query,
|
|
27
|
+
constructor(client: PgliteClient | Transaction, dialect: PgDialect, relations: TRelations, options?: PgliteSessionOptions);
|
|
28
|
+
prepareQuery<T extends PreparedQueryConfig = PreparedQueryConfig>(query: Query, mode: 'arrays' | 'objects' | 'raw', _name: string | boolean, mapper: ((rows: any[]) => any) | undefined, queryMetadata?: {
|
|
49
29
|
type: 'select' | 'update' | 'delete' | 'insert';
|
|
50
30
|
tables: string[];
|
|
51
31
|
}, cacheConfig?: WithCacheConfig): PgAsyncPreparedQuery<T>;
|
|
52
|
-
|
|
53
|
-
transaction<T>(transaction: (tx: PgliteTransaction<TFullSchema, TRelations, TSchema>) => Promise<T>, config?: PgTransactionConfig | undefined): Promise<T>;
|
|
32
|
+
transaction<T>(transaction: (tx: PgliteTransaction<TRelations>) => Promise<T>, config?: PgTransactionConfig | undefined): Promise<T>;
|
|
54
33
|
}
|
|
55
|
-
declare class PgliteTransaction<
|
|
34
|
+
declare class PgliteTransaction<TRelations extends AnyRelations> extends PgAsyncTransaction<PgliteQueryResultHKT, TRelations> {
|
|
56
35
|
static readonly [entityKind]: string;
|
|
57
|
-
transaction<T>(transaction: (tx: PgliteTransaction<
|
|
36
|
+
transaction: <T>(transaction: (tx: PgliteTransaction<TRelations>) => Promise<T>) => Promise<T>;
|
|
58
37
|
}
|
|
59
38
|
interface PgliteQueryResultHKT extends PgQueryResultHKT {
|
|
60
39
|
type: Results<Assume<this['row'], Row>>;
|
|
61
40
|
}
|
|
62
41
|
//#endregion
|
|
63
|
-
export { PgliteClient,
|
|
42
|
+
export { PgliteClient, PgliteQueryResultHKT, PgliteSession, PgliteSessionOptions, PgliteTransaction };
|
|
64
43
|
//# sourceMappingURL=session.d.cts.map
|