drizzle-orm 0.26.3-cfa5f49 → 0.26.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/aws-data-api/pg/index.cjs +21 -21
  2. package/aws-data-api/pg/index.cjs.map +1 -1
  3. package/aws-data-api/pg/index.d.ts +2 -2
  4. package/aws-data-api/pg/index.mjs +21 -21
  5. package/aws-data-api/pg/index.mjs.map +1 -1
  6. package/aws-data-api/pg/migrator.d.ts +2 -2
  7. package/better-sqlite3/index.cjs +2 -2
  8. package/better-sqlite3/index.d.ts +3 -3
  9. package/better-sqlite3/index.mjs +2 -2
  10. package/better-sqlite3/migrator.d.ts +3 -3
  11. package/bun-sqlite/index.cjs +2 -2
  12. package/bun-sqlite/index.d.ts +3 -3
  13. package/bun-sqlite/index.mjs +2 -2
  14. package/bun-sqlite/migrator.d.ts +3 -3
  15. package/d1/index.cjs +2 -2
  16. package/d1/index.d.ts +3 -3
  17. package/d1/index.mjs +2 -2
  18. package/d1/migrator.d.ts +3 -3
  19. package/{db.d-7539956f.d.ts → db.d-7fd2e787.d.ts} +1 -1
  20. package/{db.d-89e25221.d.ts → db.d-a6fe1b19.d.ts} +2 -2
  21. package/{driver.d-8de27d05.d.ts → driver.d-3c67c205.d.ts} +1 -1
  22. package/{driver.d-1d2954cc.d.ts → driver.d-63c391d1.d.ts} +1 -1
  23. package/{driver.d-238b678e.d.ts → driver.d-acac104e.d.ts} +1 -1
  24. package/{driver.d-1904bc39.d.ts → driver.d-c43a29fc.d.ts} +1 -1
  25. package/{driver.d-d334afe8.d.ts → driver.d-d68e216b.d.ts} +1 -1
  26. package/{driver.d-33a2c54d.d.ts → driver.d-ffc299cd.d.ts} +1 -1
  27. package/index.cjs +1 -1
  28. package/index.d.ts +2 -2
  29. package/index.mjs +1 -1
  30. package/libsql/index.cjs +2 -2
  31. package/libsql/index.d.ts +3 -3
  32. package/libsql/index.mjs +2 -2
  33. package/libsql/migrator.d.ts +3 -3
  34. package/mysql-core/index.cjs +2 -2
  35. package/mysql-core/index.d.ts +3 -3
  36. package/mysql-core/index.mjs +3 -3
  37. package/mysql2/index.cjs +2 -2
  38. package/mysql2/index.d.ts +2 -2
  39. package/mysql2/index.mjs +2 -2
  40. package/mysql2/migrator.d.ts +2 -2
  41. package/neon-serverless/index.cjs +2 -2
  42. package/neon-serverless/index.d.ts +2 -2
  43. package/neon-serverless/index.mjs +2 -2
  44. package/neon-serverless/migrator.d.ts +2 -2
  45. package/node-postgres/index.cjs +2 -2
  46. package/node-postgres/index.d.ts +2 -2
  47. package/node-postgres/index.mjs +2 -2
  48. package/node-postgres/migrator.d.ts +2 -2
  49. package/package.json +207 -1
  50. package/pg-core/index.cjs +2 -2
  51. package/pg-core/index.d.ts +3 -3
  52. package/pg-core/index.mjs +3 -3
  53. package/planetscale-serverless/index.cjs +2 -2
  54. package/planetscale-serverless/index.d.ts +2 -2
  55. package/planetscale-serverless/index.mjs +2 -2
  56. package/planetscale-serverless/migrator.d.ts +2 -2
  57. package/postgres-js/index.cjs +2 -2
  58. package/postgres-js/index.d.ts +2 -2
  59. package/postgres-js/index.mjs +2 -2
  60. package/postgres-js/migrator.d.ts +2 -2
  61. package/{query-promise.d-afecc38e.d.ts → query-promise.d-d7b61248.d.ts} +1 -1
  62. package/{relations-9f9994ca.cjs → relations-318e97e5.cjs} +14 -9
  63. package/{relations-9f9994ca.cjs.map → relations-318e97e5.cjs.map} +1 -1
  64. package/{relations-8a5ba133.mjs → relations-3eb6fe55.mjs} +14 -9
  65. package/{relations-8a5ba133.mjs.map → relations-3eb6fe55.mjs.map} +1 -1
  66. package/{select.types.d-2d1036d9.d.ts → select.types.d-e43b2599.d.ts} +1 -1
  67. package/{session-7e0da329.mjs → session-2b625be5.mjs} +10 -3
  68. package/{session-7e0da329.mjs.map → session-2b625be5.mjs.map} +1 -1
  69. package/{session-87d0ce9a.cjs → session-82204af3.cjs} +10 -3
  70. package/{session-87d0ce9a.cjs.map → session-82204af3.cjs.map} +1 -1
  71. package/{session-3cca0834.cjs → session-835745d5.cjs} +11 -4
  72. package/{session-3cca0834.cjs.map → session-835745d5.cjs.map} +1 -1
  73. package/{session-6c2c5767.cjs → session-b2bd7eb4.cjs} +4 -4
  74. package/{session-6c2c5767.cjs.map → session-b2bd7eb4.cjs.map} +1 -1
  75. package/{session-4242e73a.mjs → session-deaaed1f.mjs} +4 -4
  76. package/{session-4242e73a.mjs.map → session-deaaed1f.mjs.map} +1 -1
  77. package/{session-a08a69f1.mjs → session-e3a36009.mjs} +11 -4
  78. package/{session-a08a69f1.mjs.map → session-e3a36009.mjs.map} +1 -1
  79. package/sql-js/index.cjs +2 -2
  80. package/sql-js/index.d.ts +3 -3
  81. package/sql-js/index.mjs +2 -2
  82. package/sql-js/migrator.d.ts +3 -3
  83. package/sqlite-core/index.cjs +2 -2
  84. package/sqlite-core/index.d.ts +3 -3
  85. package/sqlite-core/index.mjs +3 -3
  86. package/sqlite-proxy/index.cjs +2 -2
  87. package/sqlite-proxy/index.d.ts +4 -4
  88. package/sqlite-proxy/index.mjs +2 -2
  89. package/sqlite-proxy/migrator.cjs +1 -1
  90. package/sqlite-proxy/migrator.d.ts +3 -3
  91. package/sqlite-proxy/migrator.mjs +1 -1
  92. package/vercel-postgres/index.cjs +2 -2
  93. package/vercel-postgres/index.d.ts +2 -2
  94. package/vercel-postgres/index.mjs +2 -2
  95. package/vercel-postgres/migrator.d.ts +2 -2
  96. package/version.cjs +1 -1
  97. package/version.d.ts +1 -1
  98. package/version.mjs +1 -1
