pqb 0.61.7 → 0.61.9

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/dist/index.d.ts CHANGED
@@ -1567,7 +1567,18 @@ interface FnPickQueryResultAs {
1567
1567
  * Arguments of `join` methods (not `joinLateral`).
1568
1568
  * See {@link join}
1569
1569
  */
1570
- type JoinArgs<T extends PickQuerySelectableShapeRelationsWithDataAs, Arg extends JoinFirstArg<T>> = [on?: JoinCallback<T, Arg>] | (Arg extends PickQueryResultAs ? JoinQueryArgs<T, Arg> : Arg extends keyof T['withData'] ? JoinWithArgs<T, T['withData'][Arg]> : EmptyTuple);
1570
+ type JoinArgs<T extends PickQuerySelectableShapeRelationsWithDataAs, Arg extends JoinFirstArg<T>> = Arg extends PickQueryResultAs ? [
1571
+ conditions: {
1572
+ [K in JoinSelectable<Arg>]: keyof T['__selectable'] | Expression;
1573
+ } | Expression
1574
+ ] | [
1575
+ leftColumn: JoinSelectable<Arg> | Expression,
1576
+ rightColumn: keyof T['__selectable'] | Expression
1577
+ ] | [
1578
+ leftColumn: JoinSelectable<Arg> | Expression,
1579
+ op: string,
1580
+ rightColumn: keyof T['__selectable'] | Expression
1581
+ ] : Arg extends keyof T['withData'] ? JoinWithArgs<T, T['withData'][Arg]> : EmptyTuple;
1571
1582
  /**
1572
1583
  * Column names of the joined table that can be used to join.
1573
1584
  * Derived from 'result', not from 'shape',
@@ -1578,27 +1589,15 @@ type JoinArgs<T extends PickQuerySelectableShapeRelationsWithDataAs, Arg extends
1578
1589
  * And the selection becomes available to use in the `ON` and to select from the joined table.
1579
1590
  */
1580
1591
  type JoinSelectable<Q extends PickQueryResultAs> = keyof Q['result'] | `${Q['__as']}.${keyof Q['result'] & string}`;
1581
- type JoinQueryArgs<T extends PickQuerySelectable, Q extends PickQueryResultAs> = [
1592
+ type JoinWithArgs<T extends PickQuerySelectable, Arg extends WithDataItem> = [
1582
1593
  conditions: {
1583
- [K in JoinSelectable<Q>]: keyof T['__selectable'] | Expression;
1584
- } | Expression | true
1585
- ] | [
1586
- leftColumn: JoinSelectable<Q> | Expression,
1587
- rightColumn: keyof T['__selectable'] | Expression
1588
- ] | [
1589
- leftColumn: JoinSelectable<Q> | Expression,
1590
- op: string,
1591
- rightColumn: keyof T['__selectable'] | Expression
1592
- ];
1593
- type JoinWithArgs<T extends PickQuerySelectable, W extends WithDataItem> = [
1594
- conditions: {
1595
- [K in WithSelectable<W>]: keyof T['__selectable'] | Expression;
1594
+ [K in WithSelectable<Arg>]: keyof T['__selectable'] | Expression;
1596
1595
  } | Expression
1597
1596
  ] | [
1598
- leftColumn: WithSelectable<W> | Expression,
1597
+ leftColumn: WithSelectable<Arg> | Expression,
1599
1598
  rightColumn: keyof T['__selectable'] | Expression
1600
1599
  ] | [
1601
- leftColumn: WithSelectable<W> | Expression,
1600
+ leftColumn: WithSelectable<Arg> | Expression,
1602
1601
  op: string,
1603
1602
  rightColumn: keyof T['__selectable'] | Expression
1604
1603
  ];
@@ -1609,30 +1608,34 @@ type JoinResultRequireMain<T extends PickQuerySelectable, JoinedSelectable> = {
1609
1608
  * Result of all `join` methods, not `joinLateral`.
1610
1609
  * Adds joined table columns from its 'result' to the '__selectable' of the query.
1611
1610
  */
1612
- type JoinResult<T extends PickQuerySelectableResultReturnType, JoinedSelectable, RequireMain> = RequireMain extends true ? {
1613
- [K in keyof T]: K extends '__selectable' ? T['__selectable'] & JoinedSelectable : T[K];
1611
+ type JoinResult<T extends PickQuerySelectableRelationsResultReturnType, Joined extends PickQuerySelectableRelations, RequireMain> = RequireMain extends true ? {
1612
+ [K in keyof T]: K extends '__selectable' ? T['__selectable'] & Joined['__selectable'] : K extends 'relations' ? {
1613
+ [K in keyof T['relations'] | keyof Joined['relations']]: K extends keyof Joined['relations'] ? Joined['relations'][K] : T['relations'][K];
1614
+ } : T[K];
1614
1615
  } : {
1615
1616
  [K in keyof T]: K extends '__selectable' ? {
1616
1617
  [K in keyof T['__selectable']]: {
1617
1618
  as: T['__selectable'][K]['as'];
1618
1619
  column: Column.Modifiers.QueryColumnToNullable<T['__selectable'][K]['column']>;
1619
1620
  };
1620
- } & JoinedSelectable : K extends 'result' ? {
1621
+ } & Joined['__selectable'] : K extends 'result' ? {
1621
1622
  [K in keyof T['result']]: Column.Modifiers.QueryColumnToNullable<T['result'][K]>;
1622
1623
  } : K extends 'then' ? QueryThenByQuery<T, {
1623
1624
  [K in keyof T['result']]: Column.Modifiers.QueryColumnToNullable<T['result'][K]>;
1624
- }> : T[K];
1625
+ }> : K extends 'relations' ? {
1626
+ [K in keyof T['relations'] | keyof Joined['relations']]: K extends keyof Joined['relations'] ? Joined['relations'][K] : T['relations'][K];
1627
+ } : T[K];
1625
1628
  };
1626
1629
  /**
1627
1630
  * Calls {@link JoinResult} with either callback result, if join has a callback,
1628
1631
  * or with a query derived from the first join argument.
1629
1632
  */
1630
- type JoinResultFromArgs<T extends PickQuerySelectableResultRelationsWithDataReturnType, Arg, Args extends unknown[], RequireJoined, RequireMain> = JoinResult<T, Args[0] extends GenericJoinCallback ? JoinResultSelectable<ReturnType<Args[0]>['result'], ReturnType<Args[0]>['__as'], RequireJoined> : Arg extends PickQueryHasSelectResultShapeAs ? JoinResultSelectable<Arg['__hasSelect'] extends true ? Arg['result'] : Arg['shape'], Arg['__as'], RequireJoined> : Arg extends keyof T['relations'] ? JoinResultSelectable<T['relations'][Arg]['query']['shape'], T['relations'][Arg]['query']['__as'], RequireJoined> : Arg extends FirstArgCallback ? JoinResultSelectable<ReturnType<Arg>['shape'], ReturnType<Arg>['__as'], RequireJoined> : Arg extends keyof T['withData'] ? T['withData'][Arg] extends WithDataItem ? JoinResultSelectable<T['withData'][Arg]['shape'], T['withData'][Arg]['table'], RequireJoined> : never : never, RequireMain>;
1633
+ type JoinResultFromArgs<T extends PickQuerySelectableResultRelationsWithDataReturnType, Arg, Args extends unknown[], RequireJoined, RequireMain> = JoinResult<T, Args[0] extends GenericJoinCallback ? JoinResultSelectable<ReturnType<Args[0]>['result'], ReturnType<Args[0]>['__as'], ReturnType<Args[0]>['relations'], RequireJoined> : Arg extends PickQueryHasSelectResultShapeAsRelations ? JoinResultSelectable<Arg['__hasSelect'] extends true ? Arg['result'] : Arg['shape'], Arg['__as'], Arg['relations'], RequireJoined> : Arg extends keyof T['relations'] ? JoinResultSelectable<T['relations'][Arg]['query']['shape'], T['relations'][Arg]['query']['__as'], T['relations'][Arg]['query']['relations'], RequireJoined> : Arg extends FirstArgCallback ? JoinResultSelectable<ReturnType<Arg>['shape'], ReturnType<Arg>['__as'], ReturnType<Arg>['relations'], RequireJoined> : Arg extends keyof T['withData'] ? T['withData'][Arg] extends WithDataItem ? JoinResultSelectable<T['withData'][Arg]['shape'], T['withData'][Arg]['table'], EmptyObject, RequireJoined> : never : never, RequireMain>;
1631
1634
  interface GenericJoinCallback {
1632
- (...args: any[]): PickQueryResultAs;
1635
+ (...args: any[]): PickQueryResultAsRelations;
1633
1636
  }
1634
1637
  interface FirstArgCallback {
1635
- (...args: any[]): PickQueryShapeAs;
1638
+ (...args: any[]): PickQueryShapeAsRelations;
1636
1639
  }
1637
1640
  /**
1638
1641
  * Result of all `joinLateral` methods.
@@ -1642,7 +1645,7 @@ interface FirstArgCallback {
1642
1645
  * @param Arg - first arg of join, see {@link JoinFirstArg}
1643
1646
  * @param RequireJoined - when false, joined table shape will be mapped to make all columns optional
1644
1647
  */
1645
- type JoinLateralResult<T extends PickQuerySelectable, As extends string, Result extends Column.QueryColumns, RequireJoined> = JoinAddSelectable<T, JoinResultSelectable<Result, As, RequireJoined>>;
1648
+ type JoinLateralResult<T extends PickQuerySelectable, As extends string, Result extends Column.QueryColumns, JoinedRelations extends RelationsBase, RequireJoined> = JoinAddSelectable<T, JoinResultSelectable<Result, As, JoinedRelations, RequireJoined>>;
1646
1649
  /**
1647
1650
  * Build `selectable` type for joined table.
1648
1651
  *
@@ -1654,25 +1657,35 @@ type JoinLateralResult<T extends PickQuerySelectable, As extends string, Result
1654
1657
  * The resulting selectable receives all joined table columns prefixed with the table name or alias,
1655
1658
  * and a star prefixed with the table name or alias to select all joined columns.
1656
1659
  */
1657
- type JoinResultSelectable<Result extends Column.QueryColumns, As extends string, RequireJoined> = RequireJoined extends true ? {
1658
- [K in '*' | (keyof Result & string) as `${As}.${K}`]: K extends '*' ? {
1659
- as: As;
1660
- column: ColumnsShape.MapToObjectColumn<Result>;
1661
- } : {
1662
- as: K;
1663
- column: Result[K];
1660
+ type JoinResultSelectable<Result extends Column.QueryColumns, As extends string, JoinedRelations, RequireJoined> = RequireJoined extends true ? {
1661
+ __selectable: {
1662
+ [K in '*' | (keyof Result & string) as `${As}.${K}`]: K extends '*' ? {
1663
+ as: As;
1664
+ column: ColumnsShape.MapToObjectColumn<Result>;
1665
+ } : {
1666
+ as: K;
1667
+ column: Result[K];
1668
+ };
1669
+ };
1670
+ relations: {
1671
+ [K in keyof JoinedRelations & string as `${As}.${K}`]: JoinedRelations[K];
1664
1672
  };
1665
1673
  } : {
1666
- [K in '*' | (keyof Result & string) as `${As}.${K}`]: K extends '*' ? {
1667
- as: As;
1668
- column: ColumnsShape.MapToNullableObjectColumn<Result>;
1669
- } : {
1670
- as: K;
1671
- column: Column.Modifiers.QueryColumnToNullable<Result[K]>;
1674
+ __selectable: {
1675
+ [K in '*' | (keyof Result & string) as `${As}.${K}`]: K extends '*' ? {
1676
+ as: As;
1677
+ column: ColumnsShape.MapToNullableObjectColumn<Result>;
1678
+ } : {
1679
+ as: K;
1680
+ column: Column.Modifiers.QueryColumnToNullable<Result[K]>;
1681
+ };
1682
+ };
1683
+ relations: {
1684
+ [K in keyof JoinedRelations & string as `${As}.${K}`]: JoinedRelations[K];
1672
1685
  };
1673
1686
  };
1674
- type JoinAddSelectable<T extends PickQuerySelectable, Selectable> = {
1675
- [K in keyof T]: K extends '__selectable' ? T['__selectable'] & Selectable : T[K];
1687
+ type JoinAddSelectable<T extends PickQuerySelectable, Joined extends PickQuerySelectableRelations> = {
1688
+ [K in keyof T]: K extends '__selectable' ? T['__selectable'] & Joined['__selectable'] : T[K];
1676
1689
  };
1677
1690
  /**
1678
1691
  * Map the first argument of `join` or `joinLateral` to a query type.
@@ -1704,11 +1717,12 @@ interface JoinArgToQueryCallback {
1704
1717
  interface JoinCallback<T extends PickQuerySelectableShapeRelationsWithDataAs, Arg extends JoinFirstArg<T>> {
1705
1718
  (q: JoinQueryBuilder<T, JoinArgToQuery<T, Arg>>): IsQuery;
1706
1719
  }
1720
+ type JoinCallbackArgs<T extends PickQuerySelectableShapeRelationsWithDataAs, Arg extends JoinFirstArg<T>> = [cb?: JoinCallback<T, Arg> | true];
1707
1721
  /**
1708
1722
  * Type of {@link QueryJoin.join} query method.
1709
1723
  */
1710
1724
  interface JoinQueryMethod {
1711
- <T extends PickQuerySelectableResultRelationsWithDataReturnTypeShapeAs, Arg extends JoinFirstArg<T>, Args extends JoinArgs<T, Arg>>(this: T, arg: Arg, ...args: Args): JoinResultFromArgs<T, Arg, Args, true, true>;
1725
+ <T extends PickQuerySelectableResultRelationsWithDataReturnTypeShapeAs, Arg extends JoinFirstArg<T>, Cb extends JoinCallbackArgs<T, Arg>>(this: T, arg: Arg, ...args: Cb | JoinArgs<T, Arg>): JoinResultFromArgs<T, Arg, Cb, true, true>;
1712
1726
  }
1713
1727
  /**
1714
1728
  * After getting a query from a sub-query callback,
@@ -1735,9 +1749,9 @@ declare const _joinReturningArgs: <T extends PickQuerySelectableResultRelationsW
1735
1749
  * @param first - the first argument of join: join target
1736
1750
  * @param args - rest join arguments: columns to join with, or a callback
1737
1751
  */
1738
- declare const _join: <T extends PickQuerySelectableResultRelationsWithDataReturnTypeShapeAs, R extends PickQueryResult, RequireJoined extends boolean, RequireMain extends boolean>(query: T, require: RequireJoined, type: string, first: JoinFirstArg<never> | {
1752
+ declare const _join: (query: PickQuerySelectableResultRelationsWithDataReturnTypeShapeAs, require: boolean, type: string, first: JoinFirstArg<never> | {
1739
1753
  _internalJoin: Query;
1740
- }, args: JoinArgs<Query, JoinFirstArg<Query>>) => JoinResult<T, R, RequireMain>;
1754
+ }, args: JoinArgs<Query, JoinFirstArg<Query>>) => never;
1741
1755
  declare const _joinLateralProcessArg: (q: Query, arg: JoinFirstArg<any>, cb: (q: JoinQueryBuilder<PickQuerySelectableShape, PickQuerySelectableResultAs>) => {
1742
1756
  table: string;
1743
1757
  result: Column.QueryColumns;
@@ -1810,7 +1824,7 @@ declare class QueryJoin {
1810
1824
  * });
1811
1825
  * ```
1812
1826
  *
1813
- * # Joins
1827
+ * # join
1814
1828
  *
1815
1829
  * `join` methods allows to join other tables, relations by name, [with](/guide/advanced-queries#with) statements, sub queries.
1816
1830
  *
@@ -1851,41 +1865,10 @@ declare class QueryJoin {
1851
1865
  * }
1852
1866
  * ```
1853
1867
  *
1854
- * ## join
1855
- *
1856
1868
  * `join` is a method for SQL `JOIN`, which is equivalent to `INNER JOIN`, `LEFT INNERT JOIN`.
1857
1869
  *
1858
1870
  * When no matching record is found, it will skip records of the main table.
1859
1871
  *
1860
- * When joining the same table with the same condition more than once, duplicated joins will be ignored:
1861
- *
1862
- * ```ts
1863
- * // joining a relation
1864
- * db.post.join('comments').join('comments');
1865
- *
1866
- * // joining a table with a condition
1867
- * db.post
1868
- * .join('comments', 'comments.postId', 'post.id')
1869
- * .join('comments', 'comments.postId', 'post.id');
1870
- * ```
1871
- *
1872
- * Both queries will produce SQL with only 1 join
1873
- *
1874
- * ```sql
1875
- * SELECT * FROM post JOIN comments ON comments.postId = post.id
1876
- * ```
1877
- *
1878
- * However, this is only possible if the join has no dynamic values:
1879
- *
1880
- * ```ts
1881
- * db.post
1882
- * .join('comments', (q) => q.where({ rating: { gt: 5 } }))
1883
- * .join('comments', (q) => q.where({ rating: { gt: 5 } }));
1884
- * ```
1885
- *
1886
- * Both joins above have the same `{ gt: 5 }`, but still, the `5` is a dynamic value and in this case joins will be duplicated,
1887
- * resulting in a database error.
1888
- *
1889
1872
  * ### join relation
1890
1873
  *
1891
1874
  * When relations are defined between the tables, you can join them by a relation name.
@@ -1928,7 +1911,58 @@ declare class QueryJoin {
1928
1911
  * );
1929
1912
  * ```
1930
1913
  *
1931
- * ### Selecting full joined records
1914
+ * ### join a relation of the joined
1915
+ *
1916
+ * After joining a relation or a table:
1917
+ *
1918
+ * ```ts
1919
+ * db.post.join('comments');
1920
+ *
1921
+ * db.post.join(() => db.comment);
1922
+ * ```
1923
+ *
1924
+ * You can join a relation of that joined table:
1925
+ *
1926
+ * ```ts
1927
+ * db.post.join('comments').join('comments.author');
1928
+ *
1929
+ * db.post.join(() => db.comment).join('comment.author');
1930
+ * ```
1931
+ *
1932
+ * Note that in the first case it's `comments` - a relation name, while in the second case it is a table name.
1933
+ *
1934
+ * ### joins deduplication
1935
+ *
1936
+ * When joining the same table with the same condition more than once, duplicated joins will be ignored:
1937
+ *
1938
+ * ```ts
1939
+ * // joining a relation
1940
+ * db.post.join('comments').join('comments');
1941
+ *
1942
+ * // joining a table with a condition
1943
+ * db.post
1944
+ * .join('comments', 'comments.postId', 'post.id')
1945
+ * .join('comments', 'comments.postId', 'post.id');
1946
+ * ```
1947
+ *
1948
+ * Both queries will produce SQL with only 1 join
1949
+ *
1950
+ * ```sql
1951
+ * SELECT * FROM post JOIN comments ON comments.postId = post.id
1952
+ * ```
1953
+ *
1954
+ * However, this is only possible if the join has no dynamic values:
1955
+ *
1956
+ * ```ts
1957
+ * db.post
1958
+ * .join('comments', (q) => q.where({ rating: { gt: 5 } }))
1959
+ * .join('comments', (q) => q.where({ rating: { gt: 5 } }));
1960
+ * ```
1961
+ *
1962
+ * Both joins above have the same `{ gt: 5 }`, but still, the `5` is a dynamic value and in this case joins will be duplicated,
1963
+ * resulting in a database error.
1964
+ *
1965
+ * ### select full joined records
1932
1966
  *
1933
1967
  * `select` supports selecting a full record of a previously joined table by passing a table name with `.*` at the end:
1934
1968
  *
@@ -2170,7 +2204,7 @@ declare class QueryJoin {
2170
2204
  * @param arg - {@link JoinFirstArg}
2171
2205
  * @param args - {@link JoinArgs}
2172
2206
  */
2173
- join<T extends PickQuerySelectableShapeRelationsWithDataAsResultReturnType, Arg extends JoinFirstArg<T>, Args extends JoinArgs<T, Arg>>(this: T, arg: Arg, ...args: Args): JoinResultFromArgs<T, Arg, Args, true, true>;
2207
+ join<T extends PickQuerySelectableShapeRelationsWithDataAsResultReturnType, Arg extends JoinFirstArg<T>, Cb extends JoinCallbackArgs<T, Arg>>(this: T, arg: Arg, ...args: Cb | JoinArgs<T, Arg>): JoinResultFromArgs<T, Arg, Cb, true, true>;
2174
2208
  /**
2175
2209
  * `leftJoin` is a method for SQL `LEFT JOIN`, which is equivalent to `OUTER JOIN`, `LEFT OUTER JOIN`.
2176
2210
  *
@@ -2195,7 +2229,7 @@ declare class QueryJoin {
2195
2229
  * @param arg - {@link JoinFirstArg}
2196
2230
  * @param args - {@link JoinArgs}
2197
2231
  */
2198
- leftJoin<T extends PickQuerySelectableResultRelationsWithDataReturnTypeShapeAs, Arg extends JoinFirstArg<T>, Args extends JoinArgs<T, Arg>>(this: T, arg: Arg, ...args: Args): JoinResultFromArgs<T, Arg, Args, false, true>;
2232
+ leftJoin<T extends PickQuerySelectableResultRelationsWithDataReturnTypeShapeAs, Arg extends JoinFirstArg<T>, Cb extends JoinCallbackArgs<T, Arg>>(this: T, arg: Arg, ...args: Cb | JoinArgs<T, Arg>): JoinResultFromArgs<T, Arg, Cb, false, true>;
2199
2233
  /**
2200
2234
  * `rightJoin` is a method for SQL `RIGHT JOIN`, which is equivalent to `RIGHT OUTER JOIN`.
2201
2235
  *
@@ -2217,7 +2251,7 @@ declare class QueryJoin {
2217
2251
  * @param arg - {@link JoinFirstArg}
2218
2252
  * @param args - {@link JoinArgs}
2219
2253
  */
2220
- rightJoin<T extends PickQuerySelectableResultRelationsWithDataReturnTypeShapeAs, Arg extends JoinFirstArg<T>, Args extends JoinArgs<T, Arg>>(this: T, arg: Arg, ...args: Args): JoinResultFromArgs<T, Arg, Args, true, false>;
2254
+ rightJoin<T extends PickQuerySelectableResultRelationsWithDataReturnTypeShapeAs, Arg extends JoinFirstArg<T>, Cb extends JoinCallbackArgs<T, Arg>>(this: T, arg: Arg, ...args: Cb | JoinArgs<T, Arg>): JoinResultFromArgs<T, Arg, Cb, true, false>;
2221
2255
  /**
2222
2256
  * `fullJoin` is a method for SQL `FULL JOIN`, which is equivalent to `FULL OUTER JOIN`.
2223
2257
  *
@@ -2239,7 +2273,7 @@ declare class QueryJoin {
2239
2273
  * @param arg - {@link JoinFirstArg}
2240
2274
  * @param args - {@link JoinArgs}
2241
2275
  */
2242
- fullJoin<T extends PickQuerySelectableResultRelationsWithDataReturnTypeShapeAs, Arg extends JoinFirstArg<T>, Args extends JoinArgs<T, Arg>>(this: T, arg: Arg, ...args: Args): JoinResultFromArgs<T, Arg, Args, false, false>;
2276
+ fullJoin<T extends PickQuerySelectableResultRelationsWithDataReturnTypeShapeAs, Arg extends JoinFirstArg<T>, Cb extends JoinCallbackArgs<T, Arg>>(this: T, arg: Arg, ...args: Cb | JoinArgs<T, Arg>): JoinResultFromArgs<T, Arg, Cb, false, false>;
2243
2277
  /**
2244
2278
  * `joinLateral` allows joining a table with a sub-query that can reference the main table of current query and the other joined tables.
2245
2279
  *
@@ -2302,12 +2336,13 @@ declare class QueryJoin {
2302
2336
  * ```
2303
2337
  *
2304
2338
  * @param arg - {@link JoinFirstArg}
2305
- * @param cb - {@link JoinLateralCallback}
2339
+ * @param cb - callback for shaping the joined query
2306
2340
  */
2307
- joinLateral<T extends PickQuerySelectableResultRelationsWithDataReturnTypeShapeAs, Arg extends JoinFirstArg<T>, As extends string, Result extends Column.QueryColumns>(this: T, arg: Arg, cb: (q: JoinQueryBuilder<T, JoinArgToQuery<T, Arg>>) => {
2341
+ joinLateral<T extends PickQuerySelectableResultRelationsWithDataReturnTypeShapeAs, Arg extends JoinFirstArg<T>, As extends string, Result extends Column.QueryColumns, JoinedRelations extends RelationsBase>(this: T, arg: Arg, cb: (q: JoinQueryBuilder<T, JoinArgToQuery<T, Arg>>) => {
2308
2342
  __as: As;
2309
2343
  result: Result;
2310
- }): JoinLateralResult<T, As, Result, true>;
2344
+ relations: JoinedRelations;
2345
+ }): JoinLateralResult<T, As, Result, JoinedRelations, true>;
2311
2346
  /**
2312
2347
  * The same as {@link joinLateral}, but when no records found for the join it will result in `null`:
2313
2348
  *
@@ -2321,12 +2356,13 @@ declare class QueryJoin {
2321
2356
  * ```
2322
2357
  *
2323
2358
  * @param arg - {@link JoinFirstArg}
2324
- * @param cb - {@link JoinLateralCallback}
2359
+ * @param cb - callback for shaping the joined query
2325
2360
  */
2326
- leftJoinLateral<T extends PickQuerySelectableResultRelationsWithDataReturnTypeShapeAs, Arg extends JoinFirstArg<T>, As extends string, Result extends Column.QueryColumns>(this: T, arg: Arg, cb: (q: JoinQueryBuilder<T, JoinArgToQuery<T, Arg>>) => {
2361
+ leftJoinLateral<T extends PickQuerySelectableResultRelationsWithDataReturnTypeShapeAs, Arg extends JoinFirstArg<T>, As extends string, Result extends Column.QueryColumns, JoinedRelations extends RelationsBase>(this: T, arg: Arg, cb: (q: JoinQueryBuilder<T, JoinArgToQuery<T, Arg>>) => {
2327
2362
  __as: As;
2328
2363
  result: Result;
2329
- }): JoinLateralResult<T, As, Result, false>;
2364
+ relations: JoinedRelations;
2365
+ }): JoinLateralResult<T, As, Result, JoinedRelations, false>;
2330
2366
  /**
2331
2367
  * This method may be useful
2332
2368
  * for combining with [createForEachFrom](/guide/create-update-delete.html#createForEachFrom-insertForEachFrom).
@@ -3340,7 +3376,7 @@ declare const _queryWhereIn: <T>(q: T, and: boolean, arg: unknown, values: unkno
3340
3376
  /**
3341
3377
  * Mutative {@link Where.prototype.whereExists}
3342
3378
  */
3343
- declare const _queryWhereExists: <T extends PickQuerySelectableShapeRelationsWithDataAs, Arg extends JoinFirstArg<T>>(q: T, arg: Arg, args: JoinArgs<T, Arg>) => T & QueryHasWhere;
3379
+ declare const _queryWhereExists: <T extends PickQuerySelectableShapeRelationsWithDataAs, Arg extends JoinFirstArg<T>>(q: T, arg: Arg, args: [JoinCallback<T, Arg>] | JoinArgs<T, Arg>) => T & QueryHasWhere;
3344
3380
  declare class Where {
3345
3381
  /**
3346
3382
  * Constructing `WHERE` conditions:
@@ -3920,9 +3956,9 @@ declare class Where {
3920
3956
  * db.user.whereExists(db.account, (q) => q.on('account.id', '=', 'user.id'));
3921
3957
  * ```
3922
3958
  */
3923
- whereExists<T extends PickQuerySelectableShapeRelationsWithDataAs, Arg extends JoinFirstArg<T>, Args extends JoinArgs<T, Arg>>(this: T, arg: Arg, ...args: Args): Arg extends QueryFnReturningSelect ? {
3959
+ whereExists<T extends PickQuerySelectableShapeRelationsWithDataAs, Arg extends JoinFirstArg<T>, Cb extends JoinCallbackArgs<T, Arg>>(this: T, arg: Arg, ...args: Cb | JoinArgs<T, Arg>): Arg extends QueryFnReturningSelect ? {
3924
3960
  error: 'Cannot select in whereExists';
3925
- } : Args[0] extends QueryFnReturningSelect ? {
3961
+ } : Cb[0] extends QueryFnReturningSelect ? {
3926
3962
  error: 'Cannot select in whereExists';
3927
3963
  } : T & QueryHasWhere;
3928
3964
  /**
@@ -4441,15 +4477,17 @@ declare class Db<Table extends string | undefined = undefined, Shape extends Col
4441
4477
  * const value = 1;
4442
4478
  *
4443
4479
  * // it is NOT safe to interpolate inside a simple string, use `values` to pass the values.
4444
- * const result = await db.query<{ one: number }>({
4480
+ * import { raw } from 'orchid-orm';
4481
+ *
4482
+ * const result = await db.query<{ one: number }>(raw({
4445
4483
  * raw: 'SELECT $1 AS one',
4446
4484
  * values: [value],
4447
- * });
4485
+ * }));
4448
4486
  * // data is inside `rows` array:
4449
4487
  * result.rows[0].one;
4450
4488
  * ```
4451
4489
  *
4452
- * @param args - SQL template literal, or an object { raw: string, values?: unknown[] }
4490
+ * @param args - SQL template literal, or a raw SQL object created by `raw()` or `sql()` function
4453
4491
  */
4454
4492
  get query(): DbSqlQuery;
4455
4493
  private _query?;
@@ -4466,7 +4504,7 @@ declare class Db<Table extends string | undefined = undefined, Shape extends Col
4466
4504
  * row[0]; // our value
4467
4505
  * ```
4468
4506
  *
4469
- * @param args - SQL template literal, or an object { raw: string, values?: unknown[] }
4507
+ * @param args - SQL template literal, or a raw SQL object created by `raw()` or `sql()` function
4470
4508
  */
4471
4509
  queryArrays<R extends any[] = any[]>(...args: SQLQueryArgs): Promise<QueryArraysResult<R>>;
4472
4510
  }
@@ -6312,7 +6350,7 @@ declare class QueryUpdate {
6312
6350
  * .set({ authorName: (q) => q.ref('author.name') });
6313
6351
  * ```
6314
6352
  */
6315
- updateFrom<T extends UpdateSelf, Arg extends JoinFirstArg<T>, Args extends JoinArgs<T, Arg>>(this: T, arg: Arg, ...args: Args): JoinResultFromArgs<T, Arg, Args, true, true> & QueryHasWhere;
6353
+ updateFrom<T extends UpdateSelf, Arg extends JoinFirstArg<T>, Cb extends JoinCallbackArgs<T, Arg>>(this: T, arg: Arg, ...args: Cb | JoinArgs<T, Arg>): JoinResultFromArgs<T, Arg, Cb, true, true> & QueryHasWhere;
6316
6354
  /**
6317
6355
  * Use after {@link updateFrom}
6318
6356
  */
@@ -9152,6 +9190,9 @@ interface QueryData extends QueryDataAliases, PickQueryDataParsers, HasHookSelec
9152
9190
  joinedComputeds?: {
9153
9191
  [K: string]: ComputedColumns | undefined;
9154
9192
  };
9193
+ joined?: {
9194
+ [K: string]: Query;
9195
+ };
9155
9196
  joinedForSelect?: string;
9156
9197
  innerJoinLateral?: true;
9157
9198
  valuesJoinedAs?: RecordString;
@@ -10496,13 +10537,12 @@ declare class QueryMethods<ColumnTypes> {
10496
10537
  returnType: T['returnType'];
10497
10538
  }): QueryIfResult<T, R>;
10498
10539
  queryRelated<T extends PickQueryRelations, RelName extends keyof T['relations']>(this: T, relName: RelName, params: T['relations'][RelName]['params']): T['relations'][RelName]['maybeSingle'];
10499
- chain<T extends PickQuerySelectableShapeRelationsReturnTypeIsSubQuery, RelName extends keyof T['relations']>(this: T, relName: RelName): [
10500
- T['__subQuery'],
10501
- T['returnType'],
10502
- T['relations'][RelName]['returnsOne']
10503
- ] extends [true | undefined, 'one' | 'oneOrThrow', true] ? {
10540
+ chain<T extends PickQuerySelectableShapeRelationsReturnTypeIsSubQuery, RelName extends keyof T['relations']>(this: T, relName: RelName): T['__subQuery'] extends true | undefined ? [T['returnType'], T['relations'][RelName]['returnsOne']] extends [
10541
+ 'one' | 'oneOrThrow',
10542
+ true
10543
+ ] ? {
10504
10544
  [K in keyof T['relations'][RelName]['maybeSingle']]: K extends '__selectable' ? T['relations'][RelName]['maybeSingle']['__selectable'] & Omit<T['__selectable'], keyof T['shape']> : T['relations'][RelName]['maybeSingle'][K];
10505
- } & IsSubQuery : JoinResultRequireMain<T['relations'][RelName]['query'], Omit<T['__selectable'], keyof T['shape']>>;
10545
+ } & IsSubQuery : JoinResultRequireMain<T['relations'][RelName]['query'], Omit<T['__selectable'], keyof T['shape']>> : T['relations'][RelName]['query'];
10506
10546
  }
10507
10547
 
10508
10548
  interface DbExtension {
@@ -10694,7 +10734,7 @@ declare const isQuery: (q: unknown) => q is IsQuery;
10694
10734
  interface RelationJoinQuery {
10695
10735
  (joiningQuery: IsQuery, baseQuery: IsQuery): IsQuery;
10696
10736
  }
10697
- interface RelationConfigQuery extends PickQueryResult, PickQuerySelectable, PickQueryShape, PickQueryTable, PickQueryAs {
10737
+ interface RelationConfigQuery extends PickQueryResult, PickQuerySelectable, PickQueryShape, PickQueryTable, PickQueryAs, PickQueryRelations {
10698
10738
  }
10699
10739
  interface RelationConfigBase extends IsQuery {
10700
10740
  returnsOne: boolean;
@@ -10747,7 +10787,7 @@ interface PickQueryDefaultSelect {
10747
10787
  }
10748
10788
  interface PickQueryHasSelectResultReturnType extends PickQueryHasSelect, PickQueryResult, PickQueryReturnType {
10749
10789
  }
10750
- interface PickQueryHasSelectResultShapeAs extends PickQueryHasSelect, PickQueryResult, PickQueryShape, PickQueryAs {
10790
+ interface PickQueryHasSelectResultShapeAsRelations extends PickQueryHasSelect, PickQueryResult, PickQueryShape, PickQueryAs, PickQueryRelations {
10751
10791
  }
10752
10792
  interface PickQueryHasSelectHasWhereResultReturnType extends PickQueryHasSelect, PickQueryHasWhere, PickQueryResult, PickQueryReturnType {
10753
10793
  }
@@ -10760,8 +10800,6 @@ interface PickQuerySelectableResult extends PickQuerySelectable, PickQueryResult
10760
10800
  }
10761
10801
  interface PickQuerySelectableRelations extends PickQuerySelectable, PickQueryRelations {
10762
10802
  }
10763
- interface PickQuerySelectableRelationsResultReturnType extends PickQuerySelectableRelations, PickQueryResult, PickQueryReturnType {
10764
- }
10765
10803
  interface PickQuerySelectableResultWindows extends PickQuerySelectable, PickQueryResult, PickQueryWindows {
10766
10804
  }
10767
10805
  interface PickQuerySelectableResultRelationsWindows extends PickQuerySelectableResult, PickQueryRelations, PickQueryWindows {
@@ -10778,7 +10816,7 @@ interface PickQuerySelectableShapeRelationsWithDataAs extends PickQuerySelectabl
10778
10816
  }
10779
10817
  interface PickQuerySelectableShapeRelationsWithDataAsResultReturnType extends PickQuerySelectableShapeRelationsWithDataAs, PickQueryResult, PickQueryReturnType {
10780
10818
  }
10781
- interface PickQuerySelectableResultReturnType extends PickQuerySelectable, PickQueryResult, PickQueryReturnType {
10819
+ interface PickQuerySelectableRelationsResultReturnType extends PickQuerySelectableRelations, PickQueryResult, PickQueryReturnType {
10782
10820
  }
10783
10821
  interface PickQuerySelectableResultRelationsWithDataReturnType extends PickQuerySelectable, PickQueryResult, PickQueryRelations, PickQueryWithData, PickQueryReturnType {
10784
10822
  }
@@ -10855,7 +10893,9 @@ interface PickQueryMetaSelectableResultRelationsWithDataReturnTypeShapeAs extend
10855
10893
  }
10856
10894
  interface PickQueryResultAs extends PickQueryResult, PickQueryAs {
10857
10895
  }
10858
- interface PickQueryShapeAs extends PickQueryShape, PickQueryAs {
10896
+ interface PickQueryResultAsRelations extends PickQueryResultAs, PickQueryRelations {
10897
+ }
10898
+ interface PickQueryShapeAsRelations extends PickQueryShape, PickQueryAs, PickQueryRelations {
10859
10899
  }
10860
10900
  interface PickQueryRelationsWithData extends PickQueryWithData, PickQueryRelations {
10861
10901
  }
@@ -11119,4 +11159,4 @@ declare const testTransaction: {
11119
11159
  close(arg: Arg): Promise<void>;
11120
11160
  };
11121
11161
 
11122
- export { type AdapterBase, type AdapterConfigBase, type AdapterConfigConnectRetry, type AdapterTransactionOptions, type AddQueryDefaults, type AdditionalDateData, type AdditionalNumberData, type AdditionalStringData, AfterCommitError, type AfterCommitErrorFulfilledResult, type AfterCommitErrorHandler, type AfterCommitErrorRejectedResult, type AfterCommitErrorResult, type AfterCommitHook, type AfterCommitStandaloneHook, type AfterHook, type AggregateOptions, type ArgWithBeforeAndBeforeSet, ArrayColumn, type ArrayColumnValue, type ArrayData, type ArrayMethodsData, type ArrayMethodsDataForBaseColumn, type AsFn, type AsQueryArg, type AsyncState, type AsyncTransactionState, type BaseNumberData, type BatchSql, BigIntColumn, BigSerialColumn, BitColumn, BitVaryingColumn, BooleanColumn, BoxColumn, ByteaColumn, type ChangeCountArg, CidrColumn, CircleColumn, CitextColumn, type Code, type Codes, Column, type ColumnFromDbParams, ColumnRefExpression, type ColumnSchemaConfig, type ColumnSchemaGetterColumns, type ColumnSchemaGetterTableClass, type ColumnToCodeCtx, type ColumnTypeSchemaArg, type ColumnsByType, ColumnsShape, ComputedColumn, type ComputedColumns, type ComputedColumnsFromOptions, type ComputedMethods, type ComputedOptionsConfig, type ComputedOptionsFactory, type CreateBelongsToData, type CreateColumn, type CreateCtx, type CreateData, type CreateFromMethodNames, type CreateManyFromMethodNames, type CreateManyMethodsNames, type CreateMethodsNames, type CreateRelationsData, type CreateRelationsDataOmittingFKeys, type CreateResult, type CreateSelf, type CteArgsOptions, type CteHooks, type CteItem, type CteOptions, CteQuery, type CteQueryBuilder, type CteRecursiveOptions, type CteResult, type CteSqlResult, type CteTableHook, type CteTableHooks, CustomTypeColumn, DateBaseColumn, DateColumn, type DateColumnData, type DateColumnInput, DateTimeBaseClass, DateTimeTzBaseClass, Db, type DbDomainArg, type DbDomainArgRecord, type DbExtension, type DbOptions, type DbOptionsWithAdapter, type DbResult, type DbSharedOptions, type DbSqlMethod, type DbSqlQuery, type DbStructureDomainsMap, type DbTableConstructor, type DbTableOptionScopes, type DbTableOptions, DecimalColumn, type DecimalColumnData, type DefaultColumnTypes, type DefaultSchemaConfig, type DelayedRelationSelect, type DeleteArgs, type DeleteMethodsNames, type DeleteResult, DomainColumn, DoublePrecisionColumn, DynamicRawSQL, type DynamicSQLArg, type EmptyObject, type EmptyTuple, EnumColumn, Expression, type ExpressionChain, type ExpressionData, type ExpressionOutput, ExpressionTypeMethod, FnExpression, type FnExpressionArgs, type FnExpressionArgsPairs, type FnExpressionArgsValue, type FnUnknownToUnknown, type FromArg, FromMethods, type FromQuerySelf, type FromResult, type GeneratorIgnore, type GroupArgs, type HandleResult, type HasBeforeAndBeforeSet, type HasCteHooks, type HasHookSelect, type HasTableHook, type HavingItem, type HookAction, type HookSelect, type HookSelectArg, type HookSelectValue, type IdentityColumn, InetColumn, type InsertQueryDataObjectValues, IntegerBaseColumn, IntegerColumn, IntervalColumn, type IsQueries, type IsQuery, type IsSubQuery, type IsolationLevel, JSONColumn, JSONTextColumn, type JoinArgToQuery, type JoinArgs, type JoinCallback, type JoinFirstArg, type JoinItem, type JoinItemArgs, type JoinLateralResult, type JoinQueryBuilder, type JoinQueryMethod, type JoinResult, type JoinResultFromArgs, type JoinResultRequireMain, type JoinResultSelectable, type JoinValueDedupItem, type JoinedParsers, type JoinedShapes, LimitedTextBaseColumn, LineColumn, LsegColumn, MacAddr8Column, MacAddrColumn, type MapTableScopesOption, type MaybeArray, type MaybePromise, type MergeQuery, type MergeQueryArg, MergeQueryMethods, MoneyColumn, MoreThanOneRowError, type MoveMutativeQueryToCte, type NoPrimaryKeyOption, type NonUniqDataItem, NotFoundError, NumberAsStringBaseColumn, NumberBaseColumn, type NumberColumnData, type NumericColumns, type OnConflictMerge, OnConflictQueryBuilder, type OnConflictSet, type OnConflictTarget, OnMethods, type Operator, type OperatorToSQL, Operators, type OperatorsAny, type OperatorsArray, type OperatorsBoolean, type OperatorsDate, type OperatorsJson, type OperatorsNumber, type OperatorsOrdinalText, type OperatorsText, type OperatorsTime, type OrCreateArg, OrExpression, type OrExpressionArg, OrchidOrmError, OrchidOrmInternalError, type OrderArg, type OrderItem, type OrderTsQueryConfig, type Over, PathColumn, type PickQueryAs, type PickQueryBaseQuery, type PickQueryColumTypes, type PickQueryDataShapeAndJoinedShapes, type PickQueryDataShapeAndJoinedShapesAndAliases, type PickQueryDefaultSelect, type PickQueryDefaults, type PickQueryHasSelect, type PickQueryHasSelectHasWhereResultReturnType, type PickQueryHasSelectResult, type PickQueryHasSelectResultReturnType, type PickQueryHasSelectResultShapeAs, type PickQueryHasWhere, type PickQueryInputType, type PickQueryInternal, type PickQueryIsSubQuery, type PickQueryMetaSelectableResultRelationsWindowsColumnTypes, type PickQueryMetaSelectableResultRelationsWithDataReturnTypeShapeAs, type PickQueryQ, type PickQueryQAndBaseQuery, type PickQueryQAndInternal, type PickQueryRelationQueries, type PickQueryRelations, type PickQueryRelationsWithData, type PickQueryResult, type PickQueryResultAs, type PickQueryResultColumnTypes, type PickQueryResultRelationsWithDataReturnTypeShape, type PickQueryResultReturnType, type PickQueryResultReturnTypeUniqueColumns, type PickQueryResultUniqueColumns, type PickQueryReturnType, type PickQueryScopes, type PickQuerySelectable, type PickQuerySelectableColumnTypes, type PickQuerySelectableRelations, type PickQuerySelectableRelationsResultReturnType, type PickQuerySelectableResult, type PickQuerySelectableResultAs, type PickQuerySelectableResultInputTypeAs, type PickQuerySelectableResultRelationsWindows, type PickQuerySelectableResultRelationsWithDataReturnType, type PickQuerySelectableResultRelationsWithDataReturnTypeShapeAs, type PickQuerySelectableResultReturnType, type PickQuerySelectableResultWindows, type PickQuerySelectableReturnType, type PickQuerySelectableShape, type PickQuerySelectableShapeAs, type PickQuerySelectableShapeRelationsReturnTypeIsSubQuery, type PickQuerySelectableShapeRelationsWithData, type PickQuerySelectableShapeRelationsWithDataAs, type PickQuerySelectableShapeRelationsWithDataAsResultReturnType, type PickQueryShape, type PickQueryShapeAs, type PickQueryShapeResultReturnTypeSinglePrimaryKey, type PickQueryShapeResultSinglePrimaryKey, type PickQueryShapeSinglePrimaryKey, type PickQuerySinglePrimaryKey, type PickQueryTable, type PickQueryTableMetaShapeTableAs, type PickQueryThen, type PickQueryTsQuery, type PickQueryUniqueProperties, type PickQueryWindows, type PickQueryWithData, type PickQueryWithDataColumnTypes, PointColumn, PolygonColumn, PostgisGeographyPointColumn, type PostgisPoint, type PrepareSubQueryForSql, type PrepareSubQueryForSqlArg, type Query, type QueryAfterHook, type QueryArraysResult, QueryAsMethods, type QueryBatchResult, type QueryBeforeActionHook, type QueryBeforeHook, type QueryBuilder, type QueryCatch, type QueryCatchers, QueryClone, type QueryComputedArg, QueryCreate, QueryCreateFrom, type QueryData, type QueryDataAliases, type QueryDataFromItem, type QueryDataJoinTo, type QueryDataScopes, type QueryDataSources, type QueryDataTransform, type QueryDataUnion, QueryDelete, QueryError, type QueryErrorName, QueryExpressions, QueryGet, type QueryHasSelect, type QueryHasWhere, type QueryHelperResult, QueryHookUtils, QueryHooks, type QueryIfResultThen, type QueryInternal, type QueryInternalColumnNameToKey, QueryJoin, QueryLog, type QueryLogObject, type QueryLogOptions, type QueryLogger, type QueryManyTake, type QueryManyTakeOptional, QueryMethods, QueryOrCreate, type QueryOrExpression, type QueryOrExpressionBooleanOrNullResult, type QueryResult, type QueryResultRow, type QueryReturnType, type QueryReturnTypeAll, type QueryReturnTypeOptional, type QuerySchema, QueryScope, type QueryScopeData, type QueryScopes, type QuerySelectable, type QuerySourceItem, QuerySql, type QueryTake, type QueryTakeOptional, type QueryThen, type QueryThenByQuery, type QueryThenByReturnType, type QueryThenShallowSimplify, type QueryThenShallowSimplifyArr, type QueryThenShallowSimplifyOptional, QueryTransaction, QueryTransform, type QueryType, QueryUpdate, QueryUpsert, QueryWithSchema, QueryWrap, type RawSQLValues, RawSql, type RawSqlBase, RealColumn, type RecordBoolean, type RecordKeyTrue, type RecordOfColumnsShapeBase, type RecordOptionalString, type RecordString, type RecordStringOrNumber, type RecordUnknown, RefExpression, type RelationConfigBase, type RelationConfigDataForCreate, type RelationConfigQuery, type RelationJoinQuery, type RelationsBase, type ReturnsQueryOrExpression, type RunAfterQuery, type RuntimeComputedQueryColumn, type SQLArgs, type SQLQueryArgs, type ScopeArgumentQuery, type SearchWeight, type SearchWeightRecord, Select, type SelectArg, type SelectArgs, type SelectAs, type SelectAsArg, type SelectAsFnArg, type SelectAsValue, type SelectItem, type SelectSelf, type SelectSubQueryResult, type SelectableFromShape, type SelectableOfType, type SelectableOrExpression, type SelectableOrExpressionOfType, type SelectableOrExpressions, SerialColumn, type SerialColumnData, type SetQueryResult, type SetQueryReturnsAll, type SetQueryReturnsAllResult, type SetQueryReturnsColumn, type SetQueryReturnsColumnOptional, type SetQueryReturnsColumnOrThrow, type SetQueryReturnsColumnResult, type SetQueryReturnsOne, type SetQueryReturnsOneResult, type SetQueryReturnsPluck, type SetQueryReturnsPluckColumnResult, type SetQueryReturnsRowCount, type SetQueryReturnsRowCountMany, type SetQueryReturnsRows, type SetQueryReturnsValueOptional, type SetQueryReturnsValueOrThrow, type SetQueryReturnsVoid, type SetQueryTableAlias, type SetValueQueryReturnsPluckColumn, type SetValueQueryReturnsValueOrThrow, type ShallowSimplify, type ShapeColumnPrimaryKeys, type ShapeUniqueColumns, type SimpleJoinItemNonSubQueryArgs, type SingleSql, type SingleSqlItem, SmallIntColumn, SmallSerialColumn, type SortDir, type Sql, type SqlCommonOptions, type SqlFn, SqlRefExpression, type StaticSQLArgs, type StorageOptions, StringColumn$1 as StringColumn, type StringData, type SubQueryForSql, TableData, type TableDataFn, type TableDataInput, type TableDataItem, type TableDataItemsUniqueColumnTuples, type TableDataItemsUniqueColumns, type TableDataItemsUniqueConstraints, type TableDataMethods, type TableHook, type TemplateLiteralArgs, TextBaseColumn, TextColumn, type TextColumnData, Then, TimeColumn, type TimeInterval, TimestampColumn, type TimestampHelpers, TimestampTZColumn, type Timestamps, type TopCTE, type TransactionAdapterBase, type TransactionAfterCommitHook, type TransactionArgs, type TransactionOptions, TsQueryColumn, TsVectorColumn, UUIDColumn, UnhandledTypeError, type UnionItem, type UnionKind, type UnionSet, type UnionToIntersection, type UniqueConstraints, type UniqueQueryTypeOrExpression, type UniqueTableDataItem, UnknownColumn, UnsafeSqlExpression, type UpdateArg, type UpdateCtxCollect, type UpdateData, type UpdateQueryDataItem, type UpdateQueryDataObject, type UpdateSelf, type UpdatedAtDataInjector, type UpsertData, type UpsertResult, type UpsertThis, VarCharColumn, VirtualColumn, Where, type WhereArg, type WhereArgs, type WhereInArg, type WhereInColumn, type WhereInItem, type WhereInValues, type WhereItem, type WhereJsonPathEqualsItem, type WhereNotArgs, type WhereOnItem, type WhereOnJoinItem, type WhereQueryBuilder, type WhereSearchItem, type WindowDeclaration, type WindowItem, type WithConfig, type WithConfigs, type WithDataItem, type WithDataItems, type WithItems, type WrapQueryArg, XMLColumn, _addToHookSelect, _addToHookSelectWithTable, _appendQuery, _applyRelationAliases, _checkIfAliased, _clone, _copyQueryAliasToQuery, _createDbSqlMethod, _getQueryAliasOrName, _getQueryAs, _getQueryFreeAlias, _getQueryOuterAliases, _hookSelectColumns, _initQueryBuilder, _join, _joinLateral, _joinLateralProcessArg, _joinReturningArgs, _orCreate, _prependWith, _queryAfterSaveCommit, _queryAll, _queryChangeCounter, _queryCreate, _queryCreateForEachFrom, _queryCreateMany, _queryCreateManyFrom, _queryCreateOneFrom, _queryDefaults, _queryDelete, _queryExec, _queryFindBy, _queryFindByOptional, _queryHookAfterCreate, _queryHookAfterCreateCommit, _queryHookAfterDelete, _queryHookAfterDeleteCommit, _queryHookAfterQuery, _queryHookAfterSave, _queryHookAfterUpdate, _queryHookAfterUpdateCommit, _queryHookBeforeCreate, _queryHookBeforeDelete, _queryHookBeforeQuery, _queryHookBeforeSave, _queryHookBeforeUpdate, _queryInsert, _queryInsertForEachFrom, _queryInsertMany, _queryInsertManyFrom, _queryInsertOneFrom, _queryJoinOn, _queryJoinOnJsonPathEquals, _queryJoinOrOn, _queryOr, _queryOrNot, _queryRows, _querySelect, _querySelectAll, _queryTake, _queryTakeOptional, _queryUpdate, _queryUpdateOrThrow, _queryUpsert, _queryWhere, _queryWhereExists, _queryWhereIn, _queryWhereNot, _queryWhereNotExists, _queryWhereNotOneOf, _queryWhereNotSql, _queryWhereOneOf, _queryWhereSql, _runAfterCommitHooks, _setQueryAlias, _setQueryAs, _setSubQueryAliases, _with, addCode, addColumnParserToQuery, addParserForRawExpression, addParserForSelectItem, addQueryOn, addTopCte, addTopCteSql, addValue, addWithToSql, anyShape, applyBatchTransforms, applyComputedColumns, applyMixins, applyTransforms, arrayDataToCode, arrayMethodNames, assignDbDataToColumn, backtickQuote, callWithThis, checkIfASimpleQuery, cloneQueryBaseUnscoped, codeToString, colors, columnCheckToCode, columnCode, columnDefaultArgumentToCode, columnErrorMessagesToCode, columnExcludesToCode, columnForeignKeysToCode, columnIndexesToCode, columnMethodsToCode, columnsShapeToCode, commitSql, composeCteSingleSql, constraintInnerToCode, constraintToCode, consumeColumnName, countSelect, createCtx, createDbWithAdapter, createSelect, cteToSql, cteToSqlGiveAs, ctesToSql, dateDataToCode, dateMethodNames, deepCompare, defaultSchemaConfig, emptyArray, emptyObject, escapeForLog, escapeForMigration, escapeString, excludeInnerToCode, excludeToCode, exhaustive, extendQuery, filterResult, finalizeNestedHookSelect, foreignKeyArgumentToCode, getCallerFilePath, getClonedQueryData, getColumnBaseType, getColumnTypes, getDefaultLanguage, getDefaultNowFn, getFreeAlias, getFreeSetAlias, getFromSelectColumns, getFullColumnTable, getImportPath, getPrimaryKeys, getQueryAs, getQuerySchema, getSearchLang, getSearchText, getShapeFromSelect, getSqlText, getStackTrace, getThen, getTopCteSize, handleManyData, handleOneData, handleResult, havingToSql, identityToCode, indexInnerToCode, indexToCode, insert, isDefaultTimeStamp, isExpression, isInUserTransaction, isIterable, isObjectEmpty, isQuery, isQueryReturnsAll, isRawSQL, isRelationQuery, isTemplateLiteralArgs, joinSubQuery, joinTruthy, logColors, logParamToLogObject, makeColumnNullable, makeColumnTypes, makeColumnsByType, makeFnExpression, makeInsertSql, makeReturningSql, makeRowToJson, makeSql, moveMutativeQueryToCte, newDelayedRelationSelect, noop, numberDataToCode, numberMethodNames, objectHasValues, omit, orderByToSql, parseRecord, parseTableData, parseTableDataInput, pathToLog, performQuery, pick, pluralize, postgisTypmodToSql, prepareOpArg, prepareSubQueryForSql, primaryKeyInnerToCode, processComputedBatches, processComputedResult, processJoinItem, processSelectArg, pushColumnData, pushHavingSql, pushJoinSql, pushOrNewArray, pushOrNewArrayToObjectImmutable, pushOrderBySql, pushQueryArrayImmutable, pushQueryOn, pushQueryOnForOuter, pushQueryOrOn, pushQueryValueImmutable, pushTableDataCode, pushUnionSql, pushWhereStatementSql, pushWhereToSql, queryColumnNameToKey, queryFrom, queryFromSql, queryMethodByReturnType, queryTypeWithLimitOne, queryWrap, quoteFromWithSchema, quoteObjectKey, quoteSchemaAndTable, quoteTableWithSchema, raw, rawSqlToCode, referencesArgsToCode, requirePrimaryKeys, requireQueryAs, requireTableOrStringFrom, resetDefaultNowFn, resolveSubQueryCallback, returnArg, rollbackSql, saveAliasedShape, searchSourcesToSql, selectAllSql, selectToSql, selectToSqlList, setColumnData, setColumnDefaultParse, setColumnEncode, setColumnParse, setColumnParseNull, setConnectRetryConfig, setCurrentColumnName, setDataValue, setDb, setDefaultLanguage, setDefaultNowFn, setDelayedRelation, setFreeAlias, setFreeTopCteAs, setMoveMutativeQueryToCte, setObjectValueImmutable, setParserForSelectedString, setPrepareSubQueryForSql, setQueryObjectValueImmutable, setQueryOperators, setRawSqlPrepareSubQueryForSql, setSqlCtxSelectList, setTopCteSize, singleQuote, singleQuoteArray, snakeCaseKey, spreadObjectValues, sqlFn, sqlQueryArgsToExpression, stringDataToCode, stringMethodNames, tableDataMethods, templateLiteralSQLToCode, templateLiteralToSQL, testTransaction, throwIfJoinLateral, throwIfNoWhere, throwOnReadOnly, timestampHelpers, toArray, toCamelCase, toPascalCase, toSnakeCase, whereToSql, windowToSql, wrapAdapterFnWithConnectRetry };
11162
+ export { type AdapterBase, type AdapterConfigBase, type AdapterConfigConnectRetry, type AdapterTransactionOptions, type AddQueryDefaults, type AdditionalDateData, type AdditionalNumberData, type AdditionalStringData, AfterCommitError, type AfterCommitErrorFulfilledResult, type AfterCommitErrorHandler, type AfterCommitErrorRejectedResult, type AfterCommitErrorResult, type AfterCommitHook, type AfterCommitStandaloneHook, type AfterHook, type AggregateOptions, type ArgWithBeforeAndBeforeSet, ArrayColumn, type ArrayColumnValue, type ArrayData, type ArrayMethodsData, type ArrayMethodsDataForBaseColumn, type AsFn, type AsQueryArg, type AsyncState, type AsyncTransactionState, type BaseNumberData, type BatchSql, BigIntColumn, BigSerialColumn, BitColumn, BitVaryingColumn, BooleanColumn, BoxColumn, ByteaColumn, type ChangeCountArg, CidrColumn, CircleColumn, CitextColumn, type Code, type Codes, Column, type ColumnFromDbParams, ColumnRefExpression, type ColumnSchemaConfig, type ColumnSchemaGetterColumns, type ColumnSchemaGetterTableClass, type ColumnToCodeCtx, type ColumnTypeSchemaArg, type ColumnsByType, ColumnsShape, ComputedColumn, type ComputedColumns, type ComputedColumnsFromOptions, type ComputedMethods, type ComputedOptionsConfig, type ComputedOptionsFactory, type CreateBelongsToData, type CreateColumn, type CreateCtx, type CreateData, type CreateFromMethodNames, type CreateManyFromMethodNames, type CreateManyMethodsNames, type CreateMethodsNames, type CreateRelationsData, type CreateRelationsDataOmittingFKeys, type CreateResult, type CreateSelf, type CteArgsOptions, type CteHooks, type CteItem, type CteOptions, CteQuery, type CteQueryBuilder, type CteRecursiveOptions, type CteResult, type CteSqlResult, type CteTableHook, type CteTableHooks, CustomTypeColumn, DateBaseColumn, DateColumn, type DateColumnData, type DateColumnInput, DateTimeBaseClass, DateTimeTzBaseClass, Db, type DbDomainArg, type DbDomainArgRecord, type DbExtension, type DbOptions, type DbOptionsWithAdapter, type DbResult, type DbSharedOptions, type DbSqlMethod, type DbSqlQuery, type DbStructureDomainsMap, type DbTableConstructor, type DbTableOptionScopes, type DbTableOptions, DecimalColumn, type DecimalColumnData, type DefaultColumnTypes, type DefaultSchemaConfig, type DelayedRelationSelect, type DeleteArgs, type DeleteMethodsNames, type DeleteResult, DomainColumn, DoublePrecisionColumn, DynamicRawSQL, type DynamicSQLArg, type EmptyObject, type EmptyTuple, EnumColumn, Expression, type ExpressionChain, type ExpressionData, type ExpressionOutput, ExpressionTypeMethod, FnExpression, type FnExpressionArgs, type FnExpressionArgsPairs, type FnExpressionArgsValue, type FnUnknownToUnknown, type FromArg, FromMethods, type FromQuerySelf, type FromResult, type GeneratorIgnore, type GroupArgs, type HandleResult, type HasBeforeAndBeforeSet, type HasCteHooks, type HasHookSelect, type HasTableHook, type HavingItem, type HookAction, type HookSelect, type HookSelectArg, type HookSelectValue, type IdentityColumn, InetColumn, type InsertQueryDataObjectValues, IntegerBaseColumn, IntegerColumn, IntervalColumn, type IsQueries, type IsQuery, type IsSubQuery, type IsolationLevel, JSONColumn, JSONTextColumn, type JoinArgToQuery, type JoinArgs, type JoinCallback, type JoinCallbackArgs, type JoinFirstArg, type JoinItem, type JoinItemArgs, type JoinLateralResult, type JoinQueryBuilder, type JoinQueryMethod, type JoinResult, type JoinResultFromArgs, type JoinResultRequireMain, type JoinResultSelectable, type JoinValueDedupItem, type JoinedParsers, type JoinedShapes, LimitedTextBaseColumn, LineColumn, LsegColumn, MacAddr8Column, MacAddrColumn, type MapTableScopesOption, type MaybeArray, type MaybePromise, type MergeQuery, type MergeQueryArg, MergeQueryMethods, MoneyColumn, MoreThanOneRowError, type MoveMutativeQueryToCte, type NoPrimaryKeyOption, type NonUniqDataItem, NotFoundError, NumberAsStringBaseColumn, NumberBaseColumn, type NumberColumnData, type NumericColumns, type OnConflictMerge, OnConflictQueryBuilder, type OnConflictSet, type OnConflictTarget, OnMethods, type Operator, type OperatorToSQL, Operators, type OperatorsAny, type OperatorsArray, type OperatorsBoolean, type OperatorsDate, type OperatorsJson, type OperatorsNumber, type OperatorsOrdinalText, type OperatorsText, type OperatorsTime, type OrCreateArg, OrExpression, type OrExpressionArg, OrchidOrmError, OrchidOrmInternalError, type OrderArg, type OrderItem, type OrderTsQueryConfig, type Over, PathColumn, type PickQueryAs, type PickQueryBaseQuery, type PickQueryColumTypes, type PickQueryDataShapeAndJoinedShapes, type PickQueryDataShapeAndJoinedShapesAndAliases, type PickQueryDefaultSelect, type PickQueryDefaults, type PickQueryHasSelect, type PickQueryHasSelectHasWhereResultReturnType, type PickQueryHasSelectResult, type PickQueryHasSelectResultReturnType, type PickQueryHasSelectResultShapeAsRelations, type PickQueryHasWhere, type PickQueryInputType, type PickQueryInternal, type PickQueryIsSubQuery, type PickQueryMetaSelectableResultRelationsWindowsColumnTypes, type PickQueryMetaSelectableResultRelationsWithDataReturnTypeShapeAs, type PickQueryQ, type PickQueryQAndBaseQuery, type PickQueryQAndInternal, type PickQueryRelationQueries, type PickQueryRelations, type PickQueryRelationsWithData, type PickQueryResult, type PickQueryResultAs, type PickQueryResultAsRelations, type PickQueryResultColumnTypes, type PickQueryResultRelationsWithDataReturnTypeShape, type PickQueryResultReturnType, type PickQueryResultReturnTypeUniqueColumns, type PickQueryResultUniqueColumns, type PickQueryReturnType, type PickQueryScopes, type PickQuerySelectable, type PickQuerySelectableColumnTypes, type PickQuerySelectableRelations, type PickQuerySelectableRelationsResultReturnType, type PickQuerySelectableResult, type PickQuerySelectableResultAs, type PickQuerySelectableResultInputTypeAs, type PickQuerySelectableResultRelationsWindows, type PickQuerySelectableResultRelationsWithDataReturnType, type PickQuerySelectableResultRelationsWithDataReturnTypeShapeAs, type PickQuerySelectableResultWindows, type PickQuerySelectableReturnType, type PickQuerySelectableShape, type PickQuerySelectableShapeAs, type PickQuerySelectableShapeRelationsReturnTypeIsSubQuery, type PickQuerySelectableShapeRelationsWithData, type PickQuerySelectableShapeRelationsWithDataAs, type PickQuerySelectableShapeRelationsWithDataAsResultReturnType, type PickQueryShape, type PickQueryShapeAsRelations, type PickQueryShapeResultReturnTypeSinglePrimaryKey, type PickQueryShapeResultSinglePrimaryKey, type PickQueryShapeSinglePrimaryKey, type PickQuerySinglePrimaryKey, type PickQueryTable, type PickQueryTableMetaShapeTableAs, type PickQueryThen, type PickQueryTsQuery, type PickQueryUniqueProperties, type PickQueryWindows, type PickQueryWithData, type PickQueryWithDataColumnTypes, PointColumn, PolygonColumn, PostgisGeographyPointColumn, type PostgisPoint, type PrepareSubQueryForSql, type PrepareSubQueryForSqlArg, type Query, type QueryAfterHook, type QueryArraysResult, QueryAsMethods, type QueryBatchResult, type QueryBeforeActionHook, type QueryBeforeHook, type QueryBuilder, type QueryCatch, type QueryCatchers, QueryClone, type QueryComputedArg, QueryCreate, QueryCreateFrom, type QueryData, type QueryDataAliases, type QueryDataFromItem, type QueryDataJoinTo, type QueryDataScopes, type QueryDataSources, type QueryDataTransform, type QueryDataUnion, QueryDelete, QueryError, type QueryErrorName, QueryExpressions, QueryGet, type QueryHasSelect, type QueryHasWhere, type QueryHelperResult, QueryHookUtils, QueryHooks, type QueryIfResultThen, type QueryInternal, type QueryInternalColumnNameToKey, QueryJoin, QueryLog, type QueryLogObject, type QueryLogOptions, type QueryLogger, type QueryManyTake, type QueryManyTakeOptional, QueryMethods, QueryOrCreate, type QueryOrExpression, type QueryOrExpressionBooleanOrNullResult, type QueryResult, type QueryResultRow, type QueryReturnType, type QueryReturnTypeAll, type QueryReturnTypeOptional, type QuerySchema, QueryScope, type QueryScopeData, type QueryScopes, type QuerySelectable, type QuerySourceItem, QuerySql, type QueryTake, type QueryTakeOptional, type QueryThen, type QueryThenByQuery, type QueryThenByReturnType, type QueryThenShallowSimplify, type QueryThenShallowSimplifyArr, type QueryThenShallowSimplifyOptional, QueryTransaction, QueryTransform, type QueryType, QueryUpdate, QueryUpsert, QueryWithSchema, QueryWrap, type RawSQLValues, RawSql, type RawSqlBase, RealColumn, type RecordBoolean, type RecordKeyTrue, type RecordOfColumnsShapeBase, type RecordOptionalString, type RecordString, type RecordStringOrNumber, type RecordUnknown, RefExpression, type RelationConfigBase, type RelationConfigDataForCreate, type RelationConfigQuery, type RelationJoinQuery, type RelationsBase, type ReturnsQueryOrExpression, type RunAfterQuery, type RuntimeComputedQueryColumn, type SQLArgs, type SQLQueryArgs, type ScopeArgumentQuery, type SearchWeight, type SearchWeightRecord, Select, type SelectArg, type SelectArgs, type SelectAs, type SelectAsArg, type SelectAsFnArg, type SelectAsValue, type SelectItem, type SelectSelf, type SelectSubQueryResult, type SelectableFromShape, type SelectableOfType, type SelectableOrExpression, type SelectableOrExpressionOfType, type SelectableOrExpressions, SerialColumn, type SerialColumnData, type SetQueryResult, type SetQueryReturnsAll, type SetQueryReturnsAllResult, type SetQueryReturnsColumn, type SetQueryReturnsColumnOptional, type SetQueryReturnsColumnOrThrow, type SetQueryReturnsColumnResult, type SetQueryReturnsOne, type SetQueryReturnsOneResult, type SetQueryReturnsPluck, type SetQueryReturnsPluckColumnResult, type SetQueryReturnsRowCount, type SetQueryReturnsRowCountMany, type SetQueryReturnsRows, type SetQueryReturnsValueOptional, type SetQueryReturnsValueOrThrow, type SetQueryReturnsVoid, type SetQueryTableAlias, type SetValueQueryReturnsPluckColumn, type SetValueQueryReturnsValueOrThrow, type ShallowSimplify, type ShapeColumnPrimaryKeys, type ShapeUniqueColumns, type SimpleJoinItemNonSubQueryArgs, type SingleSql, type SingleSqlItem, SmallIntColumn, SmallSerialColumn, type SortDir, type Sql, type SqlCommonOptions, type SqlFn, SqlRefExpression, type StaticSQLArgs, type StorageOptions, StringColumn$1 as StringColumn, type StringData, type SubQueryForSql, TableData, type TableDataFn, type TableDataInput, type TableDataItem, type TableDataItemsUniqueColumnTuples, type TableDataItemsUniqueColumns, type TableDataItemsUniqueConstraints, type TableDataMethods, type TableHook, type TemplateLiteralArgs, TextBaseColumn, TextColumn, type TextColumnData, Then, TimeColumn, type TimeInterval, TimestampColumn, type TimestampHelpers, TimestampTZColumn, type Timestamps, type TopCTE, type TransactionAdapterBase, type TransactionAfterCommitHook, type TransactionArgs, type TransactionOptions, TsQueryColumn, TsVectorColumn, UUIDColumn, UnhandledTypeError, type UnionItem, type UnionKind, type UnionSet, type UnionToIntersection, type UniqueConstraints, type UniqueQueryTypeOrExpression, type UniqueTableDataItem, UnknownColumn, UnsafeSqlExpression, type UpdateArg, type UpdateCtxCollect, type UpdateData, type UpdateQueryDataItem, type UpdateQueryDataObject, type UpdateSelf, type UpdatedAtDataInjector, type UpsertData, type UpsertResult, type UpsertThis, VarCharColumn, VirtualColumn, Where, type WhereArg, type WhereArgs, type WhereInArg, type WhereInColumn, type WhereInItem, type WhereInValues, type WhereItem, type WhereJsonPathEqualsItem, type WhereNotArgs, type WhereOnItem, type WhereOnJoinItem, type WhereQueryBuilder, type WhereSearchItem, type WindowDeclaration, type WindowItem, type WithConfig, type WithConfigs, type WithDataItem, type WithDataItems, type WithItems, type WrapQueryArg, XMLColumn, _addToHookSelect, _addToHookSelectWithTable, _appendQuery, _applyRelationAliases, _checkIfAliased, _clone, _copyQueryAliasToQuery, _createDbSqlMethod, _getQueryAliasOrName, _getQueryAs, _getQueryFreeAlias, _getQueryOuterAliases, _hookSelectColumns, _initQueryBuilder, _join, _joinLateral, _joinLateralProcessArg, _joinReturningArgs, _orCreate, _prependWith, _queryAfterSaveCommit, _queryAll, _queryChangeCounter, _queryCreate, _queryCreateForEachFrom, _queryCreateMany, _queryCreateManyFrom, _queryCreateOneFrom, _queryDefaults, _queryDelete, _queryExec, _queryFindBy, _queryFindByOptional, _queryHookAfterCreate, _queryHookAfterCreateCommit, _queryHookAfterDelete, _queryHookAfterDeleteCommit, _queryHookAfterQuery, _queryHookAfterSave, _queryHookAfterUpdate, _queryHookAfterUpdateCommit, _queryHookBeforeCreate, _queryHookBeforeDelete, _queryHookBeforeQuery, _queryHookBeforeSave, _queryHookBeforeUpdate, _queryInsert, _queryInsertForEachFrom, _queryInsertMany, _queryInsertManyFrom, _queryInsertOneFrom, _queryJoinOn, _queryJoinOnJsonPathEquals, _queryJoinOrOn, _queryOr, _queryOrNot, _queryRows, _querySelect, _querySelectAll, _queryTake, _queryTakeOptional, _queryUpdate, _queryUpdateOrThrow, _queryUpsert, _queryWhere, _queryWhereExists, _queryWhereIn, _queryWhereNot, _queryWhereNotExists, _queryWhereNotOneOf, _queryWhereNotSql, _queryWhereOneOf, _queryWhereSql, _runAfterCommitHooks, _setQueryAlias, _setQueryAs, _setSubQueryAliases, _with, addCode, addColumnParserToQuery, addParserForRawExpression, addParserForSelectItem, addQueryOn, addTopCte, addTopCteSql, addValue, addWithToSql, anyShape, applyBatchTransforms, applyComputedColumns, applyMixins, applyTransforms, arrayDataToCode, arrayMethodNames, assignDbDataToColumn, backtickQuote, callWithThis, checkIfASimpleQuery, cloneQueryBaseUnscoped, codeToString, colors, columnCheckToCode, columnCode, columnDefaultArgumentToCode, columnErrorMessagesToCode, columnExcludesToCode, columnForeignKeysToCode, columnIndexesToCode, columnMethodsToCode, columnsShapeToCode, commitSql, composeCteSingleSql, constraintInnerToCode, constraintToCode, consumeColumnName, countSelect, createCtx, createDbWithAdapter, createSelect, cteToSql, cteToSqlGiveAs, ctesToSql, dateDataToCode, dateMethodNames, deepCompare, defaultSchemaConfig, emptyArray, emptyObject, escapeForLog, escapeForMigration, escapeString, excludeInnerToCode, excludeToCode, exhaustive, extendQuery, filterResult, finalizeNestedHookSelect, foreignKeyArgumentToCode, getCallerFilePath, getClonedQueryData, getColumnBaseType, getColumnTypes, getDefaultLanguage, getDefaultNowFn, getFreeAlias, getFreeSetAlias, getFromSelectColumns, getFullColumnTable, getImportPath, getPrimaryKeys, getQueryAs, getQuerySchema, getSearchLang, getSearchText, getShapeFromSelect, getSqlText, getStackTrace, getThen, getTopCteSize, handleManyData, handleOneData, handleResult, havingToSql, identityToCode, indexInnerToCode, indexToCode, insert, isDefaultTimeStamp, isExpression, isInUserTransaction, isIterable, isObjectEmpty, isQuery, isQueryReturnsAll, isRawSQL, isRelationQuery, isTemplateLiteralArgs, joinSubQuery, joinTruthy, logColors, logParamToLogObject, makeColumnNullable, makeColumnTypes, makeColumnsByType, makeFnExpression, makeInsertSql, makeReturningSql, makeRowToJson, makeSql, moveMutativeQueryToCte, newDelayedRelationSelect, noop, numberDataToCode, numberMethodNames, objectHasValues, omit, orderByToSql, parseRecord, parseTableData, parseTableDataInput, pathToLog, performQuery, pick, pluralize, postgisTypmodToSql, prepareOpArg, prepareSubQueryForSql, primaryKeyInnerToCode, processComputedBatches, processComputedResult, processJoinItem, processSelectArg, pushColumnData, pushHavingSql, pushJoinSql, pushOrNewArray, pushOrNewArrayToObjectImmutable, pushOrderBySql, pushQueryArrayImmutable, pushQueryOn, pushQueryOnForOuter, pushQueryOrOn, pushQueryValueImmutable, pushTableDataCode, pushUnionSql, pushWhereStatementSql, pushWhereToSql, queryColumnNameToKey, queryFrom, queryFromSql, queryMethodByReturnType, queryTypeWithLimitOne, queryWrap, quoteFromWithSchema, quoteObjectKey, quoteSchemaAndTable, quoteTableWithSchema, raw, rawSqlToCode, referencesArgsToCode, requirePrimaryKeys, requireQueryAs, requireTableOrStringFrom, resetDefaultNowFn, resolveSubQueryCallback, returnArg, rollbackSql, saveAliasedShape, searchSourcesToSql, selectAllSql, selectToSql, selectToSqlList, setColumnData, setColumnDefaultParse, setColumnEncode, setColumnParse, setColumnParseNull, setConnectRetryConfig, setCurrentColumnName, setDataValue, setDb, setDefaultLanguage, setDefaultNowFn, setDelayedRelation, setFreeAlias, setFreeTopCteAs, setMoveMutativeQueryToCte, setObjectValueImmutable, setParserForSelectedString, setPrepareSubQueryForSql, setQueryObjectValueImmutable, setQueryOperators, setRawSqlPrepareSubQueryForSql, setSqlCtxSelectList, setTopCteSize, singleQuote, singleQuoteArray, snakeCaseKey, spreadObjectValues, sqlFn, sqlQueryArgsToExpression, stringDataToCode, stringMethodNames, tableDataMethods, templateLiteralSQLToCode, templateLiteralToSQL, testTransaction, throwIfJoinLateral, throwIfNoWhere, throwOnReadOnly, timestampHelpers, toArray, toCamelCase, toPascalCase, toSnakeCase, whereToSql, windowToSql, wrapAdapterFnWithConnectRetry };