drizzle-orm 0.26.3 → 0.26.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/aws-data-api/pg/index.cjs +21 -21
- package/aws-data-api/pg/index.cjs.map +1 -1
- package/aws-data-api/pg/index.d.ts +2 -2
- package/aws-data-api/pg/index.mjs +21 -21
- package/aws-data-api/pg/index.mjs.map +1 -1
- package/aws-data-api/pg/migrator.d.ts +2 -2
- package/better-sqlite3/index.cjs +2 -2
- package/better-sqlite3/index.d.ts +3 -3
- package/better-sqlite3/index.mjs +2 -2
- package/better-sqlite3/migrator.d.ts +3 -3
- package/bun-sqlite/index.cjs +2 -2
- package/bun-sqlite/index.d.ts +3 -3
- package/bun-sqlite/index.mjs +2 -2
- package/bun-sqlite/migrator.d.ts +3 -3
- package/d1/index.cjs +2 -2
- package/d1/index.d.ts +3 -3
- package/d1/index.mjs +2 -2
- package/d1/migrator.d.ts +3 -3
- package/{db.d-7539956f.d.ts → db.d-7fd2e787.d.ts} +1 -1
- package/{db.d-89e25221.d.ts → db.d-a6fe1b19.d.ts} +2 -2
- package/{driver.d-8de27d05.d.ts → driver.d-3c67c205.d.ts} +1 -1
- package/{driver.d-1d2954cc.d.ts → driver.d-63c391d1.d.ts} +1 -1
- package/{driver.d-238b678e.d.ts → driver.d-acac104e.d.ts} +1 -1
- package/{driver.d-1904bc39.d.ts → driver.d-c43a29fc.d.ts} +1 -1
- package/{driver.d-d334afe8.d.ts → driver.d-d68e216b.d.ts} +1 -1
- package/{driver.d-33a2c54d.d.ts → driver.d-ffc299cd.d.ts} +1 -1
- package/index.cjs +1 -1
- package/index.d.ts +2 -2
- package/index.mjs +1 -1
- package/libsql/index.cjs +2 -2
- package/libsql/index.d.ts +3 -3
- package/libsql/index.mjs +2 -2
- package/libsql/migrator.d.ts +3 -3
- package/mysql-core/index.cjs +2 -2
- package/mysql-core/index.d.ts +3 -3
- package/mysql-core/index.mjs +3 -3
- package/mysql2/index.cjs +2 -2
- package/mysql2/index.d.ts +2 -2
- package/mysql2/index.mjs +2 -2
- package/mysql2/migrator.d.ts +2 -2
- package/neon-serverless/index.cjs +2 -2
- package/neon-serverless/index.d.ts +2 -2
- package/neon-serverless/index.mjs +2 -2
- package/neon-serverless/migrator.d.ts +2 -2
- package/node-postgres/index.cjs +2 -2
- package/node-postgres/index.d.ts +2 -2
- package/node-postgres/index.mjs +2 -2
- package/node-postgres/migrator.d.ts +2 -2
- package/package.json +1 -1
- package/pg-core/index.cjs +2 -2
- package/pg-core/index.d.ts +3 -3
- package/pg-core/index.mjs +3 -3
- package/planetscale-serverless/index.cjs +2 -2
- package/planetscale-serverless/index.d.ts +2 -2
- package/planetscale-serverless/index.mjs +2 -2
- package/planetscale-serverless/migrator.d.ts +2 -2
- package/postgres-js/index.cjs +2 -2
- package/postgres-js/index.d.ts +2 -2
- package/postgres-js/index.mjs +2 -2
- package/postgres-js/migrator.d.ts +2 -2
- package/{query-promise.d-afecc38e.d.ts → query-promise.d-d7b61248.d.ts} +1 -1
- package/{relations-a33447ac.cjs → relations-318e97e5.cjs} +16 -10
- package/{relations-a33447ac.cjs.map → relations-318e97e5.cjs.map} +1 -1
- package/{relations-6119c494.mjs → relations-3eb6fe55.mjs} +16 -10
- package/{relations-6119c494.mjs.map → relations-3eb6fe55.mjs.map} +1 -1
- package/{select.types.d-2d1036d9.d.ts → select.types.d-e43b2599.d.ts} +1 -1
- package/{session-24c3db0f.mjs → session-2b625be5.mjs} +10 -3
- package/{session-24c3db0f.mjs.map → session-2b625be5.mjs.map} +1 -1
- package/{session-3d703cfa.cjs → session-82204af3.cjs} +10 -3
- package/{session-3d703cfa.cjs.map → session-82204af3.cjs.map} +1 -1
- package/{session-60d10544.cjs → session-835745d5.cjs} +11 -4
- package/{session-60d10544.cjs.map → session-835745d5.cjs.map} +1 -1
- package/{session-998b87fc.cjs → session-b2bd7eb4.cjs} +4 -4
- package/{session-998b87fc.cjs.map → session-b2bd7eb4.cjs.map} +1 -1
- package/{session-f0db3a8e.mjs → session-deaaed1f.mjs} +4 -4
- package/{session-f0db3a8e.mjs.map → session-deaaed1f.mjs.map} +1 -1
- package/{session-bca51b1c.mjs → session-e3a36009.mjs} +11 -4
- package/{session-bca51b1c.mjs.map → session-e3a36009.mjs.map} +1 -1
- package/sql-js/index.cjs +2 -2
- package/sql-js/index.d.ts +3 -3
- package/sql-js/index.mjs +2 -2
- package/sql-js/migrator.d.ts +3 -3
- package/sqlite-core/index.cjs +24 -2
- package/sqlite-core/index.cjs.map +1 -1
- package/sqlite-core/index.d.ts +29 -7
- package/sqlite-core/index.mjs +24 -4
- package/sqlite-core/index.mjs.map +1 -1
- package/sqlite-proxy/index.cjs +2 -2
- package/sqlite-proxy/index.d.ts +4 -4
- package/sqlite-proxy/index.mjs +2 -2
- package/sqlite-proxy/migrator.cjs +1 -1
- package/sqlite-proxy/migrator.d.ts +3 -3
- package/sqlite-proxy/migrator.mjs +1 -1
- package/vercel-postgres/index.cjs +2 -2
- package/vercel-postgres/index.d.ts +2 -2
- package/vercel-postgres/index.mjs +2 -2
- package/vercel-postgres/migrator.d.ts +2 -2
- package/version.cjs +1 -1
- package/version.d.ts +1 -1
- package/version.mjs +1 -1
package/mysql-core/index.d.ts
CHANGED
|
@@ -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-
|
|
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-
|
|
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-
|
|
5
|
+
import '../query-promise.d-d7b61248.js';
|
|
6
6
|
import 'mysql2/promise';
|
|
7
7
|
import '../migrator.js';
|
|
8
8
|
|
package/mysql-core/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { K as TableAliasProxyHandler, s as sql, T as Table, q as ViewBaseConfig } from '../relations-
|
|
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-
|
|
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-
|
|
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-
|
|
5
|
-
var relations = require('../relations-
|
|
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-
|
|
4
|
-
import { T as TablesRelationalConfig, R as RelationalSchemaConfig } from '../query-promise.d-
|
|
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-
|
|
3
|
-
import { f as fillPlaceholders, m as mapResultRow, s as sql, e as extractTablesRelationalConfig, c as createTableRelationsHelpers } from '../relations-
|
|
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
|
|
package/mysql2/migrator.d.ts
CHANGED
|
@@ -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-
|
|
5
|
+
import '../select.types.d-e43b2599.js';
|
|
6
6
|
import '../select.types.d-1bd49d37.js';
|
|
7
|
-
import '../query-promise.d-
|
|
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-
|
|
6
|
-
var relations = require('../relations-
|
|
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-
|
|
3
|
-
import { T as TablesRelationalConfig, R as RelationalSchemaConfig } from '../query-promise.d-
|
|
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-
|
|
4
|
-
import { f as fillPlaceholders, m as mapResultRow, s as sql, e as extractTablesRelationalConfig, c as createTableRelationsHelpers, P as PgDialect } from '../relations-
|
|
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-
|
|
5
|
-
import '../query-promise.d-
|
|
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
|
|
package/node-postgres/index.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var pg = require('pg');
|
|
4
4
|
var index = require('../index.cjs');
|
|
5
|
-
var session = require('../session-
|
|
6
|
-
var relations = require('../relations-
|
|
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;
|
package/node-postgres/index.d.ts
CHANGED
|
@@ -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-
|
|
3
|
-
import { T as TablesRelationalConfig, R as RelationalSchemaConfig } from '../query-promise.d-
|
|
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';
|
package/node-postgres/index.mjs
CHANGED
|
@@ -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-
|
|
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-
|
|
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-
|
|
5
|
-
import '../query-promise.d-
|
|
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
package/pg-core/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var relations = require('../relations-
|
|
4
|
-
var session = require('../session-
|
|
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) {
|
package/pg-core/index.d.ts
CHANGED
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
5
|
-
var relations = require('../relations-
|
|
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-
|
|
4
|
-
import { T as TablesRelationalConfig, R as RelationalSchemaConfig } from '../query-promise.d-
|
|
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-
|
|
3
|
-
import { f as fillPlaceholders, m as mapResultRow, s as sql, e as extractTablesRelationalConfig, c as createTableRelationsHelpers } from '../relations-
|
|
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-
|
|
5
|
+
import '../select.types.d-e43b2599.js';
|
|
6
6
|
import '../select.types.d-1bd49d37.js';
|
|
7
|
-
import '../query-promise.d-
|
|
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>;
|
package/postgres-js/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-
|
|
5
|
-
var relations = require('../relations-
|
|
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 {
|
package/postgres-js/index.d.ts
CHANGED
|
@@ -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-
|
|
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-
|
|
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
|
|
package/postgres-js/index.mjs
CHANGED
|
@@ -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-
|
|
3
|
-
import { t as tracer, f as fillPlaceholders, m as mapResultRow, e as extractTablesRelationalConfig, c as createTableRelationsHelpers, P as PgDialect } from '../relations-
|
|
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-
|
|
4
|
+
import '../db.d-a6fe1b19.js';
|
|
5
5
|
import '../column.d-66a08b85.js';
|
|
6
|
-
import '../query-promise.d-
|
|
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'],
|
|
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
|
|
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,
|
|
@@ -2925,7 +2932,8 @@ function normalizeRelation(schema, tableNamesMap, relation) {
|
|
|
2925
2932
|
}
|
|
2926
2933
|
const reverseRelations = [];
|
|
2927
2934
|
for (const referencedTableRelation of Object.values(referencedTableFields.relations)) {
|
|
2928
|
-
if ((relation.relationName &&
|
|
2935
|
+
if ((relation.relationName && relation !== referencedTableRelation
|
|
2936
|
+
&& referencedTableRelation.relationName === relation.relationName)
|
|
2929
2937
|
|| (!relation.relationName && referencedTableRelation.referencedTable === relation.sourceTable)) {
|
|
2930
2938
|
reverseRelations.push(referencedTableRelation);
|
|
2931
2939
|
}
|
|
@@ -2949,22 +2957,20 @@ function createTableRelationsHelpers(sourceTable) {
|
|
|
2949
2957
|
many: createMany(sourceTable),
|
|
2950
2958
|
};
|
|
2951
2959
|
}
|
|
2952
|
-
function mapRelationalRow(tablesConfig, tableConfig, row, buildQueryResultSelection,
|
|
2960
|
+
function mapRelationalRow(tablesConfig, tableConfig, row, buildQueryResultSelection, mapColumnValue = (value) => value) {
|
|
2953
2961
|
const result = {};
|
|
2954
2962
|
for (const [selectionItemIndex, selectionItem] of buildQueryResultSelection.entries()) {
|
|
2955
2963
|
if (selectionItem.isJson) {
|
|
2956
2964
|
const relation = tableConfig.relations[selectionItem.tsKey];
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
subRows = JSON.parse(subRows);
|
|
2960
|
-
}
|
|
2965
|
+
const rawSubRows = row[selectionItemIndex];
|
|
2966
|
+
const subRows = typeof rawSubRows === 'string' ? JSON.parse(rawSubRows) : rawSubRows;
|
|
2961
2967
|
if (relation instanceof One) {
|
|
2962
2968
|
result[selectionItem.tsKey] = subRows[0]
|
|
2963
|
-
? mapRelationalRow(tablesConfig, tablesConfig[selectionItem.tableTsKey], subRows[0], selectionItem.selection)
|
|
2969
|
+
? mapRelationalRow(tablesConfig, tablesConfig[selectionItem.tableTsKey], subRows[0], selectionItem.selection, mapColumnValue)
|
|
2964
2970
|
: null;
|
|
2965
2971
|
}
|
|
2966
2972
|
else {
|
|
2967
|
-
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));
|
|
2968
2974
|
}
|
|
2969
2975
|
}
|
|
2970
2976
|
else {
|
|
@@ -3150,4 +3156,4 @@ exports.timestamp = timestamp;
|
|
|
3150
3156
|
exports.tracer = tracer;
|
|
3151
3157
|
exports.uniqueIndex = uniqueIndex;
|
|
3152
3158
|
exports.uuid = uuid;
|
|
3153
|
-
//# sourceMappingURL=relations-
|
|
3159
|
+
//# sourceMappingURL=relations-318e97e5.cjs.map
|