@@ -1,8 +1,8 @@
1
- import { M as MySqlColumnBuilderWithAutoIncrement, a as MySqlColumnWithAutoIncrement, b as MySqlColumnBuilder, c as MySqlColumn, A as AnyMySqlTable, B as BuildAliasTable, d as MySqlTableFn, m as mysqlView, e as AnyMySqlColumn, I as Index, F as ForeignKey, C as Check, P as PrimaryKey, f as MySqlView } from '../select.types.d-2d1036d9.js';
2
- export { r as AnyForeignKeyBuilder, v as AnyIndexBuilder, k as AnyMySqlColumnBuilder, L as AnyMySqlInsertConfig, Y as AnyMySqlSelect, g as CheckBuilder, q as ForeignKeyBuilder, G as GetColumnsTable, x as GetColumnsTableName, w as IndexBuilder, u as IndexBuilderOn, t as IndexColumn, _ as JoinFn, X as JoinsValue, a3 as LockConfig, a2 as LockStrength, ay as ManualViewBuilder, i as MySqlColumnBuilderHKT, j as MySqlColumnHKT, l as MySqlColumnWithAutoIncrementConfig, n as MySqlDatabase, J as MySqlDelete, H as MySqlDeleteConfig, o as MySqlDialect, Q as MySqlInsert, O as MySqlInsertBuilder, K as MySqlInsertConfig, N as MySqlInsertValue, W as MySqlSelect, T as MySqlSelectBuilder, Z as MySqlSelectConfig, a7 as MySqlSelectHKT, a4 as MySqlSelectHKTBase, a5 as MySqlSelectKind, V as MySqlSelectQueryBuilder, a6 as MySqlSelectQueryBuilderHKT, aj as MySqlSession, aq as MySqlTable, ao as MySqlTableExtraConfig, ar as MySqlTableWithColumns, ak as MySqlTransaction, ai as MySqlTransactionConfig, ab as MySqlUpdate, aa as MySqlUpdateBuilder, a8 as MySqlUpdateConfig, a9 as MySqlUpdateSetSource, az as MySqlViewBase, aA as MySqlViewConfig, aB as MySqlViewWithSelection, ah as PreparedQuery, ae as PreparedQueryConfig, af as PreparedQueryHKT, al as PreparedQueryHKTBase, ag as PreparedQueryKind, E as PrimaryKeyBuilder, S as QueryBuilder, ac as QueryResultHKT, ad as QueryResultKind, p as Reference, R as ReferenceConfig, a0 as SelectedFields, $ as SelectedFieldsFlat, a1 as SelectedFieldsOrdered, am as SubqueryWithSelection, ap as TableConfig, U as UpdateDeleteAction, ax as ViewBuilder, av as ViewBuilderConfig, aw as ViewBuilderCore, an as WithSubqueryWithSelection, h as check, s as foreignKey, y as index, at as mysqlTable, au as mysqlTableCreator, as as mysqlTableWithSchema, D as primaryKey, z as uniqueIndex } from '../select.types.d-2d1036d9.js';
1
+ import { M as MySqlColumnBuilderWithAutoIncrement, a as MySqlColumnWithAutoIncrement, b as MySqlColumnBuilder, c as MySqlColumn, A as AnyMySqlTable, B as BuildAliasTable, d as MySqlTableFn, m as mysqlView, e as AnyMySqlColumn, I as Index, F as ForeignKey, C as Check, P as PrimaryKey, f as MySqlView } from '../select.types.d-e43b2599.js';
2
+ export { r as AnyForeignKeyBuilder, v as AnyIndexBuilder, k as AnyMySqlColumnBuilder, L as AnyMySqlInsertConfig, Y as AnyMySqlSelect, g as CheckBuilder, q as ForeignKeyBuilder, G as GetColumnsTable, x as GetColumnsTableName, w as IndexBuilder, u as IndexBuilderOn, t as IndexColumn, _ as JoinFn, X as JoinsValue, a3 as LockConfig, a2 as LockStrength, ay as ManualViewBuilder, i as MySqlColumnBuilderHKT, j as MySqlColumnHKT, l as MySqlColumnWithAutoIncrementConfig, n as MySqlDatabase, J as MySqlDelete, H as MySqlDeleteConfig, o as MySqlDialect, Q as MySqlInsert, O as MySqlInsertBuilder, K as MySqlInsertConfig, N as MySqlInsertValue, W as MySqlSelect, T as MySqlSelectBuilder, Z as MySqlSelectConfig, a7 as MySqlSelectHKT, a4 as MySqlSelectHKTBase, a5 as MySqlSelectKind, V as MySqlSelectQueryBuilder, a6 as MySqlSelectQueryBuilderHKT, aj as MySqlSession, aq as MySqlTable, ao as MySqlTableExtraConfig, ar as MySqlTableWithColumns, ak as MySqlTransaction, ai as MySqlTransactionConfig, ab as MySqlUpdate, aa as MySqlUpdateBuilder, a8 as MySqlUpdateConfig, a9 as MySqlUpdateSetSource, az as MySqlViewBase, aA as MySqlViewConfig, aB as MySqlViewWithSelection, ah as PreparedQuery, ae as PreparedQueryConfig, af as PreparedQueryHKT, al as PreparedQueryHKTBase, ag as PreparedQueryKind, E as PrimaryKeyBuilder, S as QueryBuilder, ac as QueryResultHKT, ad as QueryResultKind, p as Reference, R as ReferenceConfig, a0 as SelectedFields, $ as SelectedFieldsFlat, a1 as SelectedFieldsOrdered, am as SubqueryWithSelection, ap as TableConfig, U as UpdateDeleteAction, ax as ViewBuilder, av as ViewBuilderConfig, aw as ViewBuilderCore, an as WithSubqueryWithSelection, h as check, s as foreignKey, y as index, at as mysqlTable, au as mysqlTableCreator, as as mysqlTableWithSchema, D as primaryKey, z as uniqueIndex } from '../select.types.d-e43b2599.js';
3
3
  import { n as ColumnBuilderHKTBase, ay as Assume, k as ColumnBuilderBaseConfig, c as ColumnHKTBase, C as ColumnBaseConfig, W as WithEnum, aF as Writable, S as Simplify, az as Equal, a as SQL, o as ColumnBuilderKind, t as UpdateCBConfig, F as SelectedFields, A as AnyColumn, T as Table, ak as TableConfig } from '../column.d-66a08b85.js';
4
4
  import '../select.types.d-1bd49d37.js';
5
- import '../query-promise.d-afecc38e.js';
5
+ import '../query-promise.d-d7b61248.js';
6
6
  import 'mysql2/promise';
7
7
  import '../migrator.js';
8
8
 
@@ -1,6 +1,6 @@
1
- import { K as TableAliasProxyHandler, s as sql, T as Table, q as ViewBaseConfig } from '../relations-8a5ba133.mjs';
2
- import { d as MySqlColumnBuilderWithAutoIncrement, e as MySqlColumnWithAutoIncrement, f as MySqlColumnBuilder, g as MySqlColumn, h as MySqlTable, m as mysqlTableWithSchema, i as mysqlViewWithSchema, F as ForeignKeyBuilder, j as MySqlViewConfig } from '../session-7e0da329.mjs';
3
- export { k as ForeignKey, I as InlineForeignKeys, y as ManualViewBuilder, b as MySqlDatabase, n as MySqlDelete, c as MySqlDialect, p as MySqlInsert, o as MySqlInsertBuilder, s as MySqlSelect, q as MySqlSelectBuilder, r as MySqlSelectQueryBuilder, M as MySqlSession, a as MySqlTransaction, u as MySqlUpdate, t as MySqlUpdateBuilder, A as MySqlView, z as MySqlViewBase, P as PreparedQuery, Q as QueryBuilder, x as ViewBuilder, V as ViewBuilderCore, l as foreignKey, v as mysqlTable, w as mysqlTableCreator, B as mysqlView } from '../session-7e0da329.mjs';
1
+ import { K as TableAliasProxyHandler, s as sql, T as Table, q as ViewBaseConfig } from '../relations-3eb6fe55.mjs';
2
+ import { d as MySqlColumnBuilderWithAutoIncrement, e as MySqlColumnWithAutoIncrement, f as MySqlColumnBuilder, g as MySqlColumn, h as MySqlTable, m as mysqlTableWithSchema, i as mysqlViewWithSchema, F as ForeignKeyBuilder, j as MySqlViewConfig } from '../session-2b625be5.mjs';
3
+ export { k as ForeignKey, I as InlineForeignKeys, y as ManualViewBuilder, b as MySqlDatabase, n as MySqlDelete, c as MySqlDialect, p as MySqlInsert, o as MySqlInsertBuilder, s as MySqlSelect, q as MySqlSelectBuilder, r as MySqlSelectQueryBuilder, M as MySqlSession, a as MySqlTransaction, u as MySqlUpdate, t as MySqlUpdateBuilder, A as MySqlView, z as MySqlViewBase, P as PreparedQuery, Q as QueryBuilder, x as ViewBuilder, V as ViewBuilderCore, l as foreignKey, v as mysqlTable, w as mysqlTableCreator, B as mysqlView } from '../session-2b625be5.mjs';
4
4
  import '../errors-bb636d84.mjs';
