pqb 0.69.0 → 0.71.0

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.
@@ -1,4 +1,4 @@
1
- import { Adapter, AdapterClass, AdapterConfigBase, AdapterParams, AdapterSchemaConfigOptions, AfterCommitStandaloneHook, AfterHook, ArrayColumn, ArrayColumnValue, ArrayData, AsyncState, BaseNumberData, BigIntColumn, BigSerialColumn, BitColumn, BitVaryingColumn, BooleanColumn, BoxColumn, ByteaColumn, CidrColumn, CircleColumn, CitextColumn, Code, Codes, Column, ColumnFromDbParams, ColumnSchemaConfig, ColumnSchemaGetterColumns, ColumnSchemaGetterTableClass, ColumnToCodeCtx, ColumnTypeSchemaArg, ColumnsByType, ColumnsShape, ComputedColumnsFromOptions, ComputedOptionsConfig, ComputedOptionsFactory, CreateCtx, CreateData, CreateManyMethodsNames, CreateMethodsNames, CreateSelf, CustomTypeColumn, DateColumn, DateColumnData, DbDomainArg, DbExtension, DbOptions, DbResult, DbSharedOptions, DbSqlMethod, DbStructureDomainsMap, DbTableOptionScopes, DbTableOptions, DecimalColumn, DecimalColumnData, DefaultColumnTypes, DefaultPrivileges, DefaultSchemaConfig, DeleteMethodsNames, DomainColumn, DoublePrecisionColumn, DriverAdapter, DynamicRawSQL, EmptyObject, EmptyTuple, EnumColumn, Expression, ExpressionData, FromArg, FromResult, GeneratorIgnore, HookSelectValue, InetColumn, IntegerColumn, IntervalColumn, IsQuery, IsolationLevel, JSONColumn, JSONTextColumn, JoinQueryMethod, JoinedShapes, LineColumn, LsegColumn, MacAddr8Column, MacAddrColumn, MapTableScopesOption, MaybeArray, MaybePromise, MergeQuery, MoneyColumn, NoPrimaryKeyOption, NonUniqDataItem, NumberColumnData, Operators, OperatorsArray, OperatorsJson, OperatorsOrdinalText, OperatorsText, Ord, PathColumn, PickQueryInputType, PickQueryInternal, PickQueryQ, PickQueryRelations, PickQuerySelectableRelations, PickQueryShape, PointColumn, PolygonColumn, PostgisGeographyPointColumn, QueryAfterHook, QueryBeforeActionHook, QueryBeforeHook, QueryData, QueryHasWhere, QueryHookUtils, QueryHooks, QueryInternal, QueryLogObject, QueryLogOptions, QueryLogger, QueryManyTake, QueryManyTakeOptional, QueryOrExpression, QueryResult, QueryResultRow, QueryReturnType, QuerySchema, QueryScopes, RawSql, RawSqlBase, RealColumn, RecordKeyTrue, RecordOptionalString, RecordString, RecordStringOrNumber, RecordUnknown, RelationConfigBase, RelationJoinQuery, RelationsBase, Rls, RlsPolicy, SchemaConfigFnWithOptions, SearchWeight, SelectableFromShape, SerialColumn, SerialColumnData, ShallowSimplify, ShapeColumnPrimaryKeys, ShapeUniqueColumns, SingleSql, SingleSqlItem, SmallIntColumn, SmallSerialColumn, Sql, SqlFn, SqlSessionState, StorageOptions, StringColumn, StringData, TableData, TableDataFn, TableDataInput, TableDataItem, TableDataItemsUniqueColumnTuples, TableDataItemsUniqueColumns, TableDataItemsUniqueConstraints, TableDataMethods, TemplateLiteralArgs, TextColumn, TimeColumn, TimestampColumn, TimestampTZColumn, Timestamps, ToSQLCtx, ToSqlValues, TransactionAdapter, TransactionAdapterClass, TransactionOptions, TsQueryColumn, TsVectorColumn, UUIDColumn, UniqueConstraints, UniqueTableDataItem, UnknownColumn, UpdateData, UpsertData, UpsertThis, VarCharColumn, VirtualColumn, WhereArg, XMLColumn, _appendQuery, _appendQueryOnUpsertCreate, _clone, _createDbSqlMethod, _hookSelectColumns, _initQueryBuilder, _orCreate, _prependWith, _queryCreate, _queryCreateMany, _queryCreateManyFrom, _queryDefaults, _queryDelete, _queryFindBy, _queryFindByOptional, _queryHookAfterCreate, _queryHookAfterUpdate, _queryInsert, _queryInsertMany, _queryJoinOn, _queryRows, _querySelect, _queryTake, _queryTakeOptional, _queryUpdate, _queryUpdateOrThrow, _queryUpsert, _queryWhere, _queryWhereExists, _queryWhereIn, addCode, addTopCte, addTopCteSql, applyMixins, assignDbDataToColumn, backtickQuote, cloneQueryBaseUnscoped, codeToString, colors, columnsShapeToCode, constraintInnerToCode, consumeColumnName, deepCompare, defaultSchemaConfig, emptyArray, emptyObject, escapeForMigration, escapeString, excludeInnerToCode, exhaustive, getCallerFilePath, getClonedQueryData, getColumnBaseType, getColumnTypes, getDateAsDateFn, getDateAsNumberFn, getDriverErrorCode, getFreeAlias, getFreeSetAlias, getImportPath, getPrimaryKeys, getQueryAs, getQuerySchema, getShapeFromSelect, getSqlText, getStackTrace, getSupportedDefaultPrivileges, indexInnerToCode, internalSchemaConfig, isExpression, isQueryReturnsAll, isRawSQL, logColors, logParamToLogObject, makeColumnNullable, makeColumnTypes, makeColumnsByType, makeConnectRetryConfig, noop, objectHasValues, omit, parseTableData, parseTableDataInput, pathToLog, pick, pluralize, prepareSubQueryForSql, primaryKeyInnerToCode, pushQueryOnForOuter, pushQueryValueImmutable, pushTableDataCode, queryToSql, quoteIdentifier, quoteObjectKey, quoteTableWithSchema, raw, rawSqlToCode, rawSqlToSql, referencesArgsToCode, returnArg, setColumnData, setColumnEncode, setColumnParse, setColumnParseNull, setCurrentColumnName, setDataValue, setDefaultLanguage, setFreeAlias, setQueryObjectValueImmutable, singleQuote, sqlToRawSql, tableDataMethods, toArray, toCamelCase, toPascalCase, toSnakeCase, wrapAdapterFnWithConnectRetry } from "./index.d.ts";
1
+ import { Adapter, AdapterClass, AdapterConfigBase, AdapterParams, AdapterSchemaConfigOptions, AfterCommitStandaloneHook, AfterHook, ArrayColumn, ArrayColumnValue, ArrayData, AsyncState, BaseNumberData, BigIntColumn, BigSerialColumn, BitColumn, BitVaryingColumn, BooleanColumn, BoxColumn, ByteaColumn, CidrColumn, CircleColumn, CitextColumn, Code, Codes, Column, ColumnFromDbParams, ColumnSchemaConfig, ColumnSchemaGetterColumns, ColumnSchemaGetterTableClass, ColumnToCodeCtx, ColumnTypeSchemaArg, ColumnsByType, ColumnsShape, ComputedColumnsFromOptions, ComputedOptionsConfig, ComputedOptionsFactory, CreateCtx, CreateData, CreateManyMethodsNames, CreateMethodsNames, CreateSelf, CustomTypeColumn, DateColumn, DateColumnData, DbDomainArg, DbExtension, DbOptions, DbResult, DbSharedOptions, DbSqlMethod, DbStructureDomainsMap, DbTableOptionScopes, DbTableOptions, DecimalColumn, DecimalColumnData, DefaultColumnTypes, DefaultPrivileges, DefaultSchemaConfig, DeleteMethodsNames, DomainColumn, DoublePrecisionColumn, DriverAdapter, DynamicRawSQL, EmptyObject, EmptyTuple, EnumColumn, Expression, ExpressionData, FromArg, FromResult, GeneratorIgnore, HookSelectValue, InetColumn, IntegerColumn, IntervalColumn, IsQuery, IsolationLevel, JSONColumn, JSONTextColumn, JoinedShapes, LineColumn, LsegColumn, MacAddr8Column, MacAddrColumn, MapTableScopesOption, MaybeArray, MaybePromise, MergeQuery, MoneyColumn, NoPrimaryKeyOption, NonUniqDataItem, NumberColumnData, Operators, OperatorsArray, OperatorsJson, OperatorsOrdinalText, OperatorsText, Ord, PathColumn, PickQueryInputType, PickQueryInternal, PickQueryQ, PickQueryRelations, PickQuerySelectableRelations, PickQueryShape, PointColumn, PolygonColumn, PostgisGeographyPointColumn, QueryAfterHook, QueryBeforeActionHook, QueryBeforeHook, QueryData, QueryHasWhere, QueryHookUtils, QueryHooks, QueryInternal, QueryLogObject, QueryLogOptions, QueryLogger, QueryManyTake, QueryManyTakeOptional, QueryOrExpression, QueryResult, QueryResultRow, QueryReturnType, QuerySchema, QueryScopes, RawSql, RawSqlBase, RealColumn, RecordKeyTrue, RecordOptionalString, RecordString, RecordStringOrNumber, RecordUnknown, RelationConfigBase, RelationJoinQuery, RelationsBase, Rls, RlsPolicy, SchemaConfigFnWithOptions, SearchWeight, SelectableFromShape, SerialColumn, SerialColumnData, ShallowSimplify, ShapeUniqueColumns, SingleSql, SingleSqlItem, SmallIntColumn, SmallSerialColumn, Sql, SqlFn, SqlSessionState, StorageOptions, StringColumn, StringData, TableData, TableDataFn, TableDataInput, TableDataItem, TableDataItemsUniqueColumnTuples, TableDataItemsUniqueColumns, TableDataItemsUniqueConstraints, TableDataMethods, TemplateLiteralArgs, TextColumn, TimeColumn, TimestampColumn, TimestampTZColumn, Timestamps, ToSQLCtx, ToSqlValues, TransactionAdapter, TransactionAdapterClass, TransactionOptions, TsQueryColumn, TsVectorColumn, UUIDColumn, UniqueConstraints, UniqueTableDataItem, UnknownColumn, UpdateData, UpsertData, UpsertThis, VarCharColumn, VirtualColumn, WhereArg, XMLColumn, _appendQuery, _appendQueryOnUpsertCreate, _clone, _createDbSqlMethod, _hookSelectColumns, _initQueryBuilder, _orCreate, _prependWith, _queryCreate, _queryCreateMany, _queryCreateManyFrom, _queryDefaults, _queryDelete, _queryFindBy, _queryFindByOptional, _queryHookAfterCreate, _queryHookAfterUpdate, _queryInsert, _queryInsertMany, _queryJoinOn, _queryRows, _querySelect, _queryTake, _queryTakeOptional, _queryUpdate, _queryUpdateOrThrow, _queryUpsert, _queryWhere, _queryWhereExists, _queryWhereIn, addCode, addTopCte, addTopCteSql, applyMixins, assignDbDataToColumn, backtickQuote, cloneQueryBaseUnscoped, codeToString, colors, columnsShapeToCode, constraintInnerToCode, consumeColumnName, deepCompare, defaultSchemaConfig, emptyArray, emptyObject, escapeForMigration, escapeString, excludeInnerToCode, exhaustive, getCallerFilePath, getClonedQueryData, getColumnBaseType, getColumnTypes, getDateAsDateFn, getDateAsNumberFn, getDriverErrorCode, getFreeAlias, getFreeSetAlias, getImportPath, getPrimaryKeys, getQueryAs, getQuerySchema, getShapeFromSelect, getSqlText, getStackTrace, getSupportedDefaultPrivileges, indexInnerToCode, internalSchemaConfig, isExpression, isQueryReturnsAll, isRawSQL, logColors, logParamToLogObject, makeColumnNullable, makeColumnTypes, makeColumnsByType, makeConnectRetryConfig, noop, objectHasValues, omit, parseTableData, parseTableDataInput, pathToLog, pick, pluralize, prepareSubQueryForSql, primaryKeyInnerToCode, pushQueryOnForOuter, pushQueryValueImmutable, pushTableDataCode, queryToSql, quoteIdentifier, quoteObjectKey, quoteTableWithSchema, raw, rawSqlToCode, rawSqlToSql, referencesArgsToCode, returnArg, setColumnData, setColumnEncode, setColumnParse, setColumnParseNull, setCurrentColumnName, setDataValue, setDefaultLanguage, setFreeAlias, setQueryObjectValueImmutable, singleQuote, sqlToRawSql, tableDataMethods, toArray, toCamelCase, toPascalCase, toSnakeCase, wrapAdapterFnWithConnectRetry } from "./index.d.ts";
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  interface RelationJoinQuery$1 {
4
4
  (joiningQuery: IsQuery$1, baseQuery: IsQuery$1): IsQuery$1;
@@ -668,7 +668,7 @@ interface ColumnSchemaGetterTableClass$1 {
668
668
  }
669
669
  interface ColumnTypeSchemaArg$1 {
670
670
  __schemaType: unknown;
671
- nullable<T extends Column$1.Pick.ForNullable>(this: T): Column$1.Modifiers.Nullable<T, unknown, unknown, unknown>;
671
+ nullable: unknown;
672
672
  encode: unknown;
673
673
  parse: unknown;
674
674
  parseNull: unknown;
@@ -943,7 +943,7 @@ interface NumberColumnData$1 extends BaseNumberData$1, Column$1.Data {
943
943
  identity?: TableData$1.Identity;
944
944
  }
945
945
  interface SerialColumnData$1 extends NumberColumnData$1 {
946
- default: Expression$1;
946
+ default: true;
947
947
  }
948
948
  declare abstract class NumberBaseColumn<Schema extends ColumnSchemaConfig$1, SchemaType extends Schema['__schemaType']> extends Column$1 {
949
949
  __schema: Schema;
@@ -988,27 +988,26 @@ declare class DecimalColumn$1<Schema extends ColumnSchemaConfig$1> extends Numbe
988
988
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
989
989
  toSQL(): string;
990
990
  }
991
- type IdentityColumn<T extends Column$1.Pick.Data> = Column$1.Modifiers.Default<T, Expression$1>;
992
991
  declare class SmallIntColumn$1<Schema extends ColumnSchemaConfig$1> extends IntegerBaseColumn<Schema> {
993
992
  dataType: "int2";
994
993
  querySchema: ReturnType<Schema['int']>;
995
994
  constructor(schema: Schema);
996
995
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
997
- identity<T extends Column$1.Pick.Data>(this: T, options?: TableData$1.Identity): IdentityColumn<T>;
996
+ identity<T extends Column$1.Pick.Data>(this: T, options?: TableData$1.Identity): Column$1.Modifiers.HasDefault<T>;
998
997
  }
999
998
  declare class IntegerColumn$1<Schema extends ColumnSchemaConfig$1> extends IntegerBaseColumn<Schema> {
1000
999
  dataType: "int4";
1001
1000
  querySchema: ReturnType<Schema['int']>;
1002
1001
  constructor(schema: Schema);
1003
1002
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1004
- identity<T extends Column$1.Pick.Data>(this: T, options?: TableData$1.Identity): IdentityColumn<T>;
1003
+ identity<T extends Column$1.Pick.Data>(this: T, options?: TableData$1.Identity): Column$1.Modifiers.HasDefault<T>;
1005
1004
  }
1006
1005
  declare class BigIntColumn$1<Schema extends ColumnSchemaConfig$1> extends NumberAsStringBaseColumn<Schema, string | number | bigint> {
1007
1006
  dataType: "int8";
1008
1007
  querySchema: ReturnType<Schema['stringSchema']>;
1009
1008
  constructor(schema: Schema);
1010
1009
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1011
- identity<T extends Column$1.Pick.Data>(this: T, options?: TableData$1.Identity): IdentityColumn<T>;
1010
+ identity<T extends Column$1.Pick.Data>(this: T, options?: TableData$1.Identity): Column$1.Modifiers.HasDefault<T>;
1012
1011
  }
1013
1012
  declare class RealColumn$1<Schema extends ColumnSchemaConfig$1> extends NumberBaseColumn<Schema, ReturnType<Schema['number']>> {
1014
1013
  dataType: "float4";
@@ -1203,6 +1202,7 @@ declare class JSONTextColumn$1<T, Schema extends ColumnTypeSchemaArg$1, InputSch
1203
1202
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1204
1203
  }
1205
1204
  interface DefaultSchemaConfig$1 extends ColumnSchemaConfig$1<Column$1> {
1205
+ nullable<T extends Column$1.Pick.ForNullable>(this: T): Column$1.Modifiers.Nullable<T>;
1206
1206
  parse<T extends Column$1.Pick.ForParse, Output>(this: T, fn: (input: T['__type']) => Output): Column$1.Modifiers.Parse<T, unknown, Output>;
1207
1207
  parseNull<T extends Column$1.Pick.ForParseNull, Output>(this: T, fn: () => Output): Column$1.Modifiers.ParseNull<T, unknown, Output>;
1208
1208
  encode<T extends Column$1.Pick.Type, Input>(this: T, fn: (input: Input) => unknown): Column$1.Modifiers.Encode<T, unknown, Input>;
@@ -1599,7 +1599,7 @@ declare class UUIDColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1
1599
1599
  T & {
1600
1600
  data: {
1601
1601
  primaryKey: Name;
1602
- default: RawSqlBase$1;
1602
+ default: true;
1603
1603
  };
1604
1604
  };
1605
1605
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
@@ -1651,8 +1651,8 @@ declare class BooleanColumn$1<Schema extends ColumnSchemaConfig$1> extends Colum
1651
1651
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1652
1652
  }
1653
1653
  interface Timestamps$1<T extends Column$1.Pick.Data> {
1654
- createdAt: Column$1.Modifiers.Default<T, RawSqlBase$1>;
1655
- updatedAt: Column$1.Modifiers.Default<T, RawSqlBase$1>;
1654
+ createdAt: Column$1.Modifiers.HasDefault<T>;
1655
+ updatedAt: Column$1.Modifiers.HasDefault<T>;
1656
1656
  }
1657
1657
  interface TimestampHelpers {
1658
1658
  /**
@@ -1734,7 +1734,7 @@ interface DefaultColumnTypes$1<SchemaConfig extends ColumnSchemaConfig$1> extend
1734
1734
  decimal: SchemaConfig['decimal'];
1735
1735
  real: SchemaConfig['real'];
1736
1736
  doublePrecision: SchemaConfig['doublePrecision'];
1737
- identity(options?: TableData$1.Identity): IdentityColumn<ReturnType<SchemaConfig['integer']>>;
1737
+ identity(options?: TableData$1.Identity): Column$1.Modifiers.HasDefault<ReturnType<SchemaConfig['integer']>>;
1738
1738
  smallSerial: SchemaConfig['smallSerial'];
1739
1739
  serial: SchemaConfig['serial'];
1740
1740
  bigSerial: SchemaConfig['bigSerial'];
@@ -3164,169 +3164,6 @@ interface AggregateOptions<T extends PickQuerySelectableResultRelationsWindows>
3164
3164
  over?: Over<T>;
3165
3165
  }
3166
3166
  type Over<T extends PickQuerySelectableResultWindows> = keyof T['windows'] | WindowArgDeclaration<T>;
3167
- interface ColumnsShape$1 {
3168
- [K: string]: Column$1;
3169
- }
3170
- declare namespace ColumnsShape$1 {
3171
- export type DefaultSelectKeys<S extends Column$1.QueryColumnsInit> = { [K in keyof S]: S[K]['data']['explicitSelect'] extends true | undefined ? never : K }[keyof S];
3172
- export type DefaultOutput<Set extends Column$1.QueryColumnsInit> = { [K in DefaultSelectKeys<Set>]: Set[K]['__outputType'] };
3173
- export type Input<Shape extends Column$1.QueryColumnsInit, AppReadOnly = { [K in keyof Shape]: Shape[K]['data']['appReadOnly'] extends true ? K : never }[keyof Shape], Optional extends keyof Shape = { [K in keyof Shape]: Shape[K]['data']['optional'] extends true ? K : never }[keyof Shape]> = { [K in Exclude<keyof Shape, AppReadOnly | Optional>]: Shape[K]['__inputType'] } & { [K in Exclude<Optional, AppReadOnly>]?: Shape[K]['__inputType'] };
3174
- export type InputPartial<Shape extends Column$1.QueryColumnsInit> = { [K in keyof Shape]?: Shape[K]['__inputType'] };
3175
- export type Output<Shape extends Column$1.QueryColumns> = { [K in keyof Shape]: Shape[K]['__outputType'] };
3176
- export type DefaultSelectOutput<Shape extends Column$1.QueryColumnsInit> = { [K in { [K in keyof Shape]: Shape[K]['data']['explicitSelect'] extends true | undefined ? never : K }[keyof Shape]]: Shape[K]['__outputType'] };
3177
- export interface MapToObjectColumn<Shape extends Column$1.QueryColumns> {
3178
- dataType: 'object';
3179
- __type: { [K in keyof Shape]: Shape[K]['__type'] };
3180
- __outputType: ShallowSimplify$1<ObjectOutput<Shape>>;
3181
- __queryType: { [K in keyof Shape]: Shape[K]['__queryType'] };
3182
- operators: OperatorsAny;
3183
- }
3184
- export interface MapToNullableObjectColumn<Shape extends Column$1.QueryColumns> {
3185
- dataType: 'object';
3186
- __type: { [K in keyof Shape]: Shape[K]['__type'] };
3187
- __outputType: ShallowSimplify$1<ObjectOutput<Shape>> | undefined;
3188
- __queryType: { [K in keyof Shape]: Shape[K]['__queryType'] } | null;
3189
- operators: OperatorsAny;
3190
- }
3191
- export interface MapToPluckColumn<Shape extends Column$1.QueryColumns> {
3192
- dataType: 'array';
3193
- __type: Shape['pluck']['__type'][];
3194
- __outputType: Shape['pluck']['__outputType'][];
3195
- __queryType: Shape['pluck']['__queryType'][];
3196
- operators: OperatorsAny;
3197
- }
3198
- export interface MapToObjectArrayColumn<Shape extends Column$1.QueryColumns> {
3199
- dataType: 'array';
3200
- __type: { [K in keyof Shape]: Shape[K]['__type'] }[];
3201
- __outputType: ShallowSimplify$1<ObjectOutput<Shape>>[];
3202
- __queryType: { [K in keyof Shape]: Shape[K]['__queryType'] }[];
3203
- operators: OperatorsAny;
3204
- }
3205
- type ObjectOutput<Shape extends Column$1.QueryColumns> = { [K in keyof Shape]: Shape[K]['__outputType'] };
3206
- export {};
3207
- }
3208
- interface SelectSelf extends PickQuerySelectable, PickQueryHasSelect, PickQueryDefaultSelect, PickQueryShape$1, PickQueryRelations$1, PickQueryResult, PickQueryReturnType, PickQueryWithData {}
3209
- type SelectArgs<T extends SelectSelf> = ('*' | keyof T['__selectable'])[];
3210
- interface SubQueryAddition<T extends PickQueryWithData> extends IsSubQuery {
3211
- withData: T['withData'];
3212
- }
3213
- type SelectAsFnArg<T extends PickQueryRelationsWithData> = EmptyObject$1 extends T['relations'] ? T : { [K in keyof T['relations'] | keyof T]: K extends keyof T['relations'] ? RelationQueryMaybeSingle<T['relations'][K]> & SubQueryAddition<T> : K extends keyof T ? T[K] : never };
3214
- interface SelectAsArg<T extends SelectSelf> {
3215
- [K: string]: keyof T['__selectable'] | Expression$1 | ((q: SelectAsFnArg<T>) => unknown);
3216
- }
3217
- type SelectAsFnReturnType = {
3218
- result: Column$1.QueryColumns;
3219
- returnType: Exclude<QueryReturnType$1, 'rows'>;
3220
- } | Expression$1;
3221
- interface SelectAsCheckReturnTypes {
3222
- [K: string]: PropertyKey | Expression$1 | ((q: never) => SelectAsFnReturnType);
3223
- }
3224
- type SelectReturnType<T extends PickQueryReturnType> = T['returnType'] extends 'valueOrThrow' ? 'oneOrThrow' : T extends 'value' ? 'one' : T['returnType'] extends 'pluck' ? 'all' : T['returnType'];
3225
- type SelectResult<T extends SelectSelf, Columns extends PropertyKey[]> = { [K in keyof T]: K extends '__hasSelect' ? true : K extends 'result' ? { [K in '*' extends Columns[number] ? Exclude<Columns[number], '*'> | T['__defaultSelect'] : Columns[number] as T['__selectable'][K]['as']]: T['__selectable'][K]['column'] } & (T['__hasSelect'] extends (T['returnType'] extends 'value' | 'valueOrThrow' ? never : true) ? Omit<T['result'], Columns[number]> : unknown) : K extends 'returnType' ? SelectReturnType<T> : K extends 'then' ? QueryThenByReturnType<SelectReturnType<T>, { [K in '*' extends Columns[number] ? Exclude<Columns[number], '*'> | T['__defaultSelect'] : Columns[number] as T['__selectable'][K]['as']]: T['__selectable'][K]['column'] } & (T['__hasSelect'] extends (T['returnType'] extends 'value' | 'valueOrThrow' ? never : true) ? Omit<T['result'], Columns[number]> : unknown)> : T[K] };
3226
- type SelectResultObj<T extends SelectSelf, Obj> = Obj extends SelectAsCheckReturnTypes ? { [K in keyof T]: K extends '__hasSelect' ? true : K extends '__selectable' ? T['__selectable'] & SelectAsSelectable<Obj> : K extends 'result' ? { [K in T['__hasSelect'] extends (T['returnType'] extends 'value' | 'valueOrThrow' ? never : true) ? keyof Obj | keyof T['result'] : keyof Obj]: K extends keyof Obj ? SelectAsValueResult<T, Obj[K]> : K extends keyof T['result'] ? T['result'][K] : never } : K extends 'returnType' ? SelectReturnType<T> : K extends 'then' ? QueryThenByReturnType<SelectReturnType<T>, { [K in T['__hasSelect'] extends (T['returnType'] extends 'value' | 'valueOrThrow' ? never : true) ? keyof Obj | keyof T['result'] : keyof Obj]: K extends keyof Obj ? SelectAsValueResult<T, Obj[K]> : K extends keyof T['result'] ? T['result'][K] : never }> : T[K] } : `Invalid return type of ${{ [K in keyof Obj]: Obj[K] extends ((...args: any[]) => any) ? ReturnType<Obj[K]> extends SelectAsFnReturnType ? never : K : never }[keyof Obj] & string}`;
3227
- type SelectResultColumnsAndObj<T extends SelectSelf, Columns extends PropertyKey[], Obj> = { [K in keyof T]: K extends '__hasSelect' ? true : K extends '__selectable' ? T['__selectable'] & SelectAsSelectable<Obj> : K extends 'result' ? // Combine previously selected items, all columns if * was provided,
3228
- { [K in ('*' extends Columns[number] ? Exclude<Columns[number], '*'> | T['__defaultSelect'] : Columns[number]) | keyof Obj as K extends Columns[number] ? T['__selectable'][K]['as'] : K]: K extends keyof Obj ? SelectAsValueResult<T, Obj[K]> : T['__selectable'][K]['column'] } & (T['__hasSelect'] extends (T['returnType'] extends 'value' | 'valueOrThrow' ? never : true) ? Omit<T['result'], Columns[number]> : unknown) : K extends 'returnType' ? SelectReturnType<T> : K extends 'then' ? QueryThenByReturnType<SelectReturnType<T>, { [K in ('*' extends Columns[number] ? Exclude<Columns[number], '*'> | T['__defaultSelect'] : Columns[number]) | keyof Obj as K extends Columns[number] ? T['__selectable'][K]['as'] : K]: K extends keyof Obj ? SelectAsValueResult<T, Obj[K]> : T['__selectable'][K]['column'] } & (T['__hasSelect'] extends (T['returnType'] extends 'value' | 'valueOrThrow' ? never : true) ? Omit<T['result'], Columns[number]> : unknown)> : T[K] };
3229
- interface AllowedRelationOneQueryForSelectable extends IsSubQuery {
3230
- result: Column$1.QueryColumns;
3231
- returnType: 'value' | 'valueOrThrow' | 'one' | 'oneOrThrow';
3232
- }
3233
- type SelectAsSelectable<Obj> = UnionToIntersection<{ [K in keyof Obj]: Obj[K] extends ((q: never) => infer R extends AllowedRelationOneQueryForSelectable) ? { [C in R['returnType'] extends 'value' | 'valueOrThrow' ? K : keyof R['result'] as R['returnType'] extends 'value' | 'valueOrThrow' ? K : `${K & string}.${C & string}`]: {
3234
- as: C;
3235
- column: R['returnType'] extends 'value' | 'valueOrThrow' ? R['result']['value'] : R['result'][C & keyof R['result']];
3236
- } } : never }[keyof Obj]>;
3237
- type SelectAsValueResult<T extends SelectSelf, Arg> = Arg extends keyof T['__selectable'] ? T['__selectable'][Arg]['column'] : Arg extends Expression$1 ? Arg['result']['value'] : Arg extends ((q: never) => IsQuery$1) ? SelectSubQueryResult<ReturnType<Arg>> : Arg extends ((q: never) => Expression$1) ? ReturnType<Arg>['result']['value'] : Arg extends ((q: never) => IsQuery$1 | Expression$1) ? SelectSubQueryResult<Exclude<ReturnType<Arg>, Expression$1>> | Exclude<ReturnType<Arg>, IsQuery$1>['result']['value'] : never;
3238
- type SelectSubQueryResult<Arg extends SelectSelf> = Arg['returnType'] extends undefined | 'all' ? ColumnsShape$1.MapToObjectArrayColumn<Arg['result']> : Arg['returnType'] extends 'value' | 'valueOrThrow' ? Arg['result']['value'] : Arg['returnType'] extends 'pluck' ? ColumnsShape$1.MapToPluckColumn<Arg['result']> : Arg['returnType'] extends 'one' ? ColumnsShape$1.MapToNullableObjectColumn<Arg['result']> : ColumnsShape$1.MapToObjectColumn<Arg['result']>;
3239
- declare class Select {
3240
- /**
3241
- * Takes a list of columns to be selected, and by default, the query builder will select all columns of the table.
3242
- *
3243
- * The last argument can be an object. Keys of the object are column aliases, value can be a column name, sub-query, or raw SQL expression.
3244
- *
3245
- * ```ts
3246
- * import { sql } from './baseTable'
3247
- *
3248
- * // select columns of the table:
3249
- * db.table.select('id', 'name', { idAlias: 'id' });
3250
- *
3251
- * // accepts columns with table names:
3252
- * db.table.select('user.id', 'user.name', { nameAlias: 'user.name' });
3253
- *
3254
- * // table name may refer to the current table or a joined table:
3255
- * db.table
3256
- * .join(db.message, 'authorId', 'user.id')
3257
- * .select('user.name', 'message.text', { textAlias: 'message.text' });
3258
- *
3259
- * // select value from the sub-query,
3260
- * // this sub-query should return a single record and a single column:
3261
- * db.table.select({
3262
- * subQueryResult: Otherdb.table.select('column').take(),
3263
- * });
3264
- *
3265
- * // select raw SQL value, specify the returning type via <generic> syntax:
3266
- * db.table.select({
3267
- * raw: sql<number>`1 + 2`,
3268
- * });
3269
- *
3270
- * // select raw SQL value, the resulting type can be set by providing a column type in such way:
3271
- * db.table.select({
3272
- * raw: sql`1 + 2`.type((t) => t.integer()),
3273
- * });
3274
- *
3275
- * // same raw SQL query as above, but the sql is returned from a callback
3276
- * db.table.select({
3277
- * raw: () => sql`1 + 2`.type((t) => t.integer()),
3278
- * });
3279
- * ```
3280
- *
3281
- * When you use the ORM and defined relations, `select` can also accept callbacks with related table queries:
3282
- *
3283
- * ```ts
3284
- * await db.author.select({
3285
- * allBooks: (q) => q.books,
3286
- * firstBook: (q) => q.books.order({ createdAt: 'ASC' }).take(),
3287
- * booksCount: (q) => q.books.count(),
3288
- * });
3289
- * ```
3290
- *
3291
- * When you're selecting a relation that's connected via `belongsTo` or `hasOne`, it becomes available to use in `order` or in `where`:
3292
- *
3293
- * ```ts
3294
- * // select books with their authors included, order by author name and filter by author column:
3295
- * await db.books
3296
- * .select({
3297
- * author: (q) => q.author,
3298
- * })
3299
- * .order('author.name')
3300
- * .where({ 'author.isPopular': true });
3301
- * ```
3302
- */
3303
- select<T extends SelectSelf, Columns extends SelectArgs<T>>(this: T, ...args: Columns): SelectResult<T, Columns>;
3304
- select<T extends SelectSelf, Obj extends SelectAsArg<T>>(this: T, obj: Obj): SelectResultObj<T, Obj>;
3305
- select<T extends SelectSelf, Columns extends SelectArgs<T>, Obj extends SelectAsArg<T>>(this: T, ...args: [...columns: Columns, obj: Obj]): SelectResultColumnsAndObj<T, Columns, Obj>;
3306
- /**
3307
- * When querying the table or creating records, all columns are selected by default,
3308
- * but updating and deleting queries are returning affected row counts by default.
3309
- *
3310
- * Use `selectAll` to select all columns. If the `.select` method was applied before it will be discarded.
3311
- *
3312
- * ```ts
3313
- * const selectFull = await db.table
3314
- * .select('id', 'name') // discarded by `selectAll`
3315
- * .selectAll();
3316
- *
3317
- * const updatedFull = await db.table.selectAll().where(conditions).update(data);
3318
- *
3319
- * const deletedFull = await db.table.selectAll().where(conditions).delete();
3320
- * ```
3321
- */
3322
- selectAll<T extends SelectSelf>(this: T): SelectResult<T, ['*']>;
3323
- }
3324
- interface QueryGetSelf extends PickQuerySelectable, PickQueryRelationsWithData {}
3325
- type GetArg<T extends QueryGetSelf> = GetStringArg<T> | Expression$1 | ((q: SelectAsFnArg<T>) => Expression$1 | Query.Pick.SingleValueResult);
3326
- type GetStringArg<T extends PickQuerySelectable> = keyof T['__selectable'] & string;
3327
- type ResolveGetArgColumn<Arg> = Arg extends Expression$1 ? Arg['result']['value'] : Arg extends ((q: never) => infer R) ? R extends Expression$1 ? R['result']['value'] : R extends Query.Pick.SingleValueResult ? R['result']['value'] : never : never;
3328
- type GetResult<T extends QueryGetSelf, Arg extends GetArg<T>> = Arg extends string ? SetQueryReturnsValueOrThrow<T, Arg> : SetQueryReturnsColumnOrThrow<T, ResolveGetArgColumn<Arg>>;
3329
- type GetResultOptional<T extends QueryGetSelf, Arg extends GetArg<T>> = Arg extends string ? SetQueryReturnsValueOptional<T, Arg> : SetQueryReturnsColumnOptional<T, ResolveGetArgColumn<Arg>>;
3330
3167
  type HeadlineSearchArg<T extends PickQueryTsQuery> = Exclude<T['__tsQuery'], undefined>;
3331
3168
  interface HeadlineParams<T extends PickQuerySelectable> {
3332
3169
  text?: SelectableOrExpressionOfType<T, Column$1.Pick.QueryColumnOfType<string>>;
@@ -3663,16 +3500,6 @@ interface AggregateArgTypes {
3663
3500
  }
3664
3501
  interface AggregateMethods extends SearchAggregateMethods {}
3665
3502
  declare class AggregateMethods {
3666
- /**
3667
- * Use `exists()` to check if there is at least one record-matching condition.
3668
- *
3669
- * It will discard previous `select` statements if any. Returns a boolean.
3670
- *
3671
- * ```ts
3672
- * const exists: boolean = await db.table.where(...conditions).exists();
3673
- * ```
3674
- */
3675
- exists<T extends QueryGetSelf>(this: T): SetQueryReturnsColumnOrThrow<T, BooleanQueryColumn>;
3676
3503
  /**
3677
3504
  * Count records with the `count` function:
3678
3505
  *
@@ -5823,6 +5650,169 @@ declare class FromMethods {
5823
5650
  */
5824
5651
  only<T>(this: T, only?: boolean): T;
5825
5652
  }
5653
+ interface ColumnsShape$1 {
5654
+ [K: string]: Column$1;
5655
+ }
5656
+ declare namespace ColumnsShape$1 {
5657
+ export type DefaultSelectKeys<S extends Column$1.QueryColumnsInit> = { [K in keyof S]: S[K]['data']['explicitSelect'] extends true | undefined ? never : K }[keyof S];
5658
+ export type DefaultOutput<Set extends Column$1.QueryColumnsInit> = { [K in DefaultSelectKeys<Set>]: Set[K]['__outputType'] };
5659
+ export type Input<Shape extends Column$1.QueryColumnsInit, AppReadOnly = { [K in keyof Shape]: Shape[K]['data']['appReadOnly'] extends true ? K : never }[keyof Shape], Optional extends keyof Shape = { [K in keyof Shape]: Shape[K]['data']['optional'] extends true ? K : never }[keyof Shape]> = { [K in Exclude<keyof Shape, AppReadOnly | Optional>]: Shape[K]['__inputType'] } & { [K in Exclude<Optional, AppReadOnly>]?: Shape[K]['__inputType'] };
5660
+ export type InputPartial<Shape extends Column$1.QueryColumnsInit> = { [K in keyof Shape]?: Shape[K]['__inputType'] };
5661
+ export type Output<Shape extends Column$1.QueryColumns> = { [K in keyof Shape]: Shape[K]['__outputType'] };
5662
+ export type DefaultSelectOutput<Shape extends Column$1.QueryColumnsInit> = { [K in { [K in keyof Shape]: Shape[K]['data']['explicitSelect'] extends true | undefined ? never : K }[keyof Shape]]: Shape[K]['__outputType'] };
5663
+ export interface MapToObjectColumn<Shape extends Column$1.QueryColumns> {
5664
+ dataType: 'object';
5665
+ __type: { [K in keyof Shape]: Shape[K]['__type'] };
5666
+ __outputType: ShallowSimplify$1<ObjectOutput<Shape>>;
5667
+ __queryType: { [K in keyof Shape]: Shape[K]['__queryType'] };
5668
+ operators: OperatorsAny;
5669
+ }
5670
+ export interface MapToNullableObjectColumn<Shape extends Column$1.QueryColumns> {
5671
+ dataType: 'object';
5672
+ __type: { [K in keyof Shape]: Shape[K]['__type'] };
5673
+ __outputType: ShallowSimplify$1<ObjectOutput<Shape>> | undefined;
5674
+ __queryType: { [K in keyof Shape]: Shape[K]['__queryType'] } | null;
5675
+ operators: OperatorsAny;
5676
+ }
5677
+ export interface MapToPluckColumn<Shape extends Column$1.QueryColumns> {
5678
+ dataType: 'array';
5679
+ __type: Shape['pluck']['__type'][];
5680
+ __outputType: Shape['pluck']['__outputType'][];
5681
+ __queryType: Shape['pluck']['__queryType'][];
5682
+ operators: OperatorsAny;
5683
+ }
5684
+ export interface MapToObjectArrayColumn<Shape extends Column$1.QueryColumns> {
5685
+ dataType: 'array';
5686
+ __type: { [K in keyof Shape]: Shape[K]['__type'] }[];
5687
+ __outputType: ShallowSimplify$1<ObjectOutput<Shape>>[];
5688
+ __queryType: { [K in keyof Shape]: Shape[K]['__queryType'] }[];
5689
+ operators: OperatorsAny;
5690
+ }
5691
+ type ObjectOutput<Shape extends Column$1.QueryColumns> = { [K in keyof Shape]: Shape[K]['__outputType'] };
5692
+ export {};
5693
+ }
5694
+ interface SelectSelf extends PickQuerySelectable, PickQueryHasSelect, PickQueryDefaultSelect, PickQueryShape$1, PickQueryRelations$1, PickQueryResult, PickQueryReturnType, PickQueryWithData {}
5695
+ type SelectArgs<T extends SelectSelf> = ('*' | keyof T['__selectable'])[];
5696
+ interface SubQueryAddition<T extends PickQueryWithData> extends IsSubQuery {
5697
+ withData: T['withData'];
5698
+ }
5699
+ type SelectAsFnArg<T extends PickQueryRelationsWithData> = EmptyObject$1 extends T['relations'] ? T : { [K in keyof T['relations'] | keyof T]: K extends keyof T['relations'] ? RelationQueryMaybeSingle<T['relations'][K]> & SubQueryAddition<T> : K extends keyof T ? T[K] : never };
5700
+ interface SelectAsArg<T extends SelectSelf> {
5701
+ [K: string]: keyof T['__selectable'] | Expression$1 | ((q: SelectAsFnArg<T>) => unknown);
5702
+ }
5703
+ type SelectAsFnReturnType = {
5704
+ result: Column$1.QueryColumns;
5705
+ returnType: Exclude<QueryReturnType$1, 'rows'>;
5706
+ } | Expression$1;
5707
+ interface SelectAsCheckReturnTypes {
5708
+ [K: string]: PropertyKey | Expression$1 | ((q: never) => SelectAsFnReturnType);
5709
+ }
5710
+ type SelectReturnType<T extends PickQueryReturnType> = T['returnType'] extends 'valueOrThrow' ? 'oneOrThrow' : T extends 'value' ? 'one' : T['returnType'] extends 'pluck' ? 'all' : T['returnType'];
5711
+ type SelectResult<T extends SelectSelf, Columns extends PropertyKey[]> = { [K in keyof T]: K extends '__hasSelect' ? true : K extends 'result' ? { [K in '*' extends Columns[number] ? Exclude<Columns[number], '*'> | T['__defaultSelect'] : Columns[number] as T['__selectable'][K]['as']]: T['__selectable'][K]['column'] } & (T['__hasSelect'] extends (T['returnType'] extends 'value' | 'valueOrThrow' ? never : true) ? Omit<T['result'], Columns[number]> : unknown) : K extends 'returnType' ? SelectReturnType<T> : K extends 'then' ? QueryThenByReturnType<SelectReturnType<T>, { [K in '*' extends Columns[number] ? Exclude<Columns[number], '*'> | T['__defaultSelect'] : Columns[number] as T['__selectable'][K]['as']]: T['__selectable'][K]['column'] } & (T['__hasSelect'] extends (T['returnType'] extends 'value' | 'valueOrThrow' ? never : true) ? Omit<T['result'], Columns[number]> : unknown)> : T[K] };
5712
+ type SelectResultObj<T extends SelectSelf, Obj> = Obj extends SelectAsCheckReturnTypes ? { [K in keyof T]: K extends '__hasSelect' ? true : K extends '__selectable' ? T['__selectable'] & SelectAsSelectable<Obj> : K extends 'result' ? { [K in T['__hasSelect'] extends (T['returnType'] extends 'value' | 'valueOrThrow' ? never : true) ? keyof Obj | keyof T['result'] : keyof Obj]: K extends keyof Obj ? SelectAsValueResult<T, Obj[K]> : K extends keyof T['result'] ? T['result'][K] : never } : K extends 'returnType' ? SelectReturnType<T> : K extends 'then' ? QueryThenByReturnType<SelectReturnType<T>, { [K in T['__hasSelect'] extends (T['returnType'] extends 'value' | 'valueOrThrow' ? never : true) ? keyof Obj | keyof T['result'] : keyof Obj]: K extends keyof Obj ? SelectAsValueResult<T, Obj[K]> : K extends keyof T['result'] ? T['result'][K] : never }> : T[K] } : `Invalid return type of ${{ [K in keyof Obj]: Obj[K] extends ((...args: any[]) => any) ? ReturnType<Obj[K]> extends SelectAsFnReturnType ? never : K : never }[keyof Obj] & string}`;
5713
+ type SelectResultColumnsAndObj<T extends SelectSelf, Columns extends PropertyKey[], Obj> = { [K in keyof T]: K extends '__hasSelect' ? true : K extends '__selectable' ? T['__selectable'] & SelectAsSelectable<Obj> : K extends 'result' ? // Combine previously selected items, all columns if * was provided,
5714
+ { [K in ('*' extends Columns[number] ? Exclude<Columns[number], '*'> | T['__defaultSelect'] : Columns[number]) | keyof Obj as K extends Columns[number] ? T['__selectable'][K]['as'] : K]: K extends keyof Obj ? SelectAsValueResult<T, Obj[K]> : T['__selectable'][K]['column'] } & (T['__hasSelect'] extends (T['returnType'] extends 'value' | 'valueOrThrow' ? never : true) ? Omit<T['result'], Columns[number]> : unknown) : K extends 'returnType' ? SelectReturnType<T> : K extends 'then' ? QueryThenByReturnType<SelectReturnType<T>, { [K in ('*' extends Columns[number] ? Exclude<Columns[number], '*'> | T['__defaultSelect'] : Columns[number]) | keyof Obj as K extends Columns[number] ? T['__selectable'][K]['as'] : K]: K extends keyof Obj ? SelectAsValueResult<T, Obj[K]> : T['__selectable'][K]['column'] } & (T['__hasSelect'] extends (T['returnType'] extends 'value' | 'valueOrThrow' ? never : true) ? Omit<T['result'], Columns[number]> : unknown)> : T[K] };
5715
+ interface AllowedRelationOneQueryForSelectable extends IsSubQuery {
5716
+ result: Column$1.QueryColumns;
5717
+ returnType: 'value' | 'valueOrThrow' | 'one' | 'oneOrThrow';
5718
+ }
5719
+ type SelectAsSelectable<Obj> = UnionToIntersection<{ [K in keyof Obj]: Obj[K] extends ((q: never) => infer R extends AllowedRelationOneQueryForSelectable) ? { [C in R['returnType'] extends 'value' | 'valueOrThrow' ? K : keyof R['result'] as R['returnType'] extends 'value' | 'valueOrThrow' ? K : `${K & string}.${C & string}`]: {
5720
+ as: C;
5721
+ column: R['returnType'] extends 'value' | 'valueOrThrow' ? R['result']['value'] : R['result'][C & keyof R['result']];
5722
+ } } : never }[keyof Obj]>;
5723
+ type SelectAsValueResult<T extends SelectSelf, Arg> = Arg extends keyof T['__selectable'] ? T['__selectable'][Arg]['column'] : Arg extends Expression$1 ? Arg['result']['value'] : Arg extends ((q: never) => IsQuery$1) ? SelectSubQueryResult<ReturnType<Arg>> : Arg extends ((q: never) => Expression$1) ? ReturnType<Arg>['result']['value'] : Arg extends ((q: never) => IsQuery$1 | Expression$1) ? SelectSubQueryResult<Exclude<ReturnType<Arg>, Expression$1>> | Exclude<ReturnType<Arg>, IsQuery$1>['result']['value'] : never;
5724
+ type SelectSubQueryResult<Arg extends SelectSelf> = Arg['returnType'] extends undefined | 'all' ? ColumnsShape$1.MapToObjectArrayColumn<Arg['result']> : Arg['returnType'] extends 'value' | 'valueOrThrow' ? Arg['result']['value'] : Arg['returnType'] extends 'pluck' ? ColumnsShape$1.MapToPluckColumn<Arg['result']> : Arg['returnType'] extends 'one' ? ColumnsShape$1.MapToNullableObjectColumn<Arg['result']> : ColumnsShape$1.MapToObjectColumn<Arg['result']>;
5725
+ declare class Select {
5726
+ /**
5727
+ * Takes a list of columns to be selected, and by default, the query builder will select all columns of the table.
5728
+ *
5729
+ * The last argument can be an object. Keys of the object are column aliases, value can be a column name, sub-query, or raw SQL expression.
5730
+ *
5731
+ * ```ts
5732
+ * import { sql } from './baseTable'
5733
+ *
5734
+ * // select columns of the table:
5735
+ * db.table.select('id', 'name', { idAlias: 'id' });
5736
+ *
5737
+ * // accepts columns with table names:
5738
+ * db.table.select('user.id', 'user.name', { nameAlias: 'user.name' });
5739
+ *
5740
+ * // table name may refer to the current table or a joined table:
5741
+ * db.table
5742
+ * .join(db.message, 'authorId', 'user.id')
5743
+ * .select('user.name', 'message.text', { textAlias: 'message.text' });
5744
+ *
5745
+ * // select value from the sub-query,
5746
+ * // this sub-query should return a single record and a single column:
5747
+ * db.table.select({
5748
+ * subQueryResult: Otherdb.table.select('column').take(),
5749
+ * });
5750
+ *
5751
+ * // select raw SQL value, specify the returning type via <generic> syntax:
5752
+ * db.table.select({
5753
+ * raw: sql<number>`1 + 2`,
5754
+ * });
5755
+ *
5756
+ * // select raw SQL value, the resulting type can be set by providing a column type in such way:
5757
+ * db.table.select({
5758
+ * raw: sql`1 + 2`.type((t) => t.integer()),
5759
+ * });
5760
+ *
5761
+ * // same raw SQL query as above, but the sql is returned from a callback
5762
+ * db.table.select({
5763
+ * raw: () => sql`1 + 2`.type((t) => t.integer()),
5764
+ * });
5765
+ * ```
5766
+ *
5767
+ * When you use the ORM and defined relations, `select` can also accept callbacks with related table queries:
5768
+ *
5769
+ * ```ts
5770
+ * await db.author.select({
5771
+ * allBooks: (q) => q.books,
5772
+ * firstBook: (q) => q.books.order({ createdAt: 'ASC' }).take(),
5773
+ * booksCount: (q) => q.books.count(),
5774
+ * });
5775
+ * ```
5776
+ *
5777
+ * When you're selecting a relation that's connected via `belongsTo` or `hasOne`, it becomes available to use in `order` or in `where`:
5778
+ *
5779
+ * ```ts
5780
+ * // select books with their authors included, order by author name and filter by author column:
5781
+ * await db.books
5782
+ * .select({
5783
+ * author: (q) => q.author,
5784
+ * })
5785
+ * .order('author.name')
5786
+ * .where({ 'author.isPopular': true });
5787
+ * ```
5788
+ */
5789
+ select<T extends SelectSelf, Columns extends SelectArgs<T>>(this: T, ...args: Columns): SelectResult<T, Columns>;
5790
+ select<T extends SelectSelf, Obj extends SelectAsArg<T>>(this: T, obj: Obj): SelectResultObj<T, Obj>;
5791
+ select<T extends SelectSelf, Columns extends SelectArgs<T>, Obj extends SelectAsArg<T>>(this: T, ...args: [...columns: Columns, obj: Obj]): SelectResultColumnsAndObj<T, Columns, Obj>;
5792
+ /**
5793
+ * When querying the table or creating records, all columns are selected by default,
5794
+ * but updating and deleting queries are returning affected row counts by default.
5795
+ *
5796
+ * Use `selectAll` to select all columns. If the `.select` method was applied before it will be discarded.
5797
+ *
5798
+ * ```ts
5799
+ * const selectFull = await db.table
5800
+ * .select('id', 'name') // discarded by `selectAll`
5801
+ * .selectAll();
5802
+ *
5803
+ * const updatedFull = await db.table.selectAll().where(conditions).update(data);
5804
+ *
5805
+ * const deletedFull = await db.table.selectAll().where(conditions).delete();
5806
+ * ```
5807
+ */
5808
+ selectAll<T extends SelectSelf>(this: T): SelectResult<T, ['*']>;
5809
+ }
5810
+ interface QueryGetSelf extends PickQuerySelectable, PickQueryRelationsWithData {}
5811
+ type GetArg<T extends QueryGetSelf> = GetStringArg<T> | Expression$1 | ((q: SelectAsFnArg<T>) => Expression$1 | Query.Pick.SingleValueResult);
5812
+ type GetStringArg<T extends PickQuerySelectable> = keyof T['__selectable'] & string;
5813
+ type ResolveGetArgColumn<Arg> = Arg extends Expression$1 ? Arg['result']['value'] : Arg extends ((q: never) => infer R) ? R extends Expression$1 ? R['result']['value'] : R extends Query.Pick.SingleValueResult ? R['result']['value'] : never : never;
5814
+ type GetResult<T extends QueryGetSelf, Arg extends GetArg<T>> = Arg extends string ? SetQueryReturnsValueOrThrow<T, Arg> : SetQueryReturnsColumnOrThrow<T, ResolveGetArgColumn<Arg>>;
5815
+ type GetResultOptional<T extends QueryGetSelf, Arg extends GetArg<T>> = Arg extends string ? SetQueryReturnsValueOptional<T, Arg> : SetQueryReturnsColumnOptional<T, ResolveGetArgColumn<Arg>>;
5826
5816
  declare class QueryGet {
5827
5817
  /**
5828
5818
  * `.get` returns a single value, adds `LIMIT 1` to the query, and accepts a column name or a raw SQL expression.
@@ -7257,7 +7247,8 @@ declare namespace Column$1 {
7257
7247
  unique: Name;
7258
7248
  };
7259
7249
  };
7260
- export type Nullable<T extends Column.Pick.ForNullable, InputSchema, OutputSchema, QuerySchema> = { [K in keyof T]: K extends '__type' ? T['__type'] | null : K extends '__inputType' ? T['__inputType'] | null : K extends 'inputSchema' ? InputSchema : K extends '__outputType' ? T['__outputType'] | (unknown extends T['__nullType'] ? null : T['__nullType']) : K extends 'outputSchema' ? OutputSchema : K extends '__queryType' ? T['__queryType'] | null : K extends 'querySchema' ? QuerySchema : K extends 'data' ? T['data'] & DataNullable : K extends 'operators' ? { [K in keyof T['operators']]: K extends 'equals' | 'not' | 'isDistinctFrom' | 'isNotDistinctFrom' ? Operator<T['__queryType'] | null, T> : T['operators'][K] } : T[K] };
7250
+ export type Nullable<T extends Column.Pick.ForNullable> = { [K in keyof T]: K extends '__type' ? T['__type'] | null : K extends '__inputType' ? T['__inputType'] | null : K extends '__outputType' ? T['__outputType'] | (unknown extends T['__nullType'] ? null : T['__nullType']) : K extends '__queryType' ? T['__queryType'] | null : K extends 'data' ? T['data'] & DataNullable : K extends 'operators' ? { [K in keyof T['operators']]: K extends 'equals' | 'not' | 'isDistinctFrom' | 'isNotDistinctFrom' ? Operator<T['__queryType'] | null, T> : T['operators'][K] } : T[K] };
7251
+ export type NullableWithSchema<T extends Column.Pick.ForNullable, InputSchema, OutputSchema, QuerySchema> = { [K in keyof T]: K extends '__type' ? T['__type'] | null : K extends '__inputType' ? T['__inputType'] | null : K extends 'inputSchema' ? InputSchema : K extends '__outputType' ? T['__outputType'] | (unknown extends T['__nullType'] ? null : T['__nullType']) : K extends 'outputSchema' ? OutputSchema : K extends '__queryType' ? T['__queryType'] | null : K extends 'querySchema' ? QuerySchema : K extends 'data' ? T['data'] & DataNullable : K extends 'operators' ? { [K in keyof T['operators']]: K extends 'equals' | 'not' | 'isDistinctFrom' | 'isNotDistinctFrom' ? Operator<T['__queryType'] | null, T> : T['operators'][K] } : T[K] };
7261
7252
  export type QueryColumnToNullable<C> = { [K in keyof C]: K extends '__outputType' | '__queryType' ? C[K] | null : C[K] };
7262
7253
  export type QueryColumnToOptional<C> = { [K in keyof C]: K extends '__outputType' ? C[K] | undefined : C[K] };
7263
7254
  interface DataNullable {
@@ -7273,8 +7264,7 @@ declare namespace Column$1 {
7273
7264
  export type Encode<T, InputSchema, Input> = { [K in keyof T]: K extends '__inputType' ? Input : K extends 'inputSchema' ? InputSchema : T[K] };
7274
7265
  export type Parse<T extends Pick.ForParse, OutputSchema, Output> = { [K in keyof T]: K extends '__outputType' ? null extends T['__type'] ? (Output extends null ? never : Output) | (unknown extends T['__nullType'] ? null : T['__nullType']) : Output : K extends 'outputSchema' ? null extends T['__type'] ? OutputSchema | T['nullSchema'] : OutputSchema : T[K] };
7275
7266
  export type ParseNull<T extends Column.Pick.ForParseNull, NullSchema, NullType> = { [K in keyof T]: K extends '__outputType' ? null extends T['__type'] ? Exclude<T['__outputType'], null> | NullType : T['__outputType'] : K extends '__nullType' ? NullType : K extends 'outputSchema' ? null extends T['__type'] ? T['outputSchema'] | NullSchema : T['outputSchema'] : K extends 'nullSchema' ? NullSchema : T[K] };
7276
- type DefaultData<T extends Column.Data, Value> = { [K in keyof T]: K extends 'default' ? Value extends null ? never : Value : K extends 'optional' ? true : T[K] };
7277
- export type Default<T extends Column.Pick.Data, Value> = { [K in keyof T]: K extends 'data' ? DefaultData<T['data'], Value> : T[K] };
7267
+ export type HasDefault<T extends Column.Pick.Data> = T & Column.Data.Default;
7278
7268
  type DefaultSelectData<T extends Column.Data, Value> = { [K in keyof T]: K extends 'explicitSelect' ? Value extends true ? false : true : T[K] };
7279
7269
  export type DefaultSelect<T extends Column.Pick.Data, Value extends boolean> = { [K in keyof T]: K extends 'data' ? DefaultSelectData<T['data'], Value> : T[K] };
7280
7270
  export interface IsAppReadOnly {
@@ -7374,6 +7364,7 @@ declare namespace Column$1 {
7374
7364
  interface TableParamInstance {
7375
7365
  schema?: string;
7376
7366
  table: string;
7367
+ nameInDb?: string;
7377
7368
  columns: PickQueryShape$1;
7378
7369
  }
7379
7370
  interface TableParam {
@@ -7465,6 +7456,12 @@ declare namespace Column$1 {
7465
7456
  skipValueToArray?: boolean;
7466
7457
  }
7467
7458
  export namespace Data {
7459
+ interface Default {
7460
+ data: {
7461
+ default: true;
7462
+ optional: true;
7463
+ };
7464
+ }
7468
7465
  interface Check {
7469
7466
  sql: RawSqlBase$1;
7470
7467
  name?: string;
@@ -7535,13 +7532,13 @@ declare abstract class Column$1 {
7535
7532
  *
7536
7533
  * @param value - default value or a function returning a value
7537
7534
  */
7538
- default<T extends Column.Pick.DataAndInputType, Value extends T['__inputType'] | null | RawSqlBase$1 | (() => T['__inputType'])>(this: T, value: Value): Column.Modifiers.Default<T, Value>;
7535
+ default<T extends Column.Pick.DataAndInputType, Value extends T['__inputType'] | null | RawSqlBase$1 | (() => T['__inputType'])>(this: T, value: Value): Column.Modifiers.HasDefault<T>;
7539
7536
  /**
7540
7537
  * Use `hasDefault` to let the column be omitted when creating records.
7541
7538
  *
7542
7539
  * It's better to use {@link default} instead so the value is explicit and serves as a hint.
7543
7540
  */
7544
- hasDefault<T extends Column.Pick.Data>(this: T): Column.Modifiers.Default<T, RawSqlBase$1>;
7541
+ hasDefault<T extends Column.Pick.Data>(this: T): Column.Modifiers.HasDefault<T>;
7545
7542
  /**
7546
7543
  * Set a database-level validation check to a column. `check` accepts a raw SQL.
7547
7544
  *
@@ -8357,6 +8354,7 @@ interface QueryData$1 extends QueryDataAliases, PickQueryDataParsers, HasHookSel
8357
8354
  type: QueryType;
8358
8355
  adapter: Adapter$1;
8359
8356
  selectShape: ColumnsShape$1;
8357
+ nameInDb?: string;
8360
8358
  handleResult: HandleResult;
8361
8359
  catch?: boolean;
8362
8360
  returnType: QueryReturnType$1;
@@ -8893,6 +8891,28 @@ declare class QueryTruncate {
8893
8891
  cascade?: boolean;
8894
8892
  }): SetQueryReturnsVoid<T>;
8895
8893
  }
8894
+ declare class QueryExistsMethods {
8895
+ /**
8896
+ * Use `exists()` to check if there is at least one record-matching condition.
8897
+ *
8898
+ * It will discard previous `select` statements if any. Returns a boolean.
8899
+ *
8900
+ * ```ts
8901
+ * const exists: boolean = await db.table.where(...conditions).exists();
8902
+ * ```
8903
+ */
8904
+ exists<T extends QueryGetSelf>(this: T): SetQueryReturnsColumnOrThrow<T, BooleanQueryColumn>;
8905
+ /**
8906
+ * Use `notExists()` to check if there are no matching records.
8907
+ *
8908
+ * It will discard previous `select` statements if any. Returns a boolean.
8909
+ *
8910
+ * ```ts
8911
+ * const exists: boolean = await db.table.where(...conditions).notExists();
8912
+ * ```
8913
+ */
8914
+ notExists<T extends QueryGetSelf>(this: T): SetQueryReturnsColumnOrThrow<T, BooleanQueryColumn>;
8915
+ }
8896
8916
  type GroupArgs<T extends PickQueryResult> = ({ [K in keyof T['result']]: T['result'][K]['dataType'] extends 'array' | 'object' | 'runtimeComputed' ? never : K }[keyof T['result']] | Expression$1)[];
8897
8917
  interface QueryHelperQuery<T extends PickQuerySelectableShapeAs> extends MergeQueryArg {
8898
8918
  returnType: QueryReturnType$1;
@@ -8930,7 +8950,7 @@ interface NarrowPluckTypeResult<T extends PickQueryResultReturnType, Narrow> ext
8930
8950
  }
8931
8951
  type QueryIfResult<T extends PickQueryResultReturnType, R extends PickQueryResult> = { [K in keyof T]: K extends 'result' ? { [K in keyof T['result'] | keyof R['result']]: K extends keyof T['result'] ? K extends keyof R['result'] ? R['result'][K] | T['result'][K] : T['result'][K] : Column$1.Modifiers.QueryColumnToOptional<R['result'][K]> } : K extends 'then' ? QueryIfResultThen<T, R> : T[K] };
8932
8952
  type QueryIfResultThen<T extends PickQueryResultReturnType, R extends PickQueryResult> = T['returnType'] extends undefined | 'all' ? QueryThenShallowSimplifyArr<{ [K in keyof T['result']]: K extends keyof R['result'] ? T['result'][K]['__outputType'] | R['result'][K]['__outputType'] : T['result'][K]['__outputType'] } & { [K in keyof R['result'] as K extends keyof T['result'] ? never : K]?: R['result'][K]['__outputType'] }> : T['returnType'] extends 'one' ? QueryThenShallowSimplifyOptional<{ [K in keyof T['result']]: K extends keyof R['result'] ? T['result'][K]['__outputType'] | R['result'][K]['__outputType'] : T['result'][K]['__outputType'] } & { [K in keyof R['result'] as K extends keyof T['result'] ? never : K]?: R['result'][K]['__outputType'] }> : T['returnType'] extends 'oneOrThrow' ? QueryThenShallowSimplify<{ [K in keyof T['result']]: K extends keyof R['result'] ? T['result'][K]['__outputType'] | R['result'][K]['__outputType'] : T['result'][K]['__outputType'] } & { [K in keyof R['result'] as K extends keyof T['result'] ? never : K]?: R['result'][K]['__outputType'] }> : T['returnType'] extends 'value' ? QueryThen<T['result']['value']['__outputType'] | R['result']['value']['__outputType'] | undefined> : T['returnType'] extends 'valueOrThrow' ? QueryThen<T['result']['value']['__outputType'] | R['result']['value']['__outputType']> : T['returnType'] extends 'rows' ? QueryThen<(T['result'][keyof T['result']]['__outputType'] | R['result'][keyof R['result']]['__outputType'])[][]> : T['returnType'] extends 'pluck' ? QueryThen<(T['result']['pluck']['__outputType'] | R['result']['pluck']['__outputType'])[]> : QueryThen<void>;
8933
- interface QueryMethods<ColumnTypes> extends QueryClone, QueryAsMethods, AggregateMethods, QueryDistinct, Select, FromMethods, QueryJoin, QueryLimitOffset, CteQuery, Union, QueryJsonMethods, QueryCreate, QueryCreateFrom, QueryUpdate, QueryDelete, QueryStorage, QueryTransaction, QueryTruncate, For, Where, SearchMethods, Clear, Having, QueryCatchers, QueryLog, QueryOrder, QueryWithSchema, QueryHooks$1, QueryUpsert, QueryOrCreate, QueryGet, QueryPluck, MergeQueryMethods, QuerySql<ColumnTypes>, QueryTransform, QueryMap, QueryScope, SoftDeleteMethods, QueryExpressions, QueryWrap, QueryWindow {}
8953
+ interface QueryMethods<ColumnTypes> extends QueryClone, QueryAsMethods, AggregateMethods, QueryDistinct, Select, FromMethods, QueryJoin, QueryLimitOffset, CteQuery, Union, QueryJsonMethods, QueryCreate, QueryCreateFrom, QueryUpdate, QueryDelete, QueryStorage, QueryTransaction, QueryTruncate, For, Where, SearchMethods, Clear, Having, QueryCatchers, QueryLog, QueryOrder, QueryWithSchema, QueryHooks$1, QueryUpsert, QueryOrCreate, QueryGet, QueryPluck, MergeQueryMethods, QuerySql<ColumnTypes>, QueryTransform, QueryMap, QueryScope, SoftDeleteMethods, QueryExpressions, QueryWrap, QueryWindow, QueryExistsMethods {}
8934
8954
  declare class QueryMethods<ColumnTypes> {
8935
8955
  /**
8936
8956
  * `.all` is a default behavior, that returns an array of objects:
@@ -8993,6 +9013,15 @@ declare class QueryMethods<ColumnTypes> {
8993
9013
  * ```
8994
9014
  */
8995
9015
  exec<T>(this: T): SetQueryReturnsVoid<T>;
9016
+ /**
9017
+ * For relation selects, `require` changes LEFT JOIN LATERAL to JOIN LATERAL.
9018
+ *
9019
+ * ```ts
9020
+ * // only the records that have `related` will be loaded:
9021
+ * await db.table.select({ related: (q) => q.related.required() });
9022
+ * ```
9023
+ */
9024
+ require<T extends PickQueryResultReturnType>(this: T): QueryRequire<T>;
8996
9025
  /**
8997
9026
  * Call `toSQL` on a query to get an object with a `text` SQL string and a `values` array of binding values:
8998
9027
  *
@@ -9181,7 +9210,7 @@ declare class QueryMethods<ColumnTypes> {
9181
9210
  * // all the following queries will resolve into empty arrays
9182
9211
  *
9183
9212
  * await db.user.select({
9184
- * pets: (q) => q.pets.join().none(),
9213
+ * pets: (q) => q.pets.require().none(),
9185
9214
  * });
9186
9215
  *
9187
9216
  * await db.user.join((q) => q.pets.none());
@@ -9253,7 +9282,7 @@ declare class QueryMethods<ColumnTypes> {
9253
9282
  *
9254
9283
  * @param fn - helper function
9255
9284
  */
9256
- makeHelper<T extends PickQuerySelectableShapeAs, Args extends unknown[], Result extends MergeQueryArg>(this: T, fn: (q: T, ...args: Args) => Result): QueryHelper<T, Args, Result>;
9285
+ makeHelper<T extends PickQuerySelectableShapeAs, Args extends unknown[], Result extends MergeQueryArg | Expression$1>(this: T, fn: (q: T, ...args: Args) => Result): QueryHelper<T, Args, Result>;
9257
9286
  /**
9258
9287
  * `useHelper` allows to use {@link makeHelper} in different queries:
9259
9288
  *
@@ -9462,6 +9491,9 @@ declare namespace Query {
9462
9491
  type Args<T extends Order.ArgThis> = Order.Args<T>;
9463
9492
  }
9464
9493
  namespace Pick {
9494
+ interface ReturnType {
9495
+ returnType: QueryReturnType$1;
9496
+ }
9465
9497
  interface SingleValueResult {
9466
9498
  result: {
9467
9499
  value: Column$1.Pick.OutputType;
@@ -9482,6 +9514,7 @@ type SetQueryReturnsAll<T extends PickQueryResult> = { [K in keyof T]: K extends
9482
9514
  type SetQueryReturnsAllResult<T extends PickQueryResult, Result extends Column$1.QueryColumns> = { [K in keyof T]: K extends 'returnType' ? 'all' : K extends 'result' ? Result : K extends 'then' ? QueryThenShallowSimplifyArr<T['result']> : T[K] } & QueryHasWhere$1;
9483
9515
  type QueryTakeOptional<T extends PickQueryResultReturnType> = T['returnType'] extends 'value' | 'pluck' | 'void' ? T : T['returnType'] extends 'valueOrThrow' ? { [K in keyof T]: K extends 'returnType' ? 'value' : K extends 'then' ? QueryThen<T['result']['value']['__outputType'] | undefined> : T[K] } : { [K in keyof T]: K extends 'returnType' ? 'one' : K extends 'then' ? QueryThenShallowSimplifyOptional<ColumnsShape$1.Output<T['result']>> : T[K] };
9484
9516
  type QueryManyTakeOptional$1<T extends PickQueryResultReturnType> = { [K in keyof T]: K extends 'returnType' ? 'one' : K extends 'then' ? QueryThenShallowSimplifyOptional<ColumnsShape$1.Output<T['result']>> : T[K] };
9517
+ type QueryRequire<T extends PickQueryResultReturnType> = T['returnType'] extends QueryReturnTypeAll | 'valueOrThrow' | 'pluck' | 'void' ? T : T['returnType'] extends 'value' ? { [K in keyof T]: K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<Exclude<T['result']['value']['__outputType'], undefined>> : T[K] } : { [K in keyof T]: K extends 'returnType' ? 'oneOrThrow' : K extends 'then' ? QueryThenShallowSimplify<ColumnsShape$1.Output<T['result']>> : T[K] };
9485
9518
  type QueryTake<T extends PickQueryResultReturnType> = T['returnType'] extends 'valueOrThrow' | 'pluck' | 'void' ? T : T['returnType'] extends 'value' ? { [K in keyof T]: K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<Exclude<T['result']['value']['__outputType'], undefined>> : T[K] } : { [K in keyof T]: K extends 'returnType' ? 'oneOrThrow' : K extends 'then' ? QueryThenShallowSimplify<ColumnsShape$1.Output<T['result']>> : T[K] };
9486
9519
  type QueryManyTake$1<T extends PickQueryResultReturnType> = { [K in keyof T]: K extends 'returnType' ? 'oneOrThrow' : K extends 'then' ? QueryThenShallowSimplify<ColumnsShape$1.Output<T['result']>> : T[K] };
9487
9520
  type SetQueryReturnsOne<T extends PickQueryResult> = { [K in keyof T]: K extends 'returnType' ? 'oneOrThrow' : K extends 'then' ? QueryThenShallowSimplify<ColumnsShape$1.Output<T['result']>> : T[K] };
@@ -9988,4 +10021,4 @@ declare class QueryUpdate {
9988
10021
  */
9989
10022
  updateManyByOptional<T extends UpdateManyBySelf, Keys extends UpdateManyByKeys<T>, K = UpdateManyByKeyColumns<Keys>>(this: T, keys: Keys, data: UpdateManyByData<T, K>): UpdateManyResult<T> & QueryHasWhere$1;
9990
10023
  }
9991
- export { type Adapter, AdapterClass, type AdapterConfigBase, type AdapterParams, type AdapterSchemaConfigOptions, type AfterCommitStandaloneHook, type AfterHook, ArrayColumn, type ArrayColumnValue, type ArrayData, type AsyncState, type BaseNumberData, BigIntColumn, BigSerialColumn, BitColumn, BitVaryingColumn, BooleanColumn, BoxColumn, ByteaColumn, CannotMutateReadOnlyTableError, CidrColumn, CircleColumn, CitextColumn, type Code, type Codes, Column, type ColumnFromDbParams, type ColumnSchemaConfig, type ColumnSchemaGetterColumns, type ColumnSchemaGetterTableClass, type ColumnToCodeCtx, type ColumnTypeSchemaArg, type ColumnsByType, type ColumnsShape, type ComputedColumnsFromOptions, type ComputedOptionsConfig, type ComputedOptionsFactory, type CreateCtx, type CreateData, type CreateManyMethodsNames, type CreateMethodsNames, type CreateSelf, CustomTypeColumn, DateColumn, type DateColumnData, type DbDomainArg, type DbExtension, type DbOptions, type DbResult, type DbSharedOptions, type DbSqlMethod, type DbStructureDomainsMap, type DbTableOptionScopes, type DbTableOptions, DecimalColumn, type DecimalColumnData, type DefaultColumnTypes, type DefaultPrivileges, type DefaultSchemaConfig, type DeleteMethodsNames, DomainColumn, DoublePrecisionColumn, type DriverAdapter, DynamicRawSQL, type EmptyObject, type EmptyTuple, EnumColumn, Expression, type ExpressionData, type FromArg, type FromResult, type GeneratorIgnore, type Grant, type HookSelectValue, InetColumn, IntegerColumn, IntervalColumn, type IsQuery, type IsolationLevel, JSONColumn, JSONTextColumn, type JoinQueryMethod, type JoinedShapes, LineColumn, LsegColumn, MacAddr8Column, MacAddrColumn, type MapTableScopesOption, type MaybeArray, type MaybePromise, type MergeQuery, MoneyColumn, type NoPrimaryKeyOption, type NonUniqDataItem, type NumberColumnData, Operators, type OperatorsArray, type OperatorsJson, type OperatorsOrdinalText, type OperatorsText, OrchidOrmError, type Ord, PathColumn, type PickQueryInputType, type PickQueryInternal, type PickQueryQ, type PickQueryRelations, type PickQuerySelectableRelations, type PickQueryShape, PointColumn, PolygonColumn, PostgisGeographyPointColumn, type QueryAfterHook, type QueryBeforeActionHook, type QueryBeforeHook, type QueryData, type QueryHasWhere, QueryHookUtils, QueryHooks, type QueryInternal, type QueryLogObject, type QueryLogOptions, type QueryLogger, type QueryManyTake, type QueryManyTakeOptional, type QueryOrExpression, type QueryResult, type QueryResultRow, type QueryReturnType, type QuerySchema, type QueryScopes, RawSql, type RawSqlBase, RealColumn, type RecordKeyTrue, type RecordOptionalString, type RecordString, type RecordStringOrNumber, type RecordUnknown, type RelationConfigBase, type RelationJoinQuery, type RelationsBase, type Rls, type RlsPolicy, type SchemaConfigFnWithOptions, type SearchWeight, type SelectableFromShape, SerialColumn, type SerialColumnData, type ShallowSimplify, type ShapeColumnPrimaryKeys, type ShapeUniqueColumns, type SingleSql, type SingleSqlItem, SmallIntColumn, SmallSerialColumn, type Sql, type SqlFn, type SqlSessionState, type StorageOptions, StringColumn, type StringData, type TableData, type TableDataFn, type TableDataInput, type TableDataItem, type TableDataItemsUniqueColumnTuples, type TableDataItemsUniqueColumns, type TableDataItemsUniqueConstraints, type TableDataMethods, type TemplateLiteralArgs, TextColumn, TimeColumn, TimestampColumn, TimestampTZColumn, type Timestamps, type ToSQLCtx, type ToSqlValues, type TransactionAdapter, TransactionAdapterClass, type TransactionOptions, TsQueryColumn, TsVectorColumn, UUIDColumn, type UniqueConstraints, type UniqueTableDataItem, UnknownColumn, type UpdateData, type UpdateSelf, type UpsertData, type UpsertThis, VarCharColumn, VirtualColumn, type WhereArg, XMLColumn, _appendQuery, _appendQueryOnUpsertCreate, _clone, _createDbSqlMethod, _hookSelectColumns, _initQueryBuilder, _orCreate, _prependWith, _queryCreate, _queryCreateMany, _queryCreateManyFrom, _queryDefaults, _queryDelete, _queryFindBy, _queryFindByOptional, _queryHookAfterCreate, _queryHookAfterUpdate, _queryInsert, _queryInsertMany, _queryJoinOn, _queryRows, _querySelect, _queryTake, _queryTakeOptional, _queryUpdate, _queryUpdateOrThrow, _queryUpsert, _queryWhere, _queryWhereExists, _queryWhereIn, addCode, addTopCte, addTopCteSql, applyMixins, assignDbDataToColumn, backtickQuote, cloneQueryBaseUnscoped, codeToString, colors, columnsShapeToCode, constraintInnerToCode, consumeColumnName, deepCompare, defaultSchemaConfig, emptyArray, emptyObject, escapeForMigration, escapeString, excludeInnerToCode, exhaustive, getCallerFilePath, getClonedQueryData, getColumnBaseType, getColumnTypes, getDateAsDateFn, getDateAsNumberFn, getDriverErrorCode, getFreeAlias, getFreeSetAlias, getImportPath, getPrimaryKeys, getQueryAs, getQuerySchema, getShapeFromSelect, getSqlText, getStackTrace, getSupportedDefaultPrivileges, indexInnerToCode, internalSchemaConfig, isExpression, isQueryReturnsAll, isRawSQL, logColors, logParamToLogObject, makeColumnNullable, makeColumnTypes, makeColumnsByType, makeConnectRetryConfig, noop, objectHasValues, omit, parseTableData, parseTableDataInput, pathToLog, pick, pluralize, prepareSubQueryForSql, primaryKeyInnerToCode, pushQueryOnForOuter, pushQueryValueImmutable, pushTableDataCode, queryToSql, quoteIdentifier, quoteObjectKey, quoteTableWithSchema, raw, rawSqlToCode, rawSqlToSql, referencesArgsToCode, returnArg, setColumnData, setColumnEncode, setColumnParse, setColumnParseNull, setCurrentColumnName, setDataValue, setDefaultLanguage, setFreeAlias, setQueryObjectValueImmutable, singleQuote, sqlToRawSql, tableDataMethods, toArray, toCamelCase, toPascalCase, toSnakeCase, wrapAdapterFnWithConnectRetry };
10024
+ export { type Adapter, AdapterClass, type AdapterConfigBase, type AdapterParams, type AdapterSchemaConfigOptions, type AfterCommitStandaloneHook, type AfterHook, ArrayColumn, type ArrayColumnValue, type ArrayData, type AsyncState, type BaseNumberData, BigIntColumn, BigSerialColumn, BitColumn, BitVaryingColumn, BooleanColumn, BoxColumn, ByteaColumn, CannotMutateReadOnlyTableError, CidrColumn, CircleColumn, CitextColumn, type Code, type Codes, Column, type ColumnFromDbParams, type ColumnSchemaConfig, type ColumnSchemaGetterColumns, type ColumnSchemaGetterTableClass, type ColumnToCodeCtx, type ColumnTypeSchemaArg, type ColumnsByType, type ColumnsShape, type ComputedColumnsFromOptions, type ComputedOptionsConfig, type ComputedOptionsFactory, type CreateCtx, type CreateData, type CreateManyMethodsNames, type CreateMethodsNames, type CreateSelf, CustomTypeColumn, DateColumn, type DateColumnData, type DbDomainArg, type DbExtension, type DbOptions, type DbResult, type DbSharedOptions, type DbSqlMethod, type DbStructureDomainsMap, type DbTableOptionScopes, type DbTableOptions, DecimalColumn, type DecimalColumnData, type DefaultColumnTypes, type DefaultPrivileges, type DefaultSchemaConfig, type DeleteMethodsNames, DomainColumn, DoublePrecisionColumn, type DriverAdapter, DynamicRawSQL, type EmptyObject, type EmptyTuple, EnumColumn, Expression, type ExpressionData, type FromArg, type FromResult, type GeneratorIgnore, type Grant, type HookSelectValue, InetColumn, IntegerColumn, IntervalColumn, type IsQuery, type IsolationLevel, JSONColumn, JSONTextColumn, type JoinedShapes, LineColumn, LsegColumn, MacAddr8Column, MacAddrColumn, type MapTableScopesOption, type MaybeArray, type MaybePromise, type MergeQuery, MoneyColumn, type NoPrimaryKeyOption, type NonUniqDataItem, type NumberColumnData, Operators, type OperatorsArray, type OperatorsJson, type OperatorsOrdinalText, type OperatorsText, OrchidOrmError, type Ord, PathColumn, type PickQueryInputType, type PickQueryInternal, type PickQueryQ, type PickQueryRelations, type PickQuerySelectableRelations, type PickQueryShape, PointColumn, PolygonColumn, PostgisGeographyPointColumn, type QueryAfterHook, type QueryBeforeActionHook, type QueryBeforeHook, type QueryData, type QueryHasWhere, QueryHookUtils, QueryHooks, type QueryInternal, type QueryLogObject, type QueryLogOptions, type QueryLogger, type QueryManyTake, type QueryManyTakeOptional, type QueryOrExpression, type QueryResult, type QueryResultRow, type QueryReturnType, type QuerySchema, type QueryScopes, RawSql, type RawSqlBase, RealColumn, type RecordKeyTrue, type RecordOptionalString, type RecordString, type RecordStringOrNumber, type RecordUnknown, type RelationConfigBase, type RelationJoinQuery, type RelationsBase, type Rls, type RlsPolicy, type SchemaConfigFnWithOptions, type SearchWeight, type SelectableFromShape, SerialColumn, type SerialColumnData, type ShallowSimplify, type ShapeUniqueColumns, type SingleSql, type SingleSqlItem, SmallIntColumn, SmallSerialColumn, type Sql, type SqlFn, type SqlSessionState, type StorageOptions, StringColumn, type StringData, type TableData, type TableDataFn, type TableDataInput, type TableDataItem, type TableDataItemsUniqueColumnTuples, type TableDataItemsUniqueColumns, type TableDataItemsUniqueConstraints, type TableDataMethods, type TemplateLiteralArgs, TextColumn, TimeColumn, TimestampColumn, TimestampTZColumn, type Timestamps, type ToSQLCtx, type ToSqlValues, type TransactionAdapter, TransactionAdapterClass, type TransactionOptions, TsQueryColumn, TsVectorColumn, UUIDColumn, type UniqueConstraints, type UniqueTableDataItem, UnknownColumn, type UpdateData, type UpdateSelf, type UpsertData, type UpsertThis, VarCharColumn, VirtualColumn, type WhereArg, XMLColumn, _appendQuery, _appendQueryOnUpsertCreate, _clone, _createDbSqlMethod, _hookSelectColumns, _initQueryBuilder, _orCreate, _prependWith, _queryCreate, _queryCreateMany, _queryCreateManyFrom, _queryDefaults, _queryDelete, _queryFindBy, _queryFindByOptional, _queryHookAfterCreate, _queryHookAfterUpdate, _queryInsert, _queryInsertMany, _queryJoinOn, _queryRows, _querySelect, _queryTake, _queryTakeOptional, _queryUpdate, _queryUpdateOrThrow, _queryUpsert, _queryWhere, _queryWhereExists, _queryWhereIn, addCode, addTopCte, addTopCteSql, applyMixins, assignDbDataToColumn, backtickQuote, cloneQueryBaseUnscoped, codeToString, colors, columnsShapeToCode, constraintInnerToCode, consumeColumnName, deepCompare, defaultSchemaConfig, emptyArray, emptyObject, escapeForMigration, escapeString, excludeInnerToCode, exhaustive, getCallerFilePath, getClonedQueryData, getColumnBaseType, getColumnTypes, getDateAsDateFn, getDateAsNumberFn, getDriverErrorCode, getFreeAlias, getFreeSetAlias, getImportPath, getPrimaryKeys, getQueryAs, getQuerySchema, getShapeFromSelect, getSqlText, getStackTrace, getSupportedDefaultPrivileges, indexInnerToCode, internalSchemaConfig, isExpression, isQueryReturnsAll, isRawSQL, logColors, logParamToLogObject, makeColumnNullable, makeColumnTypes, makeColumnsByType, makeConnectRetryConfig, noop, objectHasValues, omit, parseTableData, parseTableDataInput, pathToLog, pick, pluralize, prepareSubQueryForSql, primaryKeyInnerToCode, pushQueryOnForOuter, pushQueryValueImmutable, pushTableDataCode, queryToSql, quoteIdentifier, quoteObjectKey, quoteTableWithSchema, raw, rawSqlToCode, rawSqlToSql, referencesArgsToCode, returnArg, setColumnData, setColumnEncode, setColumnParse, setColumnParseNull, setCurrentColumnName, setDataValue, setDefaultLanguage, setFreeAlias, setQueryObjectValueImmutable, singleQuote, sqlToRawSql, tableDataMethods, toArray, toCamelCase, toPascalCase, toSnakeCase, wrapAdapterFnWithConnectRetry };