5
5
 
6
6
  function alias(table, alias) {
package/mysql2/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('../index.cjs');
4
- var session = require('../session-87d0ce9a.cjs');
5
- var relations = require('../relations-9f9994ca.cjs');
4
+ var session = require('../session-82204af3.cjs');
5
+ var relations = require('../relations-318e97e5.cjs');
6
6
  var node_events = require('node:events');
7
7
  require('../errors-d0192d62.cjs');
8
8
 
package/mysql2/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Connection as Connection$1, Pool as Pool$1 } from 'mysql2';
2
2
  import { L as Logger, Q as Query, a as SQL, ay as Assume, D as DrizzleConfig } from '../column.d-66a08b85.js';
3
- import { ae as PreparedQueryConfig, ah as PreparedQuery, a1 as SelectedFieldsOrdered, aj as MySqlSession, o as MySqlDialect, ag as PreparedQueryKind, ai as MySqlTransactionConfig, ak as MySqlTransaction, ac as QueryResultHKT, af as PreparedQueryHKT, n as MySqlDatabase } from '../select.types.d-2d1036d9.js';
4
- import { T as TablesRelationalConfig, R as RelationalSchemaConfig } from '../query-promise.d-afecc38e.js';
3
+ import { ae as PreparedQueryConfig, ah as PreparedQuery, a1 as SelectedFieldsOrdered, aj as MySqlSession, o as MySqlDialect, ag as PreparedQueryKind, ai as MySqlTransactionConfig, ak as MySqlTransaction, ac as QueryResultHKT, af as PreparedQueryHKT, n as MySqlDatabase } from '../select.types.d-e43b2599.js';
4
+ import { T as TablesRelationalConfig, R as RelationalSchemaConfig } from '../query-promise.d-d7b61248.js';
5
5
  import { Pool, Connection, ResultSetHeader, FieldPacket, RowDataPacket, OkPacket } from 'mysql2/promise';
6
6
  import '../select.types.d-1bd49d37.js';
7
7
  import '../migrator.js';
package/mysql2/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { NoopLogger, DefaultLogger } from '../index.mjs';
2
- import { P as PreparedQuery, M as MySqlSession, a as MySqlTransaction, b as MySqlDatabase, c as MySqlDialect } from '../session-7e0da329.mjs';
3
- import { f as fillPlaceholders, m as mapResultRow, s as sql, e as extractTablesRelationalConfig, c as createTableRelationsHelpers } from '../relations-8a5ba133.mjs';
2
+ import { P as PreparedQuery, M as MySqlSession, a as MySqlTransaction, b as MySqlDatabase, c as MySqlDialect } from '../session-2b625be5.mjs';
3
+ import { f as fillPlaceholders, m as mapResultRow, s as sql, e as extractTablesRelationalConfig, c as createTableRelationsHelpers } from '../relations-3eb6fe55.mjs';
4
4
  import { once } from 'node:events';
5
5
  import '../errors-bb636d84.mjs';
6
6
 
@@ -2,9 +2,9 @@ import { MigrationConfig } from '../migrator.js';
2
2
  import { MySql2Database } from './index.js';
3
3
  import 'mysql2';
4
4
  import '../column.d-66a08b85.js';
5
- import '../select.types.d-2d1036d9.js';
5
+ import '../select.types.d-e43b2599.js';
6
6
  import '../select.types.d-1bd49d37.js';
7
- import '../query-promise.d-afecc38e.js';
7
+ import '../query-promise.d-d7b61248.js';
8
8
  import 'mysql2/promise';
9
9
 
10
10
  declare function migrate<TSchema extends Record<string, unknown>>(db: MySql2Database<TSchema>, config: MigrationConfig): Promise<void>;
@@ -2,8 +2,8 @@
2
2
 
3
3
  var serverless = require('@neondatabase/serverless');
4
4
  var index = require('../index.cjs');
5
- var session = require('../session-6c2c5767.cjs');
6
- var relations = require('../relations-9f9994ca.cjs');
5
+ var session = require('../session-b2bd7eb4.cjs');
6
+ var relations = require('../relations-318e97e5.cjs');
7
7
  require('../errors-d0192d62.cjs');
8
8
 
9
9
  class NeonPreparedQuery extends session.PreparedQuery {
@@ -1,6 +1,6 @@
1
1
  import { L as Logger, Q as Query, ay as Assume, D as DrizzleConfig } from '../column.d-66a08b85.js';
2
- import { ah as PreparedQueryConfig, ai as PreparedQuery, a6 as SelectedFieldsOrdered, ak as PgSession, u as PgDialect, aj as PgTransactionConfig, al as PgTransaction, am as QueryResultHKT, t as PgDatabase } from '../db.d-89e25221.js';
3
- import { T as TablesRelationalConfig, R as RelationalSchemaConfig } from '../query-promise.d-afecc38e.js';
2
+ import { ah as PreparedQueryConfig, ai as PreparedQuery, a6 as SelectedFieldsOrdered, ak as PgSession, u as PgDialect, aj as PgTransactionConfig, al as PgTransaction, am as QueryResultHKT, t as PgDatabase } from '../db.d-a6fe1b19.js';
3
+ import { T as TablesRelationalConfig, R as RelationalSchemaConfig } from '../query-promise.d-d7b61248.js';
4
4
  import { Pool, PoolClient, Client, QueryResult, QueryResultRow } from '@neondatabase/serverless';
5
5
  import '../migrator.js';
6
6
  import '../select.types.d-1bd49d37.js';
@@ -1,7 +1,7 @@
1
1
  import { Pool, types } from '@neondatabase/serverless';
2
2
  import { NoopLogger, DefaultLogger } from '../index.mjs';
3
- import { P as PreparedQuery, a as PgSession, b as PgTransaction, c as PgDatabase } from '../session-4242e73a.mjs';
4
- import { f as fillPlaceholders, m as mapResultRow, s as sql, e as extractTablesRelationalConfig, c as createTableRelationsHelpers, P as PgDialect } from '../relations-8a5ba133.mjs';
3
+ import { P as PreparedQuery, a as PgSession, b as PgTransaction, c as PgDatabase } from '../session-deaaed1f.mjs';
4
+ import { f as fillPlaceholders, m as mapResultRow, s as sql, e as extractTablesRelationalConfig, c as createTableRelationsHelpers, P as PgDialect } from '../relations-3eb6fe55.mjs';
5
5
  import '../errors-bb636d84.mjs';
6
6
 
7
7
  class NeonPreparedQuery extends PreparedQuery {
@@ -1,8 +1,8 @@
1
1
  import { MigrationConfig } from '../migrator.js';
2
2
  import { NeonDatabase } from './index.js';
3
3
  import '../column.d-66a08b85.js';
4
- import '../db.d-89e25221.js';
5
- import '../query-promise.d-afecc38e.js';
4
+ import '../db.d-a6fe1b19.js';
5
+ import '../query-promise.d-d7b61248.js';
6
6
  import '../select.types.d-1bd49d37.js';
7
7
  import '@neondatabase/serverless';
8
8
 
@@ -2,8 +2,8 @@
2
2
 
3
3
  var pg = require('pg');
4
4
  var index = require('../index.cjs');
5
- var session = require('../session-6c2c5767.cjs');
6
- var relations = require('../relations-9f9994ca.cjs');
5
+ var session = require('../session-b2bd7eb4.cjs');
6
+ var relations = require('../relations-318e97e5.cjs');
7
7
  require('../errors-d0192d62.cjs');
8
8
 
9
9
  const { Pool } = pg;
@@ -1,6 +1,6 @@
1
1
  import { L as Logger, Q as Query, ay as Assume, D as DrizzleConfig } from '../column.d-66a08b85.js';
2
- import { ah as PreparedQueryConfig, ai as PreparedQuery, a6 as SelectedFieldsOrdered, ak as PgSession, u as PgDialect, aj as PgTransactionConfig, al as PgTransaction, am as QueryResultHKT, t as PgDatabase } from '../db.d-89e25221.js';
3
- import { T as TablesRelationalConfig, R as RelationalSchemaConfig } from '../query-promise.d-afecc38e.js';
2
+ import { ah as PreparedQueryConfig, ai as PreparedQuery, a6 as SelectedFieldsOrdered, ak as PgSession, u as PgDialect, aj as PgTransactionConfig, al as PgTransaction, am as QueryResultHKT, t as PgDatabase } from '../db.d-a6fe1b19.js';
3
+ import { T as TablesRelationalConfig, R as RelationalSchemaConfig } from '../query-promise.d-d7b61248.js';
4
4
  import pg, { PoolClient, Client, QueryResult, QueryResultRow } from 'pg';
5
5
  import '../migrator.js';
6
6
  import '../select.types.d-1bd49d37.js';
@@ -1,7 +1,7 @@
1
1
  import pg from 'pg';
2
2
  import { NoopLogger, DefaultLogger } from '../index.mjs';
3
- import { P as PreparedQuery, a as PgSession, b as PgTransaction, c as PgDatabase } from '../session-4242e73a.mjs';
4
- import { t as tracer, f as fillPlaceholders, m as mapResultRow, s as sql, e as extractTablesRelationalConfig, c as createTableRelationsHelpers, P as PgDialect } from '../relations-8a5ba133.mjs';
3
+ import { P as PreparedQuery, a as PgSession, b as PgTransaction, c as PgDatabase } from '../session-deaaed1f.mjs';
4
+ import { t as tracer, f as fillPlaceholders, m as mapResultRow, s as sql, e as extractTablesRelationalConfig, c as createTableRelationsHelpers, P as PgDialect } from '../relations-3eb6fe55.mjs';
5
5
  import '../errors-bb636d84.mjs';
6
6
 
7
7
  const { Pool } = pg;
@@ -1,8 +1,8 @@
1
1
  import { MigrationConfig } from '../migrator.js';
2
2
  import { NodePgDatabase } from './index.js';
3
3
  import '../column.d-66a08b85.js';
4
- import '../db.d-89e25221.js';
5
- import '../query-promise.d-afecc38e.js';
4
+ import '../db.d-a6fe1b19.js';
5
+ import '../query-promise.d-d7b61248.js';
6
6
  import '../select.types.d-1bd49d37.js';
7
7
  import 'pg';
8
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-orm",
3
- "version": "0.26.3-cfa5f49",
3
+ "version": "0.26.4",
4
4
  "description": "Drizzle ORM package for SQL databases",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -156,5 +156,211 @@
156
156
  "vitest": "^0.31.1",
157
157
  "zod": "^3.20.2",
158
158
  "zx": "^7.2.2"
159
+ },
160
+ "exports": {
161
+ ".": {
162
+ "types": "./index.d.ts",
163
+ "import": "./index.mjs",
164
+ "require": "./index.cjs",
165
+ "default": "./index.mjs"
166
+ },
167
+ "./aws-data-api/pg": {
168
+ "types": "./aws-data-api/pg/index.d.ts",
169
+ "import": "./aws-data-api/pg/index.mjs",
170
+ "require": "./aws-data-api/pg/index.cjs",
171
+ "default": "./aws-data-api/pg/index.mjs"
172
+ },
173
+ "./aws-data-api/pg/migrator": {
174
+ "types": "./aws-data-api/pg/migrator.d.ts",
175
+ "import": "./aws-data-api/pg/migrator.mjs",
176
+ "require": "./aws-data-api/pg/migrator.cjs",
177
+ "default": "./aws-data-api/pg/migrator.mjs"
178
+ },
179
+ "./better-sqlite3": {
180
+ "types": "./better-sqlite3/index.d.ts",
181
+ "import": "./better-sqlite3/index.mjs",
182
+ "require": "./better-sqlite3/index.cjs",
183
+ "default": "./better-sqlite3/index.mjs"
184
+ },
185
+ "./better-sqlite3/migrator": {
186
+ "types": "./better-sqlite3/migrator.d.ts",
187
+ "import": "./better-sqlite3/migrator.mjs",
188
+ "require": "./better-sqlite3/migrator.cjs",
189
+ "default": "./better-sqlite3/migrator.mjs"
190
+ },
191
+ "./bun-sqlite": {
192
+ "types": "./bun-sqlite/index.d.ts",
193
+ "import": "./bun-sqlite/index.mjs",
194
+ "require": "./bun-sqlite/index.cjs",
195
+ "default": "./bun-sqlite/index.mjs"
196
+ },
197
+ "./bun-sqlite/migrator": {
198
+ "types": "./bun-sqlite/migrator.d.ts",
199
+ "import": "./bun-sqlite/migrator.mjs",
200
+ "require": "./bun-sqlite/migrator.cjs",
201
+ "default": "./bun-sqlite/migrator.mjs"
202
+ },
203
+ "./d1": {
204
+ "types": "./d1/index.d.ts",
205
+ "import": "./d1/index.mjs",
206
+ "require": "./d1/index.cjs",
207
+ "default": "./d1/index.mjs"
208
+ },
209
+ "./d1/migrator": {
210
+ "types": "./d1/migrator.d.ts",
211
+ "import": "./d1/migrator.mjs",
212
+ "require": "./d1/migrator.cjs",
213
+ "default": "./d1/migrator.mjs"
214
+ },
215
+ "./vercel-postgres/migrator": {
216
+ "types": "./vercel-postgres/migrator.d.ts",
217
+ "import": "./vercel-postgres/migrator.mjs",
218
+ "require": "./vercel-postgres/migrator.cjs",
219
+ "default": "./vercel-postgres/migrator.mjs"
220
+ },
221
+ "./vercel-postgres": {
222
+ "types": "./vercel-postgres/index.d.ts",
223
+ "import": "./vercel-postgres/index.mjs",
224
+ "require": "./vercel-postgres/index.cjs",
225
+ "default": "./vercel-postgres/index.mjs"
226
+ },
227
+ "./knex": {
228
+ "types": "./knex/index.d.ts",
229
+ "import": "./knex/index.mjs",
230
+ "require": "./knex/index.cjs",
231
+ "default": "./knex/index.mjs"
232
+ },
233
+ "./kysely": {
234
+ "types": "./kysely/index.d.ts",
235
+ "import": "./kysely/index.mjs",
236
+ "require": "./kysely/index.cjs",
237
+ "default": "./kysely/index.mjs"
238
+ },
239
+ "./libsql": {
240
+ "types": "./libsql/index.d.ts",
241
+ "import": "./libsql/index.mjs",
242
+ "require": "./libsql/index.cjs",
243
+ "default": "./libsql/index.mjs"
244
+ },
245
+ "./libsql/migrator": {
246
+ "types": "./libsql/migrator.d.ts",
247
+ "import": "./libsql/migrator.mjs",
248
+ "require": "./libsql/migrator.cjs",
249
+ "default": "./libsql/migrator.mjs"
250
+ },
251
+ "./mysql-core": {
252
+ "types": "./mysql-core/index.d.ts",
253
+ "import": "./mysql-core/index.mjs",
254
+ "require": "./mysql-core/index.cjs",
255
+ "default": "./mysql-core/index.mjs"
256
+ },
257
+ "./mysql2": {
258
+ "types": "./mysql2/index.d.ts",
259
+ "import": "./mysql2/index.mjs",
260
+ "require": "./mysql2/index.cjs",
261
+ "default": "./mysql2/index.mjs"
262
+ },
263
+ "./mysql2/migrator": {
264
+ "types": "./mysql2/migrator.d.ts",
265
+ "import": "./mysql2/migrator.mjs",
266
+ "require": "./mysql2/migrator.cjs",
267
+ "default": "./mysql2/migrator.mjs"
268
+ },
269
+ "./neon-serverless": {
270
+ "types": "./neon-serverless/index.d.ts",
271
+ "import": "./neon-serverless/index.mjs",
272
+ "require": "./neon-serverless/index.cjs",
273
+ "default": "./neon-serverless/index.mjs"
274
+ },
275
+ "./neon-serverless/migrator": {
276
+ "types": "./neon-serverless/migrator.d.ts",
277
+ "import": "./neon-serverless/migrator.mjs",
278
+ "require": "./neon-serverless/migrator.cjs",
279
+ "default": "./neon-serverless/migrator.mjs"
280
+ },
281
+ "./node-postgres": {
282
+ "types": "./node-postgres/index.d.ts",
283
+ "import": "./node-postgres/index.mjs",
284
+ "require": "./node-postgres/index.cjs",
285
+ "default": "./node-postgres/index.mjs"
286
+ },
287
+ "./node-postgres/migrator": {
288
+ "types": "./node-postgres/migrator.d.ts",
289
+ "import": "./node-postgres/migrator.mjs",
290
+ "require": "./node-postgres/migrator.cjs",
291
+ "default": "./node-postgres/migrator.mjs"
292
+ },
293
+ "./pg-core": {
294
+ "types": "./pg-core/index.d.ts",
295
+ "import": "./pg-core/index.mjs",
296
+ "require": "./pg-core/index.cjs",
297
+ "default": "./pg-core/index.mjs"
298
+ },
299
+ "./planetscale-serverless": {
300
+ "types": "./planetscale-serverless/index.d.ts",
301
+ "import": "./planetscale-serverless/index.mjs",
302
+ "require": "./planetscale-serverless/index.cjs",
303
+ "default": "./planetscale-serverless/index.mjs"
304
+ },
305
+ "./planetscale-serverless/migrator": {
306
+ "types": "./planetscale-serverless/migrator.d.ts",
307
+ "import": "./planetscale-serverless/migrator.mjs",
308
+ "require": "./planetscale-serverless/migrator.cjs",
309
+ "default": "./planetscale-serverless/migrator.mjs"
310
+ },
311
+ "./postgres-js": {
312
+ "types": "./postgres-js/index.d.ts",
313
+ "import": "./postgres-js/index.mjs",
314
+ "require": "./postgres-js/index.cjs",
315
+ "default": "./postgres-js/index.mjs"
316
+ },
317
+ "./postgres-js/migrator": {
318
+ "types": "./postgres-js/migrator.d.ts",
319
+ "import": "./postgres-js/migrator.mjs",
320
+ "require": "./postgres-js/migrator.cjs",
321
+ "default": "./postgres-js/migrator.mjs"
322
+ },
323
+ "./sql-js": {
324
+ "types": "./sql-js/index.d.ts",
325
+ "import": "./sql-js/index.mjs",
326
+ "require": "./sql-js/index.cjs",
327
+ "default": "./sql-js/index.mjs"
328
+ },
329
+ "./sql-js/migrator": {
330
+ "types": "./sql-js/migrator.d.ts",
331
+ "import": "./sql-js/migrator.mjs",
332
+ "require": "./sql-js/migrator.cjs",
333
+ "default": "./sql-js/migrator.mjs"
334
+ },
335
+ "./sqlite-core": {
336
+ "types": "./sqlite-core/index.d.ts",
337
+ "import": "./sqlite-core/index.mjs",
338
+ "require": "./sqlite-core/index.cjs",
339
+ "default": "./sqlite-core/index.mjs"
340
+ },
341
+ "./sqlite-proxy": {
342
+ "types": "./sqlite-proxy/index.d.ts",
343
+ "import": "./sqlite-proxy/index.mjs",
344
+ "require": "./sqlite-proxy/index.cjs",
345
+ "default": "./sqlite-proxy/index.mjs"
346
+ },
347
+ "./sqlite-proxy/migrator": {
348
+ "types": "./sqlite-proxy/migrator.d.ts",
349
+ "import": "./sqlite-proxy/migrator.mjs",
350
+ "require": "./sqlite-proxy/migrator.cjs",
351
+ "default": "./sqlite-proxy/migrator.mjs"
352
+ },
353
+ "./migrator": {
354
+ "types": "./migrator.d.ts",
355
+ "import": "./migrator.mjs",
356
+ "require": "./migrator.cjs",
357
+ "default": "./migrator.mjs"
358
+ },
359
+ "./version": {
360
+ "types": "./version.d.ts",
361
+ "import": "./version.mjs",
362
+ "require": "./version.cjs",
363
+ "default": "./version.mjs"
364
+ }
159
365
  }
160
366
  }
package/pg-core/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var relations = require('../relations-9f9994ca.cjs');
4
- var session = require('../session-6c2c5767.cjs');
3
+ var relations = require('../relations-318e97e5.cjs');
4
+ var session = require('../session-b2bd7eb4.cjs');
5
5
  require('../errors-d0192d62.cjs');
6
6
 
7
7
  function alias(table, alias) {
@@ -1,8 +1,8 @@
1
- import { P as PgColumnBuilder, a as PgColumn, A as AnyPgTable, B as BuildAliasTable, b as PgTableFn, p as pgView, c as pgMaterializedView, d as AnyPgColumn, I as Index, F as ForeignKey, C as Check, e as PrimaryKey, f as PgView, V as ViewWithConfig, g as PgMaterializedView, h as PgMaterializedViewWithConfig } from '../db.d-89e25221.js';
2
- export { x as AnyForeignKeyBuilder, E as AnyIndexBuilder, r as AnyPgColumnBuilder, s as AnyPgColumnHKT, a1 as AnyPgSelect, at as AnyPgTableHKT, i as CheckBuilder, ax as DefaultViewBuilderCore, w as ForeignKeyBuilder, H as GetColumnsTableName, G as IndexBuilder, D as IndexBuilderOn, z as IndexColumn, a3 as JoinFn, a0 as JoinsValue, a8 as LockConfig, a7 as LockStrength, aC as ManualMaterializedViewBuilder, az as ManualViewBuilder, aB as MaterializedViewBuilder, aA as MaterializedViewBuilderCore, n as PgArray, m as PgArrayBuilder, k as PgArrayBuilderHKT, l as PgArrayHKT, o as PgColumnBuilderHKT, q as PgColumnHKT, t as PgDatabase, O as PgDelete, N as PgDeleteConfig, u as PgDialect, W as PgInsert, T as PgInsertBuilder, Q as PgInsertConfig, S as PgInsertValue, aG as PgMaterializedViewConfig, aH as PgMaterializedViewWithSelection, Y as PgRefreshMaterializedView, $ as PgSelect, Z as PgSelectBuilder, a2 as PgSelectConfig, ac as PgSelectHKT, a9 as PgSelectHKTBase, aa as PgSelectKind, _ as PgSelectQueryBuilder, ab as PgSelectQueryBuilderHKT, ak as PgSession, as as PgTable, aq as PgTableExtraConfig, au as PgTableWithColumns, al as PgTransaction, aj as PgTransactionConfig, ag as PgUpdate, af as PgUpdateBuilder, ad as PgUpdateConfig, ae as PgUpdateSetSource, aD as PgViewBase, aE as PgViewConfig, aF as PgViewWithSelection, ai as PreparedQuery, ah as PreparedQueryConfig, M as PrimaryKeyBuilder, X as QueryBuilder, am as QueryResultHKT, an as QueryResultKind, v as Reference, R as ReferenceConfig, a5 as SelectedFields, a4 as SelectedFieldsFlat, a6 as SelectedFieldsOrdered, ao as SubqueryWithSelection, ar as TableConfig, U as UpdateDeleteAction, ay as ViewBuilder, ap as WithSubqueryWithSelection, j as check, y as foreignKey, J as index, av as pgTable, aw as pgTableCreator, L as primaryKey, K as uniqueIndex } from '../db.d-89e25221.js';
1
+ import { P as PgColumnBuilder, a as PgColumn, A as AnyPgTable, B as BuildAliasTable, b as PgTableFn, p as pgView, c as pgMaterializedView, d as AnyPgColumn, I as Index, F as ForeignKey, C as Check, e as PrimaryKey, f as PgView, V as ViewWithConfig, g as PgMaterializedView, h as PgMaterializedViewWithConfig } from '../db.d-a6fe1b19.js';
2
+ export { x as AnyForeignKeyBuilder, E as AnyIndexBuilder, r as AnyPgColumnBuilder, s as AnyPgColumnHKT, a1 as AnyPgSelect, at as AnyPgTableHKT, i as CheckBuilder, ax as DefaultViewBuilderCore, w as ForeignKeyBuilder, H as GetColumnsTableName, G as IndexBuilder, D as IndexBuilderOn, z as IndexColumn, a3 as JoinFn, a0 as JoinsValue, a8 as LockConfig, a7 as LockStrength, aC as ManualMaterializedViewBuilder, az as ManualViewBuilder, aB as MaterializedViewBuilder, aA as MaterializedViewBuilderCore, n as PgArray, m as PgArrayBuilder, k as PgArrayBuilderHKT, l as PgArrayHKT, o as PgColumnBuilderHKT, q as PgColumnHKT, t as PgDatabase, O as PgDelete, N as PgDeleteConfig, u as PgDialect, W as PgInsert, T as PgInsertBuilder, Q as PgInsertConfig, S as PgInsertValue, aG as PgMaterializedViewConfig, aH as PgMaterializedViewWithSelection, Y as PgRefreshMaterializedView, $ as PgSelect, Z as PgSelectBuilder, a2 as PgSelectConfig, ac as PgSelectHKT, a9 as PgSelectHKTBase, aa as PgSelectKind, _ as PgSelectQueryBuilder, ab as PgSelectQueryBuilderHKT, ak as PgSession, as as PgTable, aq as PgTableExtraConfig, au as PgTableWithColumns, al as PgTransaction, aj as PgTransactionConfig, ag as PgUpdate, af as PgUpdateBuilder, ad as PgUpdateConfig, ae as PgUpdateSetSource, aD as PgViewBase, aE as PgViewConfig, aF as PgViewWithSelection, ai as PreparedQuery, ah as PreparedQueryConfig, M as PrimaryKeyBuilder, X as QueryBuilder, am as QueryResultHKT, an as QueryResultKind, v as Reference, R as ReferenceConfig, a5 as SelectedFields, a4 as SelectedFieldsFlat, a6 as SelectedFieldsOrdered, ao as SubqueryWithSelection, ar as TableConfig, U as UpdateDeleteAction, ay as ViewBuilder, ap as WithSubqueryWithSelection, j as check, y as foreignKey, J as index, av as pgTable, aw as pgTableCreator, L as primaryKey, K as uniqueIndex } from '../db.d-a6fe1b19.js';
3
3
  import { n as ColumnBuilderHKTBase, ay as Assume, k as ColumnBuilderBaseConfig, c as ColumnHKTBase, C as ColumnBaseConfig, W as WithEnum, aF as Writable, S as Simplify, az as Equal, a as SQL, o as ColumnBuilderKind, F as SelectedFields, A as AnyColumn, T as Table, ak as TableConfig } from '../column.d-66a08b85.js';
4
4
  import '../migrator.js';
5
- import '../query-promise.d-afecc38e.js';
5
+ import '../query-promise.d-d7b61248.js';
6
6
  import '../select.types.d-1bd49d37.js';
7
7
 
8
8
  interface PgBigInt53BuilderHKT extends ColumnBuilderHKTBase {
package/pg-core/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { K as TableAliasProxyHandler, L as PgColumnBuilder, M as PgColumn, N as pgTableWithSchema, O as pgViewWithSchema, U as pgMaterializedViewWithSchema } from '../relations-8a5ba133.mjs';
2
- export { Y as Check, X as CheckBuilder, aN as DefaultViewBuilderCore, ar as ForeignKey, aq as ForeignKeyBuilder, av as Index, au as IndexBuilder, at as IndexBuilderOn, aD as InlineForeignKeys, aS as ManualMaterializedViewBuilder, aP as ManualViewBuilder, aR as MaterializedViewBuilder, aQ as MaterializedViewBuilderCore, $ as PgArray, _ as PgArrayBuilder, a1 as PgDate, a0 as PgDateBuilder, a3 as PgDateString, a2 as PgDateStringBuilder, P as PgDialect, a6 as PgJson, a5 as PgJsonBuilder, a9 as PgJsonb, a8 as PgJsonbBuilder, aX as PgMaterializedView, aW as PgMaterializedViewConfig, ac as PgNumeric, ab as PgNumericBuilder, aC as PgSelect, i as PgSelectBuilder, aB as PgSelectQueryBuilder, aE as PgTable, ag as PgTime, af as PgTimeBuilder, aj as PgTimestamp, ai as PgTimestampBuilder, al as PgTimestampString, ak as PgTimestampStringBuilder, ao as PgUUID, an as PgUUIDBuilder, aV as PgView, aT as PgViewBase, aU as PgViewConfig, aA as PrimaryKey, az as PrimaryKeyBuilder, g as QueryBuilder, aO as ViewBuilder, Z as check, a4 as date, ae as decimal, as as foreignKey, aJ as getMaterializedViewConfig, aH as getTableConfig, aI as getViewConfig, aw as index, a7 as json, aa as jsonb, aM as makePgArray, ad as numeric, aL as parsePgArray, aK as parsePgNestedArray, aZ as pgMaterializedView, aF as pgTable, aG as pgTableCreator, aY as pgView, ay as primaryKey, ah as time, am as timestamp, ax as uniqueIndex, ap as uuid } from '../relations-8a5ba133.mjs';
3
- export { c as PgDatabase, d as PgDelete, f as PgInsert, e as PgInsertBuilder, g as PgRefreshMaterializedView, a as PgSession, b as PgTransaction, i as PgUpdate, h as PgUpdateBuilder, P as PreparedQuery } from '../session-4242e73a.mjs';
1
+ import { K as TableAliasProxyHandler, L as PgColumnBuilder, M as PgColumn, N as pgTableWithSchema, O as pgViewWithSchema, U as pgMaterializedViewWithSchema } from '../relations-3eb6fe55.mjs';
2
+ export { Y as Check, X as CheckBuilder, aN as DefaultViewBuilderCore, ar as ForeignKey, aq as ForeignKeyBuilder, av as Index, au as IndexBuilder, at as IndexBuilderOn, aD as InlineForeignKeys, aS as ManualMaterializedViewBuilder, aP as ManualViewBuilder, aR as MaterializedViewBuilder, aQ as MaterializedViewBuilderCore, $ as PgArray, _ as PgArrayBuilder, a1 as PgDate, a0 as PgDateBuilder, a3 as PgDateString, a2 as PgDateStringBuilder, P as PgDialect, a6 as PgJson, a5 as PgJsonBuilder, a9 as PgJsonb, a8 as PgJsonbBuilder, aX as PgMaterializedView, aW as PgMaterializedViewConfig, ac as PgNumeric, ab as PgNumericBuilder, aC as PgSelect, i as PgSelectBuilder, aB as PgSelectQueryBuilder, aE as PgTable, ag as PgTime, af as PgTimeBuilder, aj as PgTimestamp, ai as PgTimestampBuilder, al as PgTimestampString, ak as PgTimestampStringBuilder, ao as PgUUID, an as PgUUIDBuilder, aV as PgView, aT as PgViewBase, aU as PgViewConfig, aA as PrimaryKey, az as PrimaryKeyBuilder, g as QueryBuilder, aO as ViewBuilder, Z as check, a4 as date, ae as decimal, as as foreignKey, aJ as getMaterializedViewConfig, aH as getTableConfig, aI as getViewConfig, aw as index, a7 as json, aa as jsonb, aM as makePgArray, ad as numeric, aL as parsePgArray, aK as parsePgNestedArray, aZ as pgMaterializedView, aF as pgTable, aG as pgTableCreator, aY as pgView, ay as primaryKey, ah as time, am as timestamp, ax as uniqueIndex, ap as uuid } from '../relations-3eb6fe55.mjs';
3
+ export { c as PgDatabase, d as PgDelete, f as PgInsert, e as PgInsertBuilder, g as PgRefreshMaterializedView, a as PgSession, b as PgTransaction, i as PgUpdate, h as PgUpdateBuilder, P as PreparedQuery } from '../session-deaaed1f.mjs';
4
4
  import '../errors-bb636d84.mjs';
5
5
 
6
6
  function alias(table, alias) {
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('../index.cjs');
4
- var session = require('../session-87d0ce9a.cjs');
5
- var relations = require('../relations-9f9994ca.cjs');
4
+ var session = require('../session-82204af3.cjs');
5
+ var relations = require('../relations-318e97e5.cjs');
6
6
  require('../errors-d0192d62.cjs');
7
7
 
8
8
  class PlanetScalePreparedQuery extends session.PreparedQuery {
@@ -1,7 +1,7 @@
1
1
  import { Connection, Transaction, ExecutedQuery } from '@planetscale/database';
2
2
  import { L as Logger, Q as Query, a as SQL, ay as Assume, D as DrizzleConfig } from '../column.d-66a08b85.js';
3
- import { ae as PreparedQueryConfig, ah as PreparedQuery, a1 as SelectedFieldsOrdered, aj as MySqlSession, o as MySqlDialect, ak as MySqlTransaction, ac as QueryResultHKT, af as PreparedQueryHKT, n as MySqlDatabase } from '../select.types.d-2d1036d9.js';
4
- import { T as TablesRelationalConfig, R as RelationalSchemaConfig } from '../query-promise.d-afecc38e.js';
3
+ import { ae as PreparedQueryConfig, ah as PreparedQuery, a1 as SelectedFieldsOrdered, aj as MySqlSession, o as MySqlDialect, ak as MySqlTransaction, ac as QueryResultHKT, af as PreparedQueryHKT, n as MySqlDatabase } from '../select.types.d-e43b2599.js';
4
+ import { T as TablesRelationalConfig, R as RelationalSchemaConfig } from '../query-promise.d-d7b61248.js';
5
5
  import '../select.types.d-1bd49d37.js';
6
6
  import 'mysql2/promise';
7
7
  import '../migrator.js';
@@ -1,6 +1,6 @@
1
1
  import { NoopLogger, DefaultLogger } from '../index.mjs';
2
- import { P as PreparedQuery, M as MySqlSession, a as MySqlTransaction, b as MySqlDatabase, c as MySqlDialect } from '../session-7e0da329.mjs';
3
- import { f as fillPlaceholders, m as mapResultRow, s as sql, e as extractTablesRelationalConfig, c as createTableRelationsHelpers } from '../relations-8a5ba133.mjs';
2
+ import { P as PreparedQuery, M as MySqlSession, a as MySqlTransaction, b as MySqlDatabase, c as MySqlDialect } from '../session-2b625be5.mjs';
3
+ import { f as fillPlaceholders, m as mapResultRow, s as sql, e as extractTablesRelationalConfig, c as createTableRelationsHelpers } from '../relations-3eb6fe55.mjs';
4
4
  import '../errors-bb636d84.mjs';
5
5
 
6
6
  class PlanetScalePreparedQuery extends PreparedQuery {
@@ -2,9 +2,9 @@ import { MigrationConfig } from '../migrator.js';
2
2
  import { PlanetScaleDatabase } from './index.js';
3
3
  import '@planetscale/database';
4
4
  import '../column.d-66a08b85.js';
5
- import '../select.types.d-2d1036d9.js';
5
+ import '../select.types.d-e43b2599.js';
6
6
  import '../select.types.d-1bd49d37.js';
7
- import '../query-promise.d-afecc38e.js';
7
+ import '../query-promise.d-d7b61248.js';
8
8
  import 'mysql2/promise';
9
9
 
10
10
  declare function migrate<TSchema extends Record<string, unknown>>(db: PlanetScaleDatabase<TSchema>, config: MigrationConfig): Promise<void>;
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('../index.cjs');
4
- var session = require('../session-6c2c5767.cjs');
5
- var relations = require('../relations-9f9994ca.cjs');
4
+ var session = require('../session-b2bd7eb4.cjs');
5
+ var relations = require('../relations-318e97e5.cjs');
6
6
  require('../errors-d0192d62.cjs');
7
7
 
8
8
  class PostgresJsPreparedQuery extends session.PreparedQuery {
@@ -1,7 +1,7 @@
1
1
  import { Sql, RowList, Row, TransactionSql } from 'postgres';
2
- import { ah as PreparedQueryConfig, ai as PreparedQuery, a6 as SelectedFieldsOrdered, ak as PgSession, u as PgDialect, aj as PgTransactionConfig, al as PgTransaction, am as QueryResultHKT, t as PgDatabase } from '../db.d-89e25221.js';
2
+ import { ah as PreparedQueryConfig, ai as PreparedQuery, a6 as SelectedFieldsOrdered, ak as PgSession, u as PgDialect, aj as PgTransactionConfig, al as PgTransaction, am as QueryResultHKT, t as PgDatabase } from '../db.d-a6fe1b19.js';
3
3
  import { L as Logger, Q as Query, ay as Assume, D as DrizzleConfig } from '../column.d-66a08b85.js';
4
- import { T as TablesRelationalConfig, R as RelationalSchemaConfig } from '../query-promise.d-afecc38e.js';
4
+ import { T as TablesRelationalConfig, R as RelationalSchemaConfig } from '../query-promise.d-d7b61248.js';
5
5
  import '../migrator.js';
6
6
  import '../select.types.d-1bd49d37.js';
7
7
 
@@ -1,6 +1,6 @@
1
1
  import { NoopLogger, DefaultLogger } from '../index.mjs';
2
- import { P as PreparedQuery, a as PgSession, b as PgTransaction, c as PgDatabase } from '../session-4242e73a.mjs';
3
- import { t as tracer, f as fillPlaceholders, m as mapResultRow, e as extractTablesRelationalConfig, c as createTableRelationsHelpers, P as PgDialect } from '../relations-8a5ba133.mjs';
2
+ import { P as PreparedQuery, a as PgSession, b as PgTransaction, c as PgDatabase } from '../session-deaaed1f.mjs';
3
+ import { t as tracer, f as fillPlaceholders, m as mapResultRow, e as extractTablesRelationalConfig, c as createTableRelationsHelpers, P as PgDialect } from '../relations-3eb6fe55.mjs';
4
4
  import '../errors-bb636d84.mjs';
5
5
 
6
6
  class PostgresJsPreparedQuery extends PreparedQuery {
@@ -1,9 +1,9 @@
1
1
  import { MigrationConfig } from '../migrator.js';
2
2
  import { PostgresJsDatabase } from './index.js';
3
3
  import 'postgres';
4
- import '../db.d-89e25221.js';
4
+ import '../db.d-a6fe1b19.js';
5
5
  import '../column.d-66a08b85.js';
6
- import '../query-promise.d-afecc38e.js';
6
+ import '../query-promise.d-d7b61248.js';
7
7
  import '../select.types.d-1bd49d37.js';
8
8
 
9
9
  declare function migrate<TSchema extends Record<string, unknown>>(db: PostgresJsDatabase<TSchema>, config: string | MigrationConfig): Promise<void>;
@@ -604,7 +604,7 @@ interface BuildRelationalQueryResult {
604
604
  }[];
605
605
  sql: Table | SQL;
606
606
  }
607
- declare function mapRelationalRow(tablesConfig: TablesRelationalConfig, tableConfig: TableRelationalConfig, row: unknown[], buildQueryResultSelection: BuildRelationalQueryResult['selection'], jsonParseRelationalFields?: boolean, mapColumnValue?: (value: unknown) => unknown): Record<string, unknown>;
607
+ declare function mapRelationalRow(tablesConfig: TablesRelationalConfig, tableConfig: TableRelationalConfig, row: unknown[], buildQueryResultSelection: BuildRelationalQueryResult['selection'], mapColumnValue?: (value: unknown) => unknown): Record<string, unknown>;
608
608
 
609
609
  declare abstract class QueryPromise<T> implements Promise<T> {
610
610
  [Symbol.toStringTag]: string;
@@ -1698,7 +1698,14 @@ class PgDialect {
1698
1698
  if (selectedRelations.length > 1) {
1699
1699
  elseField.append(sql.raw('::text'));
1700
1700
  }
1701
- const field = sql `case when count(${sql.join(normalizedRelation.references.map((c) => aliasedTableColumn(c, relationAlias)), sql.raw(' or '))}) = 0 then '[]' else ${elseField} end`.as(selectedRelationKey);
1701
+ const countSql = normalizedRelation.references.length === 1
1702
+ ? aliasedTableColumn(normalizedRelation.references[0], relationAlias)
1703
+ : sql.fromList([
1704
+ sql `coalesce(`,
1705
+ sql.join(normalizedRelation.references.map((c) => aliasedTableColumn(c, relationAlias)), sql.raw(', ')),
1706
+ sql.raw(')'),
1707
+ ]);
1708
+ const field = sql `case when count(${countSql}) = 0 then '[]' else ${elseField} end`.as(selectedRelationKey);
1702
1709
  const builtRelationField = {
1703
1710
  path: [selectedRelationKey],
1704
1711
  field,
@@ -2950,22 +2957,20 @@ function createTableRelationsHelpers(sourceTable) {
2950
2957
  many: createMany(sourceTable),
2951
2958
  };
2952
2959
  }
2953
- function mapRelationalRow(tablesConfig, tableConfig, row, buildQueryResultSelection, jsonParseRelationalFields = false, mapColumnValue = (value) => value) {
2960
+ function mapRelationalRow(tablesConfig, tableConfig, row, buildQueryResultSelection, mapColumnValue = (value) => value) {
2954
2961
  const result = {};
2955
2962
  for (const [selectionItemIndex, selectionItem] of buildQueryResultSelection.entries()) {
2956
2963
  if (selectionItem.isJson) {
2957
2964
  const relation = tableConfig.relations[selectionItem.tsKey];
2958
- let subRows = row[selectionItemIndex];
2959
- if (jsonParseRelationalFields) {
2960
- subRows = JSON.parse(subRows);
2961
- }
2965
+ const rawSubRows = row[selectionItemIndex];
2966
+ const subRows = typeof rawSubRows === 'string' ? JSON.parse(rawSubRows) : rawSubRows;
2962
2967
  if (relation instanceof One) {
2963
2968
  result[selectionItem.tsKey] = subRows[0]
2964
- ? mapRelationalRow(tablesConfig, tablesConfig[selectionItem.tableTsKey], subRows[0], selectionItem.selection)
2969
+ ? mapRelationalRow(tablesConfig, tablesConfig[selectionItem.tableTsKey], subRows[0], selectionItem.selection, mapColumnValue)
2965
2970
  : null;
2966
2971
  }
2967
2972
  else {
2968
- result[selectionItem.tsKey] = subRows.map((subRow) => mapRelationalRow(tablesConfig, tablesConfig[selectionItem.tableTsKey], subRow, selectionItem.selection));
2973
+ result[selectionItem.tsKey] = subRows.map((subRow) => mapRelationalRow(tablesConfig, tablesConfig[selectionItem.tableTsKey], subRow, selectionItem.selection, mapColumnValue));
2969
2974
  }
2970
2975
  }
2971
2976
  else {
@@ -3151,4 +3156,4 @@ exports.timestamp = timestamp;
3151
3156
  exports.tracer = tracer;
3152
3157
  exports.uniqueIndex = uniqueIndex;
3153
3158
  exports.uuid = uuid;
3154
- //# sourceMappingURL=relations-9f9994ca.cjs.map
3159
+ //# sourceMappingURL=relations-318e97e5.cjs.map