pqb 0.67.5 → 0.67.7

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, 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, quoteIdentifier, quoteObjectKey, quoteTableWithSchema, raw, rawSqlToCode, referencesArgsToCode, returnArg, setColumnData, setColumnEncode, setColumnParse, setColumnParseNull, setCurrentColumnName, setDataValue, setDefaultLanguage, setFreeAlias, setQueryObjectValueImmutable, singleQuote, 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, 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";
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  interface RelationJoinQuery$1 {
4
4
  (joiningQuery: IsQuery$1, baseQuery: IsQuery$1): IsQuery$1;
@@ -651,7 +651,7 @@ interface ColumnSchemaGetterTableClass$1 {
651
651
  createSchema(): unknown;
652
652
  }
653
653
  interface ColumnTypeSchemaArg$1 {
654
- type: unknown;
654
+ __schemaType: unknown;
655
655
  nullable<T extends Column$1.Pick.ForNullable>(this: T): Column$1.Modifiers.Nullable<T, unknown, unknown, unknown>;
656
656
  encode: unknown;
657
657
  parse: unknown;
@@ -682,6 +682,7 @@ interface ColumnSchemaConfig$1<T extends Column$1.Pick.Data = Column$1.Pick.Data
682
682
  bit(max?: number): unknown;
683
683
  uuid(): unknown;
684
684
  json(): T;
685
+ jsonText(): T;
685
686
  inputSchema(this: ColumnSchemaGetterTableClass$1): unknown;
686
687
  outputSchema(this: ColumnSchemaGetterTableClass$1): unknown;
687
688
  querySchema(this: ColumnSchemaGetterTableClass$1): unknown;
@@ -928,16 +929,33 @@ interface NumberColumnData$1 extends BaseNumberData$1, Column$1.Data {
928
929
  interface SerialColumnData$1 extends NumberColumnData$1 {
929
930
  default: Expression$1;
930
931
  }
931
- declare abstract class NumberBaseColumn<Schema extends ColumnSchemaConfig$1, SchemaType extends Schema['type']> extends Column$1<Schema, number, SchemaType, OperatorsNumber> {
932
+ declare abstract class NumberBaseColumn<Schema extends ColumnSchemaConfig$1, SchemaType extends Schema['__schemaType']> extends Column$1 {
933
+ __schema: Schema;
934
+ __type: number;
935
+ __inputType: number;
936
+ inputSchema: SchemaType;
932
937
  data: NumberColumnData$1;
938
+ __outputType: number;
939
+ outputSchema: SchemaType;
940
+ __queryType: number;
941
+ querySchema: SchemaType;
933
942
  operators: OperatorsNumber;
934
943
  }
935
944
  declare abstract class IntegerBaseColumn<Schema extends ColumnSchemaConfig$1> extends NumberBaseColumn<Schema, ReturnType<Schema['int']>> {
936
945
  data: NumberColumnData$1;
946
+ querySchema: ReturnType<Schema['int']>;
937
947
  constructor(schema: Schema);
938
948
  }
939
- declare abstract class NumberAsStringBaseColumn<Schema extends ColumnSchemaConfig$1, InputType = string | number> extends Column$1<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsNumber, InputType> {
949
+ declare abstract class NumberAsStringBaseColumn<Schema extends ColumnSchemaConfig$1, InputType = string | number> extends Column$1 {
950
+ __schema: Schema;
951
+ __type: string;
952
+ __inputType: InputType;
953
+ inputSchema: ReturnType<Schema['stringSchema']>;
940
954
  operators: OperatorsNumber;
955
+ __outputType: string;
956
+ outputSchema: ReturnType<Schema['stringSchema']>;
957
+ __queryType: InputType;
958
+ querySchema: ReturnType<Schema['stringSchema']>;
941
959
  data: Column$1.Data;
942
960
  constructor(schema: Schema);
943
961
  }
@@ -947,6 +965,7 @@ interface DecimalColumnData$1 extends Column$1.Data {
947
965
  }
948
966
  declare class DecimalColumn$1<Schema extends ColumnSchemaConfig$1> extends NumberAsStringBaseColumn<Schema> {
949
967
  data: DecimalColumnData$1;
968
+ querySchema: ReturnType<Schema['stringSchema']>;
950
969
  operators: OperatorsNumber;
951
970
  dataType: "numeric";
952
971
  constructor(schema: Schema, numericPrecision?: number, numericScale?: number);
@@ -956,35 +975,41 @@ declare class DecimalColumn$1<Schema extends ColumnSchemaConfig$1> extends Numbe
956
975
  type IdentityColumn<T extends Column$1.Pick.Data> = Column$1.Modifiers.Default<T, Expression$1>;
957
976
  declare class SmallIntColumn$1<Schema extends ColumnSchemaConfig$1> extends IntegerBaseColumn<Schema> {
958
977
  dataType: "int2";
978
+ querySchema: ReturnType<Schema['int']>;
959
979
  constructor(schema: Schema);
960
980
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
961
- identity<T extends Column$1>(this: T, options?: TableData$1.Identity): IdentityColumn<T>;
981
+ identity<T extends Column$1.Pick.Data>(this: T, options?: TableData$1.Identity): IdentityColumn<T>;
962
982
  }
963
983
  declare class IntegerColumn$1<Schema extends ColumnSchemaConfig$1> extends IntegerBaseColumn<Schema> {
964
984
  dataType: "int4";
985
+ querySchema: ReturnType<Schema['int']>;
965
986
  constructor(schema: Schema);
966
987
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
967
- identity<T extends Column$1>(this: T, options?: TableData$1.Identity): IdentityColumn<T>;
988
+ identity<T extends Column$1.Pick.Data>(this: T, options?: TableData$1.Identity): IdentityColumn<T>;
968
989
  }
969
990
  declare class BigIntColumn$1<Schema extends ColumnSchemaConfig$1> extends NumberAsStringBaseColumn<Schema, string | number | bigint> {
970
991
  dataType: "int8";
992
+ querySchema: ReturnType<Schema['stringSchema']>;
971
993
  constructor(schema: Schema);
972
994
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
973
- identity<T extends Column$1>(this: T, options?: TableData$1.Identity): IdentityColumn<T>;
995
+ identity<T extends Column$1.Pick.Data>(this: T, options?: TableData$1.Identity): IdentityColumn<T>;
974
996
  }
975
997
  declare class RealColumn$1<Schema extends ColumnSchemaConfig$1> extends NumberBaseColumn<Schema, ReturnType<Schema['number']>> {
976
998
  dataType: "float4";
999
+ querySchema: ReturnType<Schema['number']>;
977
1000
  constructor(schema: Schema);
978
1001
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
979
1002
  }
980
1003
  declare class DoublePrecisionColumn$1<Schema extends ColumnSchemaConfig$1> extends NumberAsStringBaseColumn<Schema> {
981
1004
  dataType: "float8";
1005
+ querySchema: ReturnType<Schema['stringSchema']>;
982
1006
  constructor(schema: Schema);
983
1007
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
984
1008
  }
985
1009
  declare class SmallSerialColumn$1<Schema extends ColumnSchemaConfig$1> extends IntegerBaseColumn<Schema> {
986
1010
  dataType: "int2";
987
1011
  data: SerialColumnData$1;
1012
+ querySchema: ReturnType<Schema['int']>;
988
1013
  constructor(schema: Schema);
989
1014
  toSQL(): string;
990
1015
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
@@ -992,6 +1017,7 @@ declare class SmallSerialColumn$1<Schema extends ColumnSchemaConfig$1> extends I
992
1017
  declare class SerialColumn$1<Schema extends ColumnSchemaConfig$1> extends IntegerBaseColumn<Schema> {
993
1018
  dataType: "int4";
994
1019
  data: SerialColumnData$1;
1020
+ querySchema: ReturnType<Schema['int']>;
995
1021
  constructor(schema: Schema);
996
1022
  toSQL(): string;
997
1023
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
@@ -999,14 +1025,23 @@ declare class SerialColumn$1<Schema extends ColumnSchemaConfig$1> extends Intege
999
1025
  declare class BigSerialColumn$1<Schema extends ColumnSchemaConfig$1> extends NumberAsStringBaseColumn<Schema> {
1000
1026
  dataType: "int8";
1001
1027
  data: SerialColumnData$1;
1028
+ querySchema: ReturnType<Schema['stringSchema']>;
1002
1029
  constructor(schema: Schema);
1003
1030
  toSQL(): string;
1004
1031
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1005
1032
  }
1006
1033
  type DateColumnInput = string | number | Date;
1007
- declare abstract class DateBaseColumn<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, string, ReturnType<Schema['stringNumberDate']>, OperatorsDate, DateColumnInput, string, ReturnType<Schema['stringSchema']>> {
1034
+ declare abstract class DateBaseColumn<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1008
1035
  dateParsedByDriver?: boolean | undefined;
1036
+ __schema: Schema;
1037
+ __type: string;
1038
+ __inputType: DateColumnInput;
1039
+ inputSchema: ReturnType<Schema['stringNumberDate']>;
1009
1040
  data: DateColumnData$1;
1041
+ __outputType: string;
1042
+ outputSchema: ReturnType<Schema['stringSchema']>;
1043
+ __queryType: DateColumnInput;
1044
+ querySchema: ReturnType<Schema['stringNumberDate']>;
1010
1045
  operators: OperatorsDate;
1011
1046
  asNumber: Schema['dateAsNumber'];
1012
1047
  asDate: Schema['dateAsDate'];
@@ -1036,42 +1071,66 @@ declare class TimestampTZColumn$1<Schema extends ColumnSchemaConfig$1> extends D
1036
1071
  baseDataType: "timestamp";
1037
1072
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1038
1073
  }
1039
- declare class TimeColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsTime> {
1074
+ declare class TimeColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1075
+ __schema: Schema;
1076
+ __type: string;
1077
+ __inputType: ReturnType<Schema['stringSchema']>;
1078
+ inputSchema: ReturnType<Schema['stringSchema']>;
1040
1079
  data: DateColumnData$1 & {
1041
1080
  dateTimePrecision?: number;
1042
1081
  };
1082
+ __outputType: string;
1083
+ outputSchema: ReturnType<Schema['stringSchema']>;
1084
+ __queryType: string;
1085
+ querySchema: ReturnType<Schema['stringSchema']>;
1043
1086
  dataType: "time";
1044
1087
  operators: OperatorsTime;
1045
1088
  constructor(schema: Schema, dateTimePrecision?: number);
1046
1089
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1047
1090
  }
1048
- declare class IntervalColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, PostgresInterval, ReturnType<Schema['timeInterval']>, OperatorsDate, Partial<PostgresInterval>, PostgresInterval> {
1091
+ declare class IntervalColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1092
+ __schema: Schema;
1093
+ __type: PostgresInterval;
1049
1094
  data: Column$1.Data & {
1050
1095
  fields?: string;
1051
1096
  precision?: number;
1052
1097
  };
1098
+ __inputType: Partial<PostgresInterval>;
1099
+ inputSchema: ReturnType<Schema['timeInterval']>;
1100
+ __outputType: PostgresInterval;
1101
+ outputSchema: ReturnType<Schema['timeInterval']>;
1102
+ __queryType: PostgresInterval;
1103
+ querySchema: ReturnType<Schema['timeInterval']>;
1053
1104
  dataType: "interval";
1054
1105
  operators: OperatorsDate;
1055
1106
  constructor(schema: Schema, fields?: string, precision?: number, parse?: (input: string) => PostgresInterval);
1056
1107
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1057
1108
  toSQL(): string;
1058
1109
  }
1059
- declare class EnumColumn$1<Schema extends ColumnTypeSchemaArg$1, SchemaType extends Schema['type'], const T extends readonly string[]> extends Column$1<Schema, T[number], SchemaType, OperatorsOrdinalText$1> {
1110
+ declare class EnumColumn$1<Schema extends ColumnTypeSchemaArg$1, SchemaType extends Schema['__schemaType'], const T extends readonly string[]> extends Column$1 {
1060
1111
  enumName: string;
1061
1112
  options: T;
1113
+ __schema: Schema;
1062
1114
  operators: OperatorsOrdinalText$1;
1115
+ __type: T[number];
1116
+ __inputType: T[number];
1117
+ inputSchema: SchemaType;
1118
+ __outputType: T[number];
1119
+ outputSchema: SchemaType;
1120
+ __queryType: T[number];
1121
+ querySchema: SchemaType;
1063
1122
  dataType: string;
1064
1123
  constructor(schema: Schema, enumName: string, options: T, schemaType: SchemaType);
1065
1124
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1066
1125
  toSQL(): string;
1067
1126
  }
1068
1127
  interface ArrayColumnValue$1 {
1069
- type: unknown;
1128
+ __type: unknown;
1070
1129
  inputSchema: any;
1071
- inputType: unknown;
1072
- outputType: unknown;
1130
+ __inputType: unknown;
1131
+ __outputType: unknown;
1073
1132
  outputSchema: any;
1074
- queryType: any;
1133
+ __queryType: any;
1075
1134
  querySchema: any;
1076
1135
  toSQL(): string;
1077
1136
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
@@ -1081,67 +1140,90 @@ interface ArrayData$1<Item extends ArrayColumnValue$1> extends Column$1.Data, Ar
1081
1140
  item: Item;
1082
1141
  arrayDims: number;
1083
1142
  }
1084
- declare class ArrayColumn$1<Schema extends ColumnTypeSchemaArg$1, Item extends ArrayColumnValue$1, InputType, OutputType, QueryType> extends Column$1<Schema, Item['type'][], InputType, OperatorsArray$1<Item['queryType']>, Item['inputType'][], Item['outputType'][], OutputType, Item['queryType'][], QueryType> {
1143
+ declare class ArrayColumn$1<Schema extends ColumnTypeSchemaArg$1, Item extends ArrayColumnValue$1, InputType, OutputType, QueryType> extends Column$1 {
1144
+ __schema: Schema;
1085
1145
  dataType: "array";
1086
- operators: OperatorsArray$1<Item["queryType"]>;
1146
+ operators: OperatorsArray$1<Item["__queryType"]>;
1087
1147
  data: ArrayData$1<Item>;
1088
- constructor(schema: Schema, item: Item, inputType: InputType, defaultEncode?: (input: unknown) => unknown, outputType?: OutputType, queryType?: QueryType);
1148
+ __type: Item['__type'][];
1149
+ __inputType: Item['__type'][];
1150
+ inputSchema: InputType;
1151
+ __outputType: Item['__outputType'][];
1152
+ outputSchema: OutputType;
1153
+ __queryType: Item['__queryType'][];
1154
+ querySchema: QueryType;
1155
+ constructor(schema: Schema, item: Item, __inputType: InputType, defaultEncode?: (input: unknown) => unknown, __outputType?: OutputType, __queryType?: QueryType);
1089
1156
  toSQL(): string;
1090
1157
  toCode(this: ArrayColumn$1<ColumnSchemaConfig$1, ArrayColumnValue$1, unknown, unknown, unknown>, ctx: ColumnToCodeCtx$1, key: string): Code$1;
1091
1158
  }
1092
- declare class JSONColumn$1<T, Schema extends ColumnTypeSchemaArg$1, InputSchema = Schema['type']> extends Column$1<Schema, T, InputSchema, OperatorsJson$1> {
1159
+ declare class JSONColumn$1<T, Schema extends ColumnTypeSchemaArg$1, InputSchema = Schema['__schemaType']> extends Column$1 {
1160
+ __schema: Schema;
1093
1161
  dataType: "jsonb";
1162
+ __type: T;
1163
+ __inputType: T;
1164
+ inputSchema: InputSchema;
1165
+ __outputType: T;
1166
+ outputSchema: InputSchema;
1167
+ __queryType: T;
1168
+ querySchema: InputSchema;
1094
1169
  operators: OperatorsJson$1;
1095
- constructor(schema: Schema, inputType: Schema['type'], encodedByDriver?: boolean);
1170
+ constructor(schema: Schema, __inputType: InputSchema, encodedByDriver?: boolean);
1096
1171
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1097
1172
  }
1098
- declare class JSONTextColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, unknown, ReturnType<Schema['unknown']>, OperatorsText> {
1173
+ declare class JSONTextColumn$1<T, Schema extends ColumnTypeSchemaArg$1, InputSchema = Schema['__schemaType']> extends Column$1 {
1174
+ __schema: Schema;
1099
1175
  dataType: "json";
1100
- operators: OperatorsText;
1176
+ __type: T;
1177
+ __inputType: T;
1178
+ inputSchema: InputSchema;
1179
+ __outputType: T;
1180
+ outputSchema: InputSchema;
1181
+ __queryType: T;
1182
+ querySchema: InputSchema;
1183
+ operators: OperatorsText$1;
1101
1184
  private static _instance;
1102
- static get instance(): JSONTextColumn$1<DefaultSchemaConfig$1>;
1103
- constructor(schema: Schema);
1185
+ static get instance(): JSONTextColumn$1<unknown, DefaultSchemaConfig$1, unknown>;
1186
+ constructor(schema: Schema, __inputType: InputSchema);
1104
1187
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1105
1188
  }
1106
1189
  interface DefaultSchemaConfig$1 extends ColumnSchemaConfig$1<Column$1> {
1107
- parse<T extends Column$1.Pick.ForParse, Output>(this: T, fn: (input: T['type']) => Output): Column$1.Modifiers.Parse<T, unknown, Output>;
1190
+ parse<T extends Column$1.Pick.ForParse, Output>(this: T, fn: (input: T['__type']) => Output): Column$1.Modifiers.Parse<T, unknown, Output>;
1108
1191
  parseNull<T extends Column$1.Pick.ForParseNull, Output>(this: T, fn: () => Output): Column$1.Modifiers.ParseNull<T, unknown, Output>;
1109
- encode<T extends {
1110
- type: unknown;
1111
- }, Input>(this: T, fn: (input: Input) => unknown): Column$1.Modifiers.Encode<T, unknown, Input>;
1192
+ encode<T extends Column$1.Pick.Type, Input>(this: T, fn: (input: Input) => unknown): Column$1.Modifiers.Encode<T, unknown, Input>;
1112
1193
  /**
1113
1194
  * @deprecated use narrowType instead
1114
1195
  */
1115
1196
  asType<T, Types extends {
1116
1197
  type: unknown;
1117
- inputType: unknown;
1118
- outputType: unknown;
1119
- queryType: unknown;
1198
+ __inputType: unknown;
1199
+ __outputType: unknown;
1200
+ __queryType: unknown;
1120
1201
  }>(this: T, _fn: (type: <Type, Input = Type, Output = Type, Query = Type>() => {
1121
1202
  type: Type;
1122
- inputType: Input;
1123
- outputType: Output;
1124
- queryType: Query;
1125
- }) => Types): { [K in keyof T]: K extends keyof Types ? Types[K] : T[K] };
1126
- narrowType<T extends Column$1.InputOutputQueryTypes, Types extends Column$1.InputOutputQueryTypes>(this: T, _fn: (type: <Type extends (T['inputType'] extends T['outputType'] & T['queryType'] ? T['outputType'] & T['queryType'] : T['inputType'] & T['outputType'] & T['queryType'])>() => {
1127
- inputType: T['inputType'] extends never ? never : Type;
1128
- outputType: Type;
1129
- queryType: Type;
1203
+ __inputType: Input;
1204
+ __outputType: Output;
1205
+ __queryType: Query;
1206
+ }) => Types): { [K in keyof T]: K extends '__type' ? Types['type'] : K extends keyof Types ? Types[K] : T[K] };
1207
+ narrowType<T extends Column$1.InputOutputQueryTypes, Types extends Column$1.InputOutputQueryTypes>(this: T, _fn: (type: <Type extends (T['__inputType'] extends T['__outputType'] & T['__queryType'] ? T['__outputType'] & T['__queryType'] : T['__inputType'] & T['__outputType'] & T['__queryType'])>() => {
1208
+ __inputType: T['__inputType'] extends never ? never : Type;
1209
+ __outputType: Type;
1210
+ __queryType: Type;
1130
1211
  }) => Types): { [K in keyof T]: K extends keyof Types ? Types[K] : T[K] };
1131
1212
  narrowAllTypes<T extends Column$1.InputOutputQueryTypes, Types extends Column$1.InputOutputQueryTypes>(this: T, _fn: (type: <Types extends {
1132
- input?: T['inputType'];
1133
- output?: T['outputType'];
1134
- query?: T['queryType'];
1213
+ input?: T['__inputType'];
1214
+ output?: T['__outputType'];
1215
+ query?: T['__queryType'];
1135
1216
  }>() => {
1136
- inputType: undefined extends Types['input'] ? T['inputType'] : Types['input'];
1137
- outputType: undefined extends Types['output'] ? T['outputType'] : Types['output'];
1138
- queryType: undefined extends Types['query'] ? T['queryType'] : Types['query'];
1217
+ __inputType: undefined extends Types['input'] ? T['__inputType'] : Types['input'];
1218
+ __outputType: undefined extends Types['output'] ? T['__outputType'] : Types['output'];
1219
+ __queryType: undefined extends Types['query'] ? T['__queryType'] : Types['query'];
1139
1220
  }) => Types): { [K in keyof T]: K extends keyof Types ? Types[K] : T[K] };
1140
- dateAsNumber<T extends Column$1>(this: T): Column$1.Modifiers.Parse<T, unknown, number>;
1141
- dateAsDate<T extends Column$1>(this: T): Column$1.Modifiers.Parse<T, unknown, Date>;
1221
+ dateAsNumber<T extends Column$1.Pick.ForParse>(this: T): Column$1.Modifiers.Parse<T, unknown, number>;
1222
+ dateAsDate<T extends Column$1.Pick.ForParse>(this: T): Column$1.Modifiers.Parse<T, unknown, Date>;
1142
1223
  enum<const T extends readonly [string, ...string[]]>(dataType: string, type: T): EnumColumn$1<DefaultSchemaConfig$1, unknown, T>;
1143
1224
  array<Item extends ArrayColumnValue$1>(item: Item): ArrayColumn$1<DefaultSchemaConfig$1, Item, unknown, unknown, unknown>;
1144
1225
  json<T>(): JSONColumn$1<unknown extends T ? MaybeArray$1<string | number | boolean | object> : T, DefaultSchemaConfig$1>;
1226
+ jsonText<T>(): JSONTextColumn$1<unknown extends T ? MaybeArray$1<string | number | boolean | object> : T, DefaultSchemaConfig$1>;
1145
1227
  inputSchema(): undefined;
1146
1228
  outputSchema(): undefined;
1147
1229
  querySchema(): undefined;
@@ -1166,8 +1248,16 @@ interface DefaultSchemaConfig$1 extends ColumnSchemaConfig$1<Column$1> {
1166
1248
  timestamp(precision?: number): TimestampTZColumn$1<DefaultSchemaConfig$1>;
1167
1249
  }
1168
1250
  type TextColumnData = StringData$1;
1169
- declare abstract class TextBaseColumn<Schema extends ColumnSchemaConfig$1, Ops = OperatorsText> extends Column$1<Schema, string, ReturnType<Schema['stringSchema']>, Ops> {
1251
+ declare abstract class TextBaseColumn<Schema extends ColumnSchemaConfig$1, Ops = OperatorsText$1> extends Column$1 {
1252
+ __schema: Schema;
1253
+ __type: string;
1254
+ __inputType: string;
1255
+ inputSchema: ReturnType<Schema['stringSchema']>;
1170
1256
  data: TextColumnData;
1257
+ __outputType: string;
1258
+ outputSchema: ReturnType<Schema['stringSchema']>;
1259
+ __queryType: string;
1260
+ querySchema: ReturnType<Schema['stringSchema']>;
1171
1261
  operators: Ops;
1172
1262
  constructor(schema: Schema, schemaType?: ReturnType<Schema['stringSchema']>);
1173
1263
  }
@@ -1193,93 +1283,206 @@ declare class TextColumn$1<Schema extends ColumnSchemaConfig$1> extends TextBase
1193
1283
  minArg?: number;
1194
1284
  maxArg?: number;
1195
1285
  };
1286
+ querySchema: ReturnType<Schema['stringSchema']>;
1196
1287
  operators: OperatorsOrdinalText$1;
1197
1288
  private static _instance;
1198
1289
  static get instance(): TextColumn$1<DefaultSchemaConfig$1>;
1199
1290
  constructor(schema: Schema);
1200
1291
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1201
1292
  }
1202
- declare class ByteaColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, string, ReturnType<Schema['buffer']>, OperatorsOrdinalText$1, Buffer, Buffer, ReturnType<Schema['buffer']>, string, ReturnType<Schema['stringSchema']>> {
1293
+ declare class ByteaColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1294
+ __schema: Schema;
1203
1295
  dataType: "bytea";
1204
1296
  operators: OperatorsOrdinalText$1;
1297
+ __type: string;
1298
+ __inputType: Buffer;
1299
+ inputSchema: ReturnType<Schema['buffer']>;
1300
+ __outputType: Buffer;
1301
+ outputSchema: ReturnType<Schema['buffer']>;
1302
+ __queryType: string;
1303
+ querySchema: ReturnType<Schema['stringSchema']>;
1205
1304
  constructor(schema: Schema);
1206
1305
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1207
1306
  }
1208
- declare class PointColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
1307
+ declare class PointColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1308
+ __schema: Schema;
1209
1309
  dataType: "point";
1210
- operators: OperatorsText;
1310
+ __type: string;
1311
+ __inputType: string;
1312
+ inputSchema: ReturnType<Schema['stringSchema']>;
1313
+ __outputType: string;
1314
+ outputSchema: ReturnType<Schema['stringSchema']>;
1315
+ __queryType: string;
1316
+ querySchema: ReturnType<Schema['stringSchema']>;
1317
+ operators: OperatorsText$1;
1211
1318
  constructor(schema: Schema);
1212
1319
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1213
1320
  }
1214
- declare class LineColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
1321
+ declare class LineColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1322
+ __schema: Schema;
1215
1323
  dataType: "line";
1216
- operators: OperatorsText;
1324
+ __type: string;
1325
+ __inputType: string;
1326
+ inputSchema: ReturnType<Schema['stringSchema']>;
1327
+ __outputType: string;
1328
+ outputSchema: ReturnType<Schema['stringSchema']>;
1329
+ __queryType: string;
1330
+ querySchema: ReturnType<Schema['stringSchema']>;
1331
+ operators: OperatorsText$1;
1217
1332
  constructor(schema: Schema);
1218
1333
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1219
1334
  }
1220
- declare class LsegColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
1335
+ declare class LsegColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1336
+ __schema: Schema;
1221
1337
  dataType: "lseg";
1222
- operators: OperatorsText;
1338
+ __type: string;
1339
+ __inputType: string;
1340
+ inputSchema: ReturnType<Schema['stringSchema']>;
1341
+ __outputType: string;
1342
+ outputSchema: ReturnType<Schema['stringSchema']>;
1343
+ __queryType: string;
1344
+ querySchema: ReturnType<Schema['stringSchema']>;
1345
+ operators: OperatorsText$1;
1223
1346
  constructor(schema: Schema);
1224
1347
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1225
1348
  }
1226
- declare class BoxColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
1349
+ declare class BoxColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1350
+ __schema: Schema;
1227
1351
  dataType: "box";
1228
- operators: OperatorsText;
1352
+ __type: string;
1353
+ __inputType: string;
1354
+ inputSchema: ReturnType<Schema['stringSchema']>;
1355
+ __outputType: string;
1356
+ outputSchema: ReturnType<Schema['stringSchema']>;
1357
+ __queryType: string;
1358
+ querySchema: ReturnType<Schema['stringSchema']>;
1359
+ operators: OperatorsText$1;
1229
1360
  constructor(schema: Schema);
1230
1361
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1231
1362
  }
1232
- declare class PathColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
1363
+ declare class PathColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1364
+ __schema: Schema;
1233
1365
  dataType: "path";
1234
- operators: OperatorsText;
1366
+ __type: string;
1367
+ __inputType: string;
1368
+ inputSchema: ReturnType<Schema['stringSchema']>;
1369
+ __outputType: string;
1370
+ outputSchema: ReturnType<Schema['stringSchema']>;
1371
+ __queryType: string;
1372
+ querySchema: ReturnType<Schema['stringSchema']>;
1373
+ operators: OperatorsText$1;
1235
1374
  constructor(schema: Schema);
1236
1375
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1237
1376
  }
1238
- declare class PolygonColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
1377
+ declare class PolygonColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1378
+ __schema: Schema;
1239
1379
  dataType: "polygon";
1240
- operators: OperatorsText;
1380
+ __type: string;
1381
+ __inputType: string;
1382
+ inputSchema: ReturnType<Schema['stringSchema']>;
1383
+ __outputType: string;
1384
+ outputSchema: ReturnType<Schema['stringSchema']>;
1385
+ __queryType: string;
1386
+ querySchema: ReturnType<Schema['stringSchema']>;
1387
+ operators: OperatorsText$1;
1241
1388
  constructor(schema: Schema);
1242
1389
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1243
1390
  }
1244
- declare class CircleColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
1391
+ declare class CircleColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1392
+ __schema: Schema;
1245
1393
  dataType: "circle";
1246
- operators: OperatorsText;
1394
+ __type: string;
1395
+ __inputType: string;
1396
+ inputSchema: ReturnType<Schema['stringSchema']>;
1397
+ __outputType: string;
1398
+ outputSchema: ReturnType<Schema['stringSchema']>;
1399
+ __queryType: string;
1400
+ querySchema: ReturnType<Schema['stringSchema']>;
1401
+ operators: OperatorsText$1;
1247
1402
  constructor(schema: Schema);
1248
1403
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1249
1404
  }
1250
- declare class MoneyColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, string, ReturnType<Schema['number']>, OperatorsNumber, string | number, number, ReturnType<Schema['number']>, string | number> {
1405
+ declare class MoneyColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1406
+ __schema: Schema;
1251
1407
  dataType: "money";
1408
+ __type: string;
1252
1409
  data: NumberColumnData$1;
1410
+ __inputType: string | number;
1411
+ inputSchema: ReturnType<Schema['number']>;
1412
+ __outputType: number;
1413
+ outputSchema: ReturnType<Schema['number']>;
1414
+ __queryType: string | number;
1415
+ querySchema: ReturnType<Schema['number']>;
1253
1416
  operators: OperatorsNumber;
1254
1417
  constructor(schema: Schema);
1255
1418
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1256
1419
  }
1257
- declare class CidrColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
1420
+ declare class CidrColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1421
+ __schema: Schema;
1258
1422
  dataType: "cidr";
1259
- operators: OperatorsText;
1423
+ __type: string;
1424
+ __inputType: string;
1425
+ inputSchema: ReturnType<Schema['stringSchema']>;
1426
+ __outputType: string;
1427
+ outputSchema: ReturnType<Schema['stringSchema']>;
1428
+ __queryType: string;
1429
+ querySchema: ReturnType<Schema['stringSchema']>;
1430
+ operators: OperatorsText$1;
1260
1431
  constructor(schema: Schema);
1261
1432
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1262
1433
  }
1263
- declare class InetColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsOrdinalText$1> {
1434
+ declare class InetColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1435
+ __schema: Schema;
1264
1436
  dataType: "inet";
1437
+ __type: string;
1438
+ __inputType: string;
1439
+ inputSchema: ReturnType<Schema['stringSchema']>;
1440
+ __outputType: string;
1441
+ outputSchema: ReturnType<Schema['stringSchema']>;
1442
+ __queryType: string;
1443
+ querySchema: ReturnType<Schema['stringSchema']>;
1265
1444
  operators: OperatorsOrdinalText$1;
1266
1445
  constructor(schema: Schema);
1267
1446
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1268
1447
  }
1269
- declare class MacAddrColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsOrdinalText$1> {
1448
+ declare class MacAddrColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1449
+ __schema: Schema;
1270
1450
  dataType: "macaddr";
1451
+ __type: string;
1452
+ __inputType: string;
1453
+ inputSchema: ReturnType<Schema['stringSchema']>;
1454
+ __outputType: string;
1455
+ outputSchema: ReturnType<Schema['stringSchema']>;
1456
+ __queryType: string;
1457
+ querySchema: ReturnType<Schema['stringSchema']>;
1271
1458
  operators: OperatorsOrdinalText$1;
1272
1459
  constructor(schema: Schema);
1273
1460
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1274
1461
  }
1275
- declare class MacAddr8Column$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsOrdinalText$1> {
1462
+ declare class MacAddr8Column$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1463
+ __schema: Schema;
1276
1464
  dataType: "macaddr8";
1465
+ __type: string;
1466
+ __inputType: string;
1467
+ inputSchema: ReturnType<Schema['stringSchema']>;
1468
+ __outputType: string;
1469
+ outputSchema: ReturnType<Schema['stringSchema']>;
1470
+ __queryType: string;
1471
+ querySchema: ReturnType<Schema['stringSchema']>;
1277
1472
  operators: OperatorsOrdinalText$1;
1278
1473
  constructor(schema: Schema);
1279
1474
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1280
1475
  }
1281
- declare class BitColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, string, ReturnType<Schema['bit']>, OperatorsOrdinalText$1> {
1476
+ declare class BitColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1477
+ __schema: Schema;
1282
1478
  dataType: "bit";
1479
+ __type: string;
1480
+ __inputType: string;
1481
+ inputSchema: ReturnType<Schema['bit']>;
1482
+ __outputType: string;
1483
+ outputSchema: ReturnType<Schema['bit']>;
1484
+ __queryType: string;
1485
+ querySchema: ReturnType<Schema['bit']>;
1283
1486
  operators: OperatorsOrdinalText$1;
1284
1487
  data: Column$1.Data & {
1285
1488
  length: number;
@@ -1288,8 +1491,16 @@ declare class BitColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<
1288
1491
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1289
1492
  toSQL(): string;
1290
1493
  }
1291
- declare class BitVaryingColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, string, ReturnType<Schema['bit']>, OperatorsOrdinalText$1> {
1494
+ declare class BitVaryingColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1495
+ __schema: Schema;
1292
1496
  dataType: "varbit";
1497
+ __type: string;
1498
+ __inputType: string;
1499
+ inputSchema: ReturnType<Schema['bit']>;
1500
+ __outputType: string;
1501
+ outputSchema: ReturnType<Schema['bit']>;
1502
+ __queryType: string;
1503
+ querySchema: ReturnType<Schema['bit']>;
1293
1504
  operators: OperatorsOrdinalText$1;
1294
1505
  data: Column$1.Data & {
1295
1506
  length?: number;
@@ -1299,9 +1510,17 @@ declare class BitVaryingColumn$1<Schema extends ColumnSchemaConfig$1> extends Co
1299
1510
  toSQL(): string;
1300
1511
  }
1301
1512
  type TsVectorGeneratedColumns = string[] | SearchWeightRecord;
1302
- declare class TsVectorColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsOrdinalText$1> {
1513
+ declare class TsVectorColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1303
1514
  defaultLanguage: string;
1515
+ __schema: Schema;
1304
1516
  dataType: "tsvector";
1517
+ __type: string;
1518
+ __inputType: string;
1519
+ inputSchema: ReturnType<Schema['stringSchema']>;
1520
+ __outputType: string;
1521
+ outputSchema: ReturnType<Schema['stringSchema']>;
1522
+ __queryType: string;
1523
+ querySchema: ReturnType<Schema['stringSchema']>;
1305
1524
  operators: OperatorsOrdinalText$1;
1306
1525
  constructor(schema: Schema, defaultLanguage?: string);
1307
1526
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
@@ -1331,14 +1550,30 @@ declare class TsVectorColumn$1<Schema extends ColumnSchemaConfig$1> extends Colu
1331
1550
  */
1332
1551
  generated<T extends Column$1.Pick.Data>(this: T, ...args: StaticSQLArgs | [language: string, columns: TsVectorGeneratedColumns] | [columns: TsVectorGeneratedColumns]): Column$1.Modifiers.Generated<T>;
1333
1552
  }
1334
- declare class TsQueryColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsOrdinalText$1> {
1553
+ declare class TsQueryColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1554
+ __schema: Schema;
1335
1555
  dataType: "tsquery";
1556
+ __type: string;
1557
+ __inputType: string;
1558
+ inputSchema: ReturnType<Schema['stringSchema']>;
1559
+ __outputType: string;
1560
+ outputSchema: ReturnType<Schema['stringSchema']>;
1561
+ __queryType: string;
1562
+ querySchema: ReturnType<Schema['stringSchema']>;
1336
1563
  operators: OperatorsOrdinalText$1;
1337
1564
  constructor(schema: Schema);
1338
1565
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1339
1566
  }
1340
- declare class UUIDColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, string, ReturnType<Schema['uuid']>, OperatorsOrdinalText$1> {
1567
+ declare class UUIDColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1568
+ __schema: Schema;
1341
1569
  dataType: "uuid";
1570
+ __type: string;
1571
+ __inputType: string;
1572
+ inputSchema: ReturnType<Schema['uuid']>;
1573
+ __outputType: string;
1574
+ outputSchema: ReturnType<Schema['uuid']>;
1575
+ __queryType: string;
1576
+ querySchema: ReturnType<Schema['uuid']>;
1342
1577
  operators: OperatorsOrdinalText$1;
1343
1578
  constructor(schema: Schema);
1344
1579
  /**
@@ -1353,27 +1588,45 @@ declare class UUIDColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1
1353
1588
  };
1354
1589
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1355
1590
  }
1356
- declare class XMLColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
1591
+ declare class XMLColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1592
+ __schema: Schema;
1357
1593
  dataType: "xml";
1358
- operators: OperatorsText;
1594
+ __type: string;
1595
+ __inputType: string;
1596
+ inputSchema: ReturnType<Schema['stringSchema']>;
1597
+ __outputType: string;
1598
+ outputSchema: ReturnType<Schema['stringSchema']>;
1599
+ __queryType: string;
1600
+ querySchema: ReturnType<Schema['stringSchema']>;
1601
+ operators: OperatorsText$1;
1359
1602
  private static _instance;
1360
1603
  static get instance(): XMLColumn$1<DefaultSchemaConfig$1>;
1361
1604
  constructor(schema: Schema);
1362
1605
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1363
1606
  }
1364
1607
  declare class CitextColumn$1<Schema extends ColumnSchemaConfig$1> extends TextBaseColumn<Schema, OperatorsOrdinalText$1> {
1608
+ __schema: Schema;
1365
1609
  dataType: "citext";
1366
1610
  data: TextColumnData & {
1367
1611
  minArg?: number;
1368
1612
  maxArg?: number;
1369
1613
  };
1614
+ querySchema: ReturnType<Schema['stringSchema']>;
1370
1615
  operators: OperatorsOrdinalText$1;
1371
1616
  constructor(schema: Schema);
1372
1617
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1373
1618
  }
1374
- declare class BooleanColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, boolean, ReturnType<Schema['boolean']>, OperatorsBoolean> {
1619
+ declare class BooleanColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1620
+ __schema: Schema;
1375
1621
  dataType: "bool";
1376
1622
  operators: OperatorsBoolean;
1623
+ __type: boolean;
1624
+ __inputType: boolean;
1625
+ inputSchema: ReturnType<Schema['boolean']>;
1626
+ __outputType: boolean;
1627
+ outputSchema: ReturnType<Schema['boolean']>;
1628
+ __queryType: boolean;
1629
+ querySchema: ReturnType<Schema['boolean']>;
1377
1630
  private static _instance;
1378
1631
  static get instance(): BooleanColumn$1<DefaultSchemaConfig$1>;
1379
1632
  constructor(schema: Schema);
@@ -1397,20 +1650,29 @@ interface TimestampHelpers {
1397
1650
  timestampNoTZ(): T;
1398
1651
  }): Timestamps$1<T>;
1399
1652
  }
1400
- declare class CustomTypeColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, unknown, ReturnType<Schema['unknown']>, OperatorsAny> {
1653
+ declare class CustomTypeColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1401
1654
  typeName: string;
1402
1655
  typeSchema?: string | undefined;
1656
+ __schema: Schema;
1403
1657
  operators: OperatorsAny;
1658
+ __type: unknown;
1659
+ __inputType: unknown;
1660
+ inputSchema: ReturnType<Schema['unknown']>;
1661
+ __outputType: unknown;
1662
+ outputSchema: ReturnType<Schema['unknown']>;
1663
+ __queryType: unknown;
1664
+ querySchema: ReturnType<Schema['unknown']>;
1665
+ data: Column$1.Data;
1404
1666
  dataType: string;
1405
1667
  constructor(schema: Schema, typeName: string, typeSchema?: string | undefined, extension?: string);
1406
1668
  toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
1407
1669
  as<T extends {
1408
- inputType: unknown;
1409
- outputType: unknown;
1670
+ __inputType: unknown;
1671
+ __outputType: unknown;
1410
1672
  data: Column$1.Data;
1411
1673
  }, C extends {
1412
- inputType: T['inputType'];
1413
- outputType: T['outputType'];
1674
+ __inputType: T['__inputType'];
1675
+ __outputType: T['__outputType'];
1414
1676
  }>(this: T, column: C): C;
1415
1677
  }
1416
1678
  declare class DomainColumn$1<Schema extends ColumnSchemaConfig$1> extends CustomTypeColumn$1<Schema> {
@@ -1421,8 +1683,16 @@ interface PostgisPoint {
1421
1683
  lat: number;
1422
1684
  srid?: number;
1423
1685
  }
1424
- declare class PostgisGeographyPointColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1<Schema, PostgisPoint, ReturnType<Schema['geographyPointSchema']>, OperatorsAny> {
1686
+ declare class PostgisGeographyPointColumn$1<Schema extends ColumnSchemaConfig$1> extends Column$1 {
1687
+ __schema: Schema;
1425
1688
  dataType: string;
1689
+ __type: PostgisPoint;
1690
+ __inputType: PostgisPoint;
1691
+ inputSchema: ReturnType<Schema['geographyPointSchema']>;
1692
+ __outputType: PostgisPoint;
1693
+ outputSchema: ReturnType<Schema['geographyPointSchema']>;
1694
+ __queryType: PostgisPoint;
1695
+ querySchema: ReturnType<Schema['geographyPointSchema']>;
1426
1696
  operators: OperatorsAny;
1427
1697
  static encode: ({
1428
1698
  srid,
@@ -1480,7 +1750,7 @@ interface DefaultColumnTypes$1<SchemaConfig extends ColumnSchemaConfig$1> extend
1480
1750
  uuid(): UUIDColumn$1<SchemaConfig>;
1481
1751
  xml(): XMLColumn$1<SchemaConfig>;
1482
1752
  json: SchemaConfig['json'];
1483
- jsonText(): JSONTextColumn$1<SchemaConfig>;
1753
+ jsonText: SchemaConfig['jsonText'];
1484
1754
  type(dataType: string): CustomTypeColumn$1<SchemaConfig>;
1485
1755
  domain(dataType: string): DomainColumn$1<SchemaConfig>;
1486
1756
  geography: {
@@ -1734,6 +2004,7 @@ interface QueryInternal$1<SinglePrimaryKey = any, UniqueColumns = any, UniqueCol
1734
2004
  comment?: string;
1735
2005
  readOnly?: boolean;
1736
2006
  materialized?: boolean;
2007
+ generatorIgnored?: true;
1737
2008
  primaryKeys?: string[];
1738
2009
  singlePrimaryKey: SinglePrimaryKey;
1739
2010
  uniqueColumns: UniqueColumns;
@@ -1748,6 +2019,7 @@ interface QueryInternal$1<SinglePrimaryKey = any, UniqueColumns = any, UniqueCol
1748
2019
  tableRls?: Rls$1.TableConfig;
1749
2020
  tableGrants?: Grant.TableClassGrant[];
1750
2021
  viewData?: {
2022
+ query?: Query;
1751
2023
  sql?: string | RawSqlBase$1;
1752
2024
  recursive?: boolean;
1753
2025
  checkOption?: 'LOCAL' | 'CASCADED';
@@ -1853,8 +2125,8 @@ interface QueryThen<T> {
1853
2125
  type QueryThenShallowSimplify<T> = QueryThen<ShallowSimplify$1<T>>;
1854
2126
  type QueryThenShallowSimplifyArr<T> = QueryThen<ShallowSimplify$1<T>[]>;
1855
2127
  type QueryThenShallowSimplifyOptional<T> = QueryThen<ShallowSimplify$1<T> | undefined>;
1856
- type QueryThenByQuery<T extends PickQueryReturnType, Result extends Column$1.QueryColumns> = T['returnType'] extends undefined | 'all' ? QueryThenShallowSimplifyArr<ColumnsShape$1.Output<Result>> : T['returnType'] extends 'one' ? QueryThenShallowSimplifyOptional<ColumnsShape$1.Output<Result>> : T['returnType'] extends 'oneOrThrow' ? QueryThenShallowSimplify<ColumnsShape$1.Output<Result>> : T['returnType'] extends 'value' ? QueryThen<Result['value']['outputType'] | undefined> : T['returnType'] extends 'valueOrThrow' ? QueryThen<Result['value']['outputType']> : T['returnType'] extends 'rows' ? QueryThen<ColumnsShape$1.Output<Result>[keyof Result][][]> : T['returnType'] extends 'pluck' ? QueryThen<Result['pluck']['outputType'][]> : QueryThen<void>;
1857
- type QueryThenByReturnType<T extends QueryReturnType$1, Result extends Column$1.QueryColumns> = T extends undefined | 'all' ? QueryThenShallowSimplifyArr<ColumnsShape$1.Output<Result>> : T extends 'one' ? QueryThenShallowSimplifyOptional<ColumnsShape$1.Output<Result>> : T extends 'oneOrThrow' ? QueryThenShallowSimplify<ColumnsShape$1.Output<Result>> : T extends 'value' ? QueryThen<Result['value']['outputType'] | undefined> : T extends 'valueOrThrow' ? QueryThen<Result['value']['outputType']> : T extends 'rows' ? QueryThen<ColumnsShape$1.Output<Result>[keyof Result][][]> : T extends 'pluck' ? QueryThen<Result['pluck']['outputType'][]> : QueryThen<void>;
2128
+ type QueryThenByQuery<T extends PickQueryReturnType, Result extends Column$1.QueryColumns> = T['returnType'] extends undefined | 'all' ? QueryThenShallowSimplifyArr<ColumnsShape$1.Output<Result>> : T['returnType'] extends 'one' ? QueryThenShallowSimplifyOptional<ColumnsShape$1.Output<Result>> : T['returnType'] extends 'oneOrThrow' ? QueryThenShallowSimplify<ColumnsShape$1.Output<Result>> : T['returnType'] extends 'value' ? QueryThen<Result['value']['__outputType'] | undefined> : T['returnType'] extends 'valueOrThrow' ? QueryThen<Result['value']['__outputType']> : T['returnType'] extends 'rows' ? QueryThen<ColumnsShape$1.Output<Result>[keyof Result][][]> : T['returnType'] extends 'pluck' ? QueryThen<Result['pluck']['__outputType'][]> : QueryThen<void>;
2129
+ type QueryThenByReturnType<T extends QueryReturnType$1, Result extends Column$1.QueryColumns> = T extends undefined | 'all' ? QueryThenShallowSimplifyArr<ColumnsShape$1.Output<Result>> : T extends 'one' ? QueryThenShallowSimplifyOptional<ColumnsShape$1.Output<Result>> : T extends 'oneOrThrow' ? QueryThenShallowSimplify<ColumnsShape$1.Output<Result>> : T extends 'value' ? QueryThen<Result['value']['__outputType'] | undefined> : T extends 'valueOrThrow' ? QueryThen<Result['value']['__outputType']> : T extends 'rows' ? QueryThen<ColumnsShape$1.Output<Result>[keyof Result][][]> : T extends 'pluck' ? QueryThen<Result['pluck']['__outputType'][]> : QueryThen<void>;
1858
2130
  interface QueryCatch {
1859
2131
  <Q, TResult = never>(this: {
1860
2132
  then: (onfulfilled?: (value: Q) => any) => any;
@@ -2740,7 +3012,7 @@ declare namespace Order {
2740
3012
  export type Arg<T extends ArgThis> = ArgKey<T> | ArgTsQuery<T> | { [K in ArgKey<T> | ArgTsQuery<T>]?: K extends ArgTsQuery<T> ? OrderTsQueryConfig : SortDir } | Expression$1;
2741
3013
  export type Args<T extends ArgThis> = Arg<T>[];
2742
3014
  type ArgTsQuery<T extends ArgThis> = string | undefined extends T['__tsQuery'] ? never : Exclude<T['__tsQuery'], undefined>;
2743
- type ArgKey<T extends ArgThis> = { [K in keyof T['__selectable']]: T['__selectable'][K]['column']['queryType'] extends undefined ? never : K }[keyof T['__selectable']] | { [K in keyof T['result']]: T['result'][K]['dataType'] extends 'array' | 'object' | 'runtimeComputed' ? never : K }[keyof T['result']];
3015
+ type ArgKey<T extends ArgThis> = { [K in keyof T['__selectable']]: T['__selectable'][K]['column']['__queryType'] extends undefined ? never : K }[keyof T['__selectable']] | { [K in keyof T['result']]: T['result'][K]['dataType'] extends 'array' | 'object' | 'runtimeComputed' ? never : K }[keyof T['result']];
2744
3016
  export {};
2745
3017
  }
2746
3018
  declare class QueryOrder {
@@ -2846,40 +3118,40 @@ interface ColumnsShape$1 {
2846
3118
  }
2847
3119
  declare namespace ColumnsShape$1 {
2848
3120
  export type DefaultSelectKeys<S extends Column$1.QueryColumnsInit> = { [K in keyof S]: S[K]['data']['explicitSelect'] extends true | undefined ? never : K }[keyof S];
2849
- export type DefaultOutput<Set extends Column$1.QueryColumnsInit> = { [K in DefaultSelectKeys<Set>]: Set[K]['outputType'] };
2850
- 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'] };
2851
- export type InputPartial<Shape extends Column$1.QueryColumnsInit> = { [K in keyof Shape]?: Shape[K]['inputType'] };
2852
- export type Output<Shape extends Column$1.QueryColumns> = { [K in keyof Shape]: Shape[K]['outputType'] };
2853
- 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'] };
3121
+ export type DefaultOutput<Set extends Column$1.QueryColumnsInit> = { [K in DefaultSelectKeys<Set>]: Set[K]['__outputType'] };
3122
+ 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'] };
3123
+ export type InputPartial<Shape extends Column$1.QueryColumnsInit> = { [K in keyof Shape]?: Shape[K]['__inputType'] };
3124
+ export type Output<Shape extends Column$1.QueryColumns> = { [K in keyof Shape]: Shape[K]['__outputType'] };
3125
+ 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'] };
2854
3126
  export interface MapToObjectColumn<Shape extends Column$1.QueryColumns> {
2855
3127
  dataType: 'object';
2856
- type: { [K in keyof Shape]: Shape[K]['type'] };
2857
- outputType: ShallowSimplify$1<ObjectOutput<Shape>>;
2858
- queryType: { [K in keyof Shape]: Shape[K]['queryType'] };
3128
+ __type: { [K in keyof Shape]: Shape[K]['__type'] };
3129
+ __outputType: ShallowSimplify$1<ObjectOutput<Shape>>;
3130
+ __queryType: { [K in keyof Shape]: Shape[K]['__queryType'] };
2859
3131
  operators: OperatorsAny;
2860
3132
  }
2861
3133
  export interface MapToNullableObjectColumn<Shape extends Column$1.QueryColumns> {
2862
3134
  dataType: 'object';
2863
- type: { [K in keyof Shape]: Shape[K]['type'] };
2864
- outputType: ShallowSimplify$1<ObjectOutput<Shape>> | undefined;
2865
- queryType: { [K in keyof Shape]: Shape[K]['queryType'] } | null;
3135
+ __type: { [K in keyof Shape]: Shape[K]['__type'] };
3136
+ __outputType: ShallowSimplify$1<ObjectOutput<Shape>> | undefined;
3137
+ __queryType: { [K in keyof Shape]: Shape[K]['__queryType'] } | null;
2866
3138
  operators: OperatorsAny;
2867
3139
  }
2868
3140
  export interface MapToPluckColumn<Shape extends Column$1.QueryColumns> {
2869
3141
  dataType: 'array';
2870
- type: Shape['pluck']['type'][];
2871
- outputType: Shape['pluck']['outputType'][];
2872
- queryType: Shape['pluck']['queryType'][];
3142
+ __type: Shape['pluck']['__type'][];
3143
+ __outputType: Shape['pluck']['__outputType'][];
3144
+ __queryType: Shape['pluck']['__queryType'][];
2873
3145
  operators: OperatorsAny;
2874
3146
  }
2875
3147
  export interface MapToObjectArrayColumn<Shape extends Column$1.QueryColumns> {
2876
3148
  dataType: 'array';
2877
- type: { [K in keyof Shape]: Shape[K]['type'] }[];
2878
- outputType: ShallowSimplify$1<ObjectOutput<Shape>>[];
2879
- queryType: { [K in keyof Shape]: Shape[K]['queryType'] }[];
3149
+ __type: { [K in keyof Shape]: Shape[K]['__type'] }[];
3150
+ __outputType: ShallowSimplify$1<ObjectOutput<Shape>>[];
3151
+ __queryType: { [K in keyof Shape]: Shape[K]['__queryType'] }[];
2880
3152
  operators: OperatorsAny;
2881
3153
  }
2882
- type ObjectOutput<Shape extends Column$1.QueryColumns> = { [K in keyof Shape]: Shape[K]['outputType'] };
3154
+ type ObjectOutput<Shape extends Column$1.QueryColumns> = { [K in keyof Shape]: Shape[K]['__outputType'] };
2883
3155
  export {};
2884
3156
  }
2885
3157
  interface SelectSelf extends PickQuerySelectable, PickQueryHasSelect, PickQueryDefaultSelect, PickQueryShape$1, PickQueryRelations$1, PickQueryResult, PickQueryReturnType, PickQueryWithData {}
@@ -3304,16 +3576,16 @@ interface OperatorsCount extends OperatorsNumber {
3304
3576
  type CountColumn = Column$1.Pick.QueryColumnOfTypeAndOps<'int8', number, OperatorsCount>;
3305
3577
  type CountReturn<T> = SetQueryReturnsColumnOrThrow<T, CountColumn> & OperatorsCount;
3306
3578
  type SelectableDataType<T extends PickQuerySelectable, DataType extends string> = { [K in keyof T['__selectable']]: T['__selectable'][K]['column']['dataType'] extends DataType ? K : never }[keyof T['__selectable']] | Expression$1<Column$1.Pick.QueryColumnOfDataType<DataType>>;
3307
- type NumericReturn<T extends PickQuerySelectable, Arg> = Arg extends keyof T['__selectable'] ? SetQueryReturnsColumnOrThrow<T, Column$1.Pick.QueryColumnOfTypeAndOps<T['__selectable'][Arg]['column']['dataType'], T['__selectable'][Arg]['column']['type'] | null, OperatorsNumber>> & OperatorsNumber : Arg extends Expression$1 ? SetQueryReturnsColumnOrThrow<T, Column$1.Pick.QueryColumnOfTypeAndOps<Arg['result']['value']['dataType'], Arg['result']['value']['type'] | null, OperatorsNumber>> & OperatorsNumber : never;
3579
+ type NumericReturn<T extends PickQuerySelectable, Arg> = Arg extends keyof T['__selectable'] ? SetQueryReturnsColumnOrThrow<T, Column$1.Pick.QueryColumnOfTypeAndOps<T['__selectable'][Arg]['column']['dataType'], T['__selectable'][Arg]['column']['__type'] | null, OperatorsNumber>> & OperatorsNumber : Arg extends Expression$1 ? SetQueryReturnsColumnOrThrow<T, Column$1.Pick.QueryColumnOfTypeAndOps<Arg['result']['value']['dataType'], Arg['result']['value']['__type'] | null, OperatorsNumber>> & OperatorsNumber : never;
3308
3580
  type NullableNumberReturn<T, DataType> = SetQueryReturnsColumnOrThrow<T, Column$1.Pick.QueryColumnOfTypeAndOps<DataType, number | null, OperatorsNumber>> & OperatorsNumber;
3309
3581
  type BooleanQueryColumn = Column$1.Pick.QueryColumnOfTypeAndOps<'bool', boolean, OperatorsBoolean>;
3310
3582
  type BooleanNullable = Column$1.Pick.QueryColumnOfTypeAndOps<'bool', boolean | null, OperatorsBoolean>;
3311
3583
  type NullableBooleanReturn<T> = SetQueryReturnsColumnOrThrow<T, BooleanNullable> & OperatorsBoolean;
3312
3584
  type NullableJSONAggReturn<T extends PickQuerySelectable, Arg extends SelectableOrExpression<T>> = SetQueryReturnsColumnOrThrow<T, {
3313
3585
  dataType: 'json';
3314
- type: (ExpressionOutput<T, Arg>['type'] | null)[] | null;
3315
- outputType: (ExpressionOutput<T, Arg>['outputType'] | null)[] | null;
3316
- queryType: (ExpressionOutput<T, Arg>['queryType'] | null)[] | null;
3586
+ __type: (ExpressionOutput<T, Arg>['__type'] | null)[] | null;
3587
+ __outputType: (ExpressionOutput<T, Arg>['__outputType'] | null)[] | null;
3588
+ __queryType: (ExpressionOutput<T, Arg>['__queryType'] | null)[] | null;
3317
3589
  operators: OperatorsArray$1<never>;
3318
3590
  }> & OperatorsArray$1<never>;
3319
3591
  interface RecordSelectableOrExpression<T extends PickQuerySelectable> {
@@ -3321,14 +3593,14 @@ interface RecordSelectableOrExpression<T extends PickQuerySelectable> {
3321
3593
  }
3322
3594
  type NullableJSONObjectReturn<T extends PickQuerySelectable, Obj extends RecordSelectableOrExpression<T>> = SetQueryReturnsColumnOrThrow<T, {
3323
3595
  dataType: 'json';
3324
- type: { [K in keyof Obj]: ExpressionOutput<T, Obj[K]>['type'] } | null;
3325
- outputType: { [K in keyof Obj]: ExpressionOutput<T, Obj[K]>['outputType'] } | null;
3326
- queryType: { [K in keyof Obj]: ExpressionOutput<T, Obj[K]>['queryType'] } | null;
3596
+ __type: { [K in keyof Obj]: ExpressionOutput<T, Obj[K]>['__type'] } | null;
3597
+ __outputType: { [K in keyof Obj]: ExpressionOutput<T, Obj[K]>['__outputType'] } | null;
3598
+ __queryType: { [K in keyof Obj]: ExpressionOutput<T, Obj[K]>['__queryType'] } | null;
3327
3599
  operators: OperatorsAny;
3328
3600
  }> & OperatorsAny;
3329
- type StringColumn$1 = Column$1.Pick.QueryColumnOfTypeAndOps<string, string, OperatorsText>;
3330
- type StringNullable = Column$1.Pick.QueryColumnOfTypeAndOps<string, string | null, OperatorsText>;
3331
- type NullableStringReturn<T> = SetQueryReturnsColumnOrThrow<T, StringNullable> & OperatorsText;
3601
+ type StringColumn$1 = Column$1.Pick.QueryColumnOfTypeAndOps<string, string, OperatorsText$1>;
3602
+ type StringNullable = Column$1.Pick.QueryColumnOfTypeAndOps<string, string | null, OperatorsText$1>;
3603
+ type NullableStringReturn<T> = SetQueryReturnsColumnOrThrow<T, StringNullable> & OperatorsText$1;
3332
3604
  interface AggregateArgTypes {
3333
3605
  minMax: 'citext' | 'date' | 'float4' | 'float8' | 'inet' | 'int2' | 'int4' | 'int8' | 'interval' | 'money' | 'numeric' | 'text' | 'time' | 'timestamp' | 'timestamptz';
3334
3606
  sum: 'float4' | 'float8' | 'int2' | 'int4' | 'int8' | 'interval' | 'money' | 'numeric';
@@ -3760,11 +4032,11 @@ declare class OrExpression extends Expression$1<BooleanQueryColumn> {
3760
4032
  interface QueryReturnsFnAdd<T extends PickQueryColumTypes> extends PickQueryHasSelect {
3761
4033
  type<C extends Column$1.Pick.QueryColumn>(fn: (types: T['columnTypes']) => C): { [K in keyof T]: K extends 'result' ? {
3762
4034
  value: C;
3763
- } : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<C['outputType']> : T[K] } & C['operators'];
4035
+ } : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<C['__outputType']> : T[K] } & C['operators'];
3764
4036
  }
3765
4037
  type SetQueryReturnsFn<T extends PickQueryColumTypes, C extends Column$1.Pick.OutputType> = { [K in keyof T]: K extends 'result' ? {
3766
4038
  value: C;
3767
- } : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<C['outputType']> : T[K] } & QueryReturnsFnAdd<T>;
4039
+ } : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<C['__outputType']> : T[K] } & QueryReturnsFnAdd<T>;
3768
4040
  declare class QueryExpressions {
3769
4041
  /**
3770
4042
  * `column` references a table column, this can be used in raw SQL or when building a column expression.
@@ -3857,16 +4129,16 @@ declare class QueryExpressions {
3857
4129
  type WhereArg$1<T extends PickQuerySelectableRelations$1> = { [K in keyof T['__selectable'] | 'NOT' | 'OR' | 'IN']?: K extends 'NOT' ? WhereArg$1<T> | WhereArgs<T> : K extends 'OR' ? (WhereArg$1<T> | WhereArgs<T>)[] : K extends 'IN' ? MaybeArray$1<{
3858
4130
  columns: (keyof T['__selectable'])[];
3859
4131
  values: unknown[][] | IsQuery$1 | Expression$1;
3860
- }> : T['__selectable'][K]['column']['queryType'] | null | { [O in keyof T['__selectable'][K]['column']['operators']]?: T['__selectable'][K]['column']['operators'][O]['_opType'] } | {
4132
+ }> : T['__selectable'][K]['column']['__queryType'] | null | { [O in keyof T['__selectable'][K]['column']['operators']]?: T['__selectable'][K]['column']['operators'][O]['_opType'] } | {
3861
4133
  result: {
3862
4134
  value: {
3863
- queryType: T['__selectable'][K]['column']['queryType'] | null;
4135
+ __queryType: T['__selectable'][K]['column']['__queryType'] | null;
3864
4136
  };
3865
4137
  };
3866
4138
  } | ((q: T) => {
3867
4139
  result: {
3868
4140
  value: {
3869
- queryType: T['__selectable'][K]['column']['queryType'] | null;
4141
+ __queryType: T['__selectable'][K]['column']['__queryType'] | null;
3870
4142
  };
3871
4143
  };
3872
4144
  }) } | ((q: WhereQueryBuilder<T>) => QueryOrExpressionBooleanOrNullResult | WhereQueryBuilder<T>);
@@ -3882,12 +4154,12 @@ type WhereQueryBuilder<T extends PickQueryRelations$1> = EmptyObject$1 extends T
3882
4154
  type WhereArgs<T extends PickQuerySelectableRelations$1> = WhereArg$1<T>[];
3883
4155
  type WhereNotArgs<T extends PickQuerySelectableRelations$1> = [WhereArg$1<T>];
3884
4156
  type WhereInColumn<T extends PickQuerySelectableRelations$1> = keyof T['__selectable'] | [keyof T['__selectable'], ...(keyof T['__selectable'])[]];
3885
- type WhereInValues<T extends PickQuerySelectableRelations$1, Column> = Column extends keyof T['__selectable'] ? Iterable<T['__selectable'][Column]['column']['queryType']> | IsQuery$1 | Expression$1 : ({ [I in keyof Column]: Column[I] extends keyof T['__selectable'] ? T['__selectable'][Column[I]]['column']['queryType'] : never } & {
4157
+ type WhereInValues<T extends PickQuerySelectableRelations$1, Column> = Column extends keyof T['__selectable'] ? Iterable<T['__selectable'][Column]['column']['__queryType']> | IsQuery$1 | Expression$1 : ({ [I in keyof Column]: Column[I] extends keyof T['__selectable'] ? T['__selectable'][Column[I]]['column']['__queryType'] : never } & {
3886
4158
  length: Column extends {
3887
4159
  length: number;
3888
4160
  } ? Column['length'] : never;
3889
4161
  })[] | IsQuery$1 | Expression$1;
3890
- type WhereInArg<T extends PickQuerySelectableRelations$1> = { [K in keyof T['__selectable']]?: Iterable<T['__selectable'][K]['column']['queryType']> | IsQuery$1 | Expression$1 };
4162
+ type WhereInArg<T extends PickQuerySelectableRelations$1> = { [K in keyof T['__selectable']]?: Iterable<T['__selectable'][K]['column']['__queryType']> | IsQuery$1 | Expression$1 };
3891
4163
  interface QueryHasWhere$1 {
3892
4164
  __hasWhere: true;
3893
4165
  }
@@ -4713,7 +4985,7 @@ interface OperatorToSQL {
4713
4985
  interface Operator<Value, Column extends Column.Pick.OutputTypeAndOperators = Column.Pick.OutputTypeAndOperators> {
4714
4986
  <T extends PickQueryResult>(this: T, arg: Value): { [K in Exclude<keyof T, keyof T['result']['value']['operators']>]: K extends 'result' ? {
4715
4987
  value: Column;
4716
- } : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<Column['outputType']> : T[K] } & Column['operators'];
4988
+ } : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<Column['__outputType']> : T[K] } & Column['operators'];
4717
4989
  _opType: Value;
4718
4990
  }
4719
4991
  interface Base$1<Value> {
@@ -4740,7 +5012,7 @@ interface OperatorsBoolean extends Ord$1<boolean> {
4740
5012
  and: Operator<OperatorsBooleanSelf, BooleanQueryColumn>;
4741
5013
  or: Operator<OperatorsBooleanSelf, BooleanQueryColumn>;
4742
5014
  }
4743
- interface OperatorsText extends Base$1<string> {
5015
+ interface OperatorsText$1 extends Base$1<string> {
4744
5016
  contains: Operator<string | IsQuery$1 | Expression$1, BooleanQueryColumn>;
4745
5017
  containsSensitive: Operator<string | IsQuery$1 | Expression$1, BooleanQueryColumn>;
4746
5018
  startsWith: Operator<string | IsQuery$1 | Expression$1, BooleanQueryColumn>;
@@ -4748,7 +5020,7 @@ interface OperatorsText extends Base$1<string> {
4748
5020
  endsWith: Operator<string | IsQuery$1 | Expression$1, BooleanQueryColumn>;
4749
5021
  endsWithSensitive: Operator<string | IsQuery$1 | Expression$1, BooleanQueryColumn>;
4750
5022
  }
4751
- interface OperatorsOrdinalText$1 extends Ord$1<string>, OperatorsText {}
5023
+ interface OperatorsOrdinalText$1 extends Ord$1<string>, OperatorsText$1 {}
4752
5024
  interface JsonPathQueryOptions {
4753
5025
  vars?: RecordUnknown$1;
4754
5026
  silent?: boolean;
@@ -5078,7 +5350,7 @@ interface PickQueryUniqueProperties {
5078
5350
  };
5079
5351
  }
5080
5352
  interface PickQueryInputType$1 {
5081
- inputType: RecordUnknown$1;
5353
+ __inputType: RecordUnknown$1;
5082
5354
  }
5083
5355
  interface PickQueryWithData {
5084
5356
  withData: WithDataItems;
@@ -5424,7 +5696,7 @@ declare class CteQuery {
5424
5696
  }
5425
5697
  interface FromQuerySelf extends PickQuerySelectable, PickQueryShape$1, PickQueryReturnType, PickQueryWithData, PickQueryAs, PickQueryHasSelect {}
5426
5698
  type FromArg$1<T extends FromQuerySelf> = IsQuery$1 | Exclude<keyof T['withData'], symbol | number>;
5427
- type FromResult$1<T extends FromQuerySelf, Arg extends MaybeArray$1<FromArg$1<T>>> = Arg extends string ? T['withData'] extends WithDataItems ? { [K in keyof T]: K extends '__selectable' ? SelectableFromShape$1<T['withData'][Arg]['shape'], Arg> : K extends 'result' ? T['withData'][Arg]['shape'] : K extends 'then' ? QueryThenByQuery<T, T['withData'][Arg]['shape']> : T[K] } : SetQueryTableAlias<T, Arg> : Arg extends PickQuerySelectableResultInputTypeAs ? { [K in keyof T]: K extends '__defaultSelect' ? keyof Arg['result'] : K extends '__selectable' ? SelectableFromShape$1<Arg['result'], Arg['__as']> : K extends '__as' ? Arg['__as'] : K extends 'result' ? Arg['result'] : K extends 'shape' ? Arg['result'] : K extends 'inputType' ? Arg['inputType'] : K extends 'then' ? QueryThenByQuery<T, Arg['result']> : T[K] } : Arg extends (infer A)[] ? { [K in keyof T]: K extends '__selectable' ? UnionToIntersection<A extends string ? T['withData'] extends WithDataItems ? { [K in keyof T['withData'][A]['shape'] & string as `${A}.${K}`]: {
5699
+ type FromResult$1<T extends FromQuerySelf, Arg extends MaybeArray$1<FromArg$1<T>>> = Arg extends string ? T['withData'] extends WithDataItems ? { [K in keyof T]: K extends '__selectable' ? SelectableFromShape$1<T['withData'][Arg]['shape'], Arg> : K extends 'result' ? T['withData'][Arg]['shape'] : K extends 'then' ? QueryThenByQuery<T, T['withData'][Arg]['shape']> : T[K] } : SetQueryTableAlias<T, Arg> : Arg extends PickQuerySelectableResultInputTypeAs ? { [K in keyof T]: K extends '__defaultSelect' ? keyof Arg['result'] : K extends '__selectable' ? SelectableFromShape$1<Arg['result'], Arg['__as']> : K extends '__as' ? Arg['__as'] : K extends 'result' ? Arg['result'] : K extends 'shape' ? Arg['result'] : K extends '__inputType' ? Arg['__inputType'] : K extends 'then' ? QueryThenByQuery<T, Arg['result']> : T[K] } : Arg extends (infer A)[] ? { [K in keyof T]: K extends '__selectable' ? UnionToIntersection<A extends string ? T['withData'] extends WithDataItems ? { [K in keyof T['withData'][A]['shape'] & string as `${A}.${K}`]: {
5428
5700
  as: K;
5429
5701
  column: T['withData'][A]['shape'][K];
5430
5702
  } } : never : A extends PickQueryResultAs ? { [K in keyof A['result'] & string as `${A['__as']}.${K}`]: K extends string ? {
@@ -5699,11 +5971,11 @@ declare class QueryCreateFrom {
5699
5971
  }
5700
5972
  interface CreateSelf$1 extends PickQueryHasSelect, PickQueryDefaults, PickQueryResult, PickQueryRelations$1, PickQueryWithData, PickQueryReturnType, PickQueryShape$1, PickQueryUniqueProperties, PickQueryInputType$1, Query.Pick.IsNotReadOnly {}
5701
5973
  type CreateData$1<T extends CreateSelf$1> = EmptyObject$1 extends T['relations'] ? CreateDataWithDefaults<T, keyof T['__defaults']> : CreateRelationsData<T>;
5702
- type CreateDataWithDefaults<T extends CreateSelf$1, Defaults extends PropertyKey> = { [K in keyof T['inputType'] as K extends Defaults ? never : K]: K extends Defaults ? never : CreateColumn<T, K> } & { [K in Defaults]?: K extends keyof T['inputType'] ? CreateColumn<T, K> : never };
5703
- type CreateDataWithDefaultsForRelations<T extends CreateSelf$1, Defaults extends keyof T['inputType'], OmitFKeys extends PropertyKey> = { [K in keyof T['inputType'] as K extends Defaults | OmitFKeys ? never : K]: K extends Defaults | OmitFKeys ? never : CreateColumn<T, K> } & { [K in Defaults as K extends OmitFKeys ? never : K]?: CreateColumn<T, K> };
5704
- type CreateColumn<T extends CreateSelf$1, K extends keyof T['inputType']> = T['inputType'][K] | ((q: T) => QueryOrExpression$1<T['inputType'][K]>);
5974
+ type CreateDataWithDefaults<T extends CreateSelf$1, Defaults extends PropertyKey> = { [K in keyof T['__inputType'] as K extends Defaults ? never : K]: K extends Defaults ? never : CreateColumn<T, K> } & { [K in Defaults]?: K extends keyof T['__inputType'] ? CreateColumn<T, K> : never };
5975
+ type CreateDataWithDefaultsForRelations<T extends CreateSelf$1, Defaults extends keyof T['__inputType'], OmitFKeys extends PropertyKey> = { [K in keyof T['__inputType'] as K extends Defaults | OmitFKeys ? never : K]: K extends Defaults | OmitFKeys ? never : CreateColumn<T, K> } & { [K in Defaults as K extends OmitFKeys ? never : K]?: CreateColumn<T, K> };
5976
+ type CreateColumn<T extends CreateSelf$1, K extends keyof T['__inputType']> = T['__inputType'][K] | ((q: T) => QueryOrExpression$1<T['__inputType'][K]>);
5705
5977
  type CreateRelationsData<T extends CreateSelf$1> = CreateDataWithDefaultsForRelations<T, keyof T['__defaults'], T['relations'][keyof T['relations']]['omitForeignKeyInCreate']> & CreateRelationsDataOmittingFKeys<T, T['relations'][keyof T['relations']]['dataForCreate']>;
5706
- type CreateRelationsDataOmittingFKeys<T extends CreateSelf$1, Union> = (Union extends RelationConfigDataForCreate ? (u: Union['columns'] extends keyof T['__defaults'] ? Pick<CreateDataWithDefaults<T, keyof T['__defaults']>, Union['columns']> & Partial<Union['nested']> : (Pick<{ [P in keyof T['inputType']]: CreateColumn<T, P> }, Union['columns'] & keyof T['inputType']> & { [K in keyof Union['nested']]?: never }) | Union['nested']) => void : (u: Union) => void) extends ((u: infer Obj) => void) ? Obj : never;
5978
+ type CreateRelationsDataOmittingFKeys<T extends CreateSelf$1, Union> = (Union extends RelationConfigDataForCreate ? (u: Union['columns'] extends keyof T['__defaults'] ? Pick<CreateDataWithDefaults<T, keyof T['__defaults']>, Union['columns']> & Partial<Union['nested']> : (Pick<{ [P in keyof T['__inputType']]: CreateColumn<T, P> }, Union['columns'] & keyof T['__inputType']> & { [K in keyof Union['nested']]?: never }) | Union['nested']) => void : (u: Union) => void) extends ((u: infer Obj) => void) ? Obj : never;
5707
5979
  type CreateResult<T extends CreateSelf$1, Data> = T extends {
5708
5980
  isCount: true;
5709
5981
  } ? T : T['returnType'] extends undefined | 'all' ? SetQueryReturnsOneResult<T, NarrowCreateResult<T, Data>> : T['returnType'] extends 'pluck' ? SetQueryReturnsColumnResult<T, NarrowCreateResult<T, Data>> : SetQueryResult<T, NarrowCreateResult<T, Data>>;
@@ -5718,13 +5990,13 @@ type InsertManyResult<T extends CreateSelf$1> = T['__hasSelect'] extends true ?
5718
5990
  *
5719
5991
  * The same should work as well with any non-null columns passed to `create`, but it's to be implemented later.
5720
5992
  */
5721
- type NarrowCreateResult<T extends CreateSelf$1, Data> = EmptyObject$1 extends T['relations'] ? T['result'] : { [K in keyof T['result']]: true extends { [R in keyof T['relations']]: K extends T['relations'][R]['omitForeignKeyInCreate'] ? R extends keyof Data ? true : T['relations'][R]['omitForeignKeyInCreate'] extends keyof Data ? null | undefined extends Data[T['relations'][R]['omitForeignKeyInCreate']] ? never : true : never : never }[keyof T['relations']] ? Column$1.Pick.QueryColumnOfTypeAndOps<string, Exclude<T['result'][K]['outputType'], null>, T['result'][K]['operators']> : T['result'][K] };
5993
+ type NarrowCreateResult<T extends CreateSelf$1, Data> = EmptyObject$1 extends T['relations'] ? T['result'] : { [K in keyof T['result']]: true extends { [R in keyof T['relations']]: K extends T['relations'][R]['omitForeignKeyInCreate'] ? R extends keyof Data ? true : T['relations'][R]['omitForeignKeyInCreate'] extends keyof Data ? null | undefined extends Data[T['relations'][R]['omitForeignKeyInCreate']] ? never : true : never : never }[keyof T['relations']] ? Column$1.Pick.QueryColumnOfTypeAndOps<string, Exclude<T['result'][K]['__outputType'], null>, T['result'][K]['operators']> : T['result'][K] };
5722
5994
  type IgnoreResult<T extends CreateSelf$1> = T['returnType'] extends 'oneOrThrow' ? QueryTakeOptional<T> : T['returnType'] extends 'valueOrThrow' ? SetQueryReturnsColumnOptional<T, T['result']['value']> : T;
5723
5995
  type OnConflictArg<T extends PickQueryUniqueProperties> = T['internal']['uniqueColumnNames'] | T['internal']['uniqueColumnTuples'] | Expression$1 | {
5724
5996
  constraint: T['internal']['uniqueConstraints'];
5725
5997
  };
5726
5998
  type AddQueryDefaults<T extends CreateSelf$1, DefaultKeys extends PropertyKey> = { [K in keyof T]: K extends '__defaults' ? { [K in keyof T['__defaults'] | DefaultKeys]: true } : T[K] };
5727
- type ExtraPropertiesAreNotAllowed<T extends CreateSelf$1, Data> = keyof Data extends keyof T['inputType'] | keyof T['relations'] ? Data : `Extra properties are not allowed: ${Exclude<keyof Data, keyof T['inputType'] | keyof T['relations']> & string}`;
5999
+ type ExtraPropertiesAreNotAllowed<T extends CreateSelf$1, Data> = keyof Data extends keyof T['__inputType'] | keyof T['relations'] ? Data : `Extra properties are not allowed: ${Exclude<keyof Data, keyof T['__inputType'] | keyof T['relations']> & string}`;
5728
6000
  declare class QueryCreate {
5729
6001
  /**
5730
6002
  * `create` and `insert` create a single record.
@@ -5998,7 +6270,7 @@ declare class QueryCreate {
5998
6270
  */
5999
6271
  onConflictDoNothing<T extends CreateSelf$1, Arg extends OnConflictArg<T>>(this: T, arg?: Arg): IgnoreResult<T>;
6000
6272
  }
6001
- type OnConflictSet$1<T extends CreateSelf$1> = { [K in keyof T['inputType']]?: T['inputType'][K] | (() => QueryOrExpression$1<T['inputType'][K]>) };
6273
+ type OnConflictSet$1<T extends CreateSelf$1> = { [K in keyof T['__inputType']]?: T['__inputType'][K] | (() => QueryOrExpression$1<T['__inputType'][K]>) };
6002
6274
  declare class OnConflictQueryBuilder<T extends CreateSelf$1, Arg extends OnConflictArg<T> | undefined> {
6003
6275
  private query;
6004
6276
  private onConflict;
@@ -6729,14 +7001,14 @@ declare class QueryTransform {
6729
7001
  value: Column$1.Pick.QueryColumnOfType<Result>;
6730
7002
  } : K extends 'then' ? QueryThen<Result> : T[K] };
6731
7003
  }
6732
- type AfterHook$1<Select extends PropertyKey[], Shape extends Column$1.QueryColumns> = QueryAfterHook$1<{ [K in Select[number]]: K extends keyof Shape ? Shape[K]['outputType'] : never }[]>;
7004
+ type AfterHook$1<Select extends PropertyKey[], Shape extends Column$1.QueryColumns> = QueryAfterHook$1<{ [K in Select[number]]: K extends keyof Shape ? Shape[K]['__outputType'] : never }[]>;
6733
7005
  type HookSelectArg<T extends PickQueryShape$1> = (keyof T['shape'] & string)[];
6734
7006
  declare class QueryHookUtils$1<T extends PickQueryInputType$1> {
6735
7007
  query: IsQuery$1;
6736
7008
  columns: string[];
6737
7009
  private key;
6738
7010
  constructor(query: IsQuery$1, columns: string[], key: 'hookCreateSet' | 'hookUpdateSet');
6739
- set: (data: { [K in keyof T["inputType"]]?: T["inputType"][K] | (() => QueryOrExpression$1<T["inputType"][K]>) }) => void;
7011
+ set: (data: { [K in keyof T["__inputType"]]?: T["__inputType"][K] | (() => QueryOrExpression$1<T["__inputType"][K]>) }) => void;
6740
7012
  }
6741
7013
  declare abstract class QueryHooks$1 {
6742
7014
  /**
@@ -6893,7 +7165,7 @@ interface ColumnDataSelectSqlProp {
6893
7165
  interface SelectSqlCallback {
6894
7166
  (column: ColumnRefExpression<Column$1.Pick.QueryColumn>): Expression$1;
6895
7167
  }
6896
- type SelectSqlColumn<T extends Column$1.Pick.DataAndDataType, Expr extends Expression$1> = unknown extends Expr['result']['value']['outputType'] ? T : { [K in keyof T]: K extends 'outputType' ? Expr['result']['value']['outputType'] : T[K] };
7168
+ type SelectSqlColumn<T extends Column$1.Pick.DataAndDataType, Expr extends Expression$1> = unknown extends Expr['result']['value']['__outputType'] ? T : { [K in keyof T]: K extends '__outputType' ? Expr['result']['value']['__outputType'] : T[K] };
6897
7169
  type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends ((x: infer I) => void) ? I : never;
6898
7170
  type MaybeArray$1<T> = T | T[];
6899
7171
  type MaybePromise$1<T> = T | Promise<T>;
@@ -6924,9 +7196,9 @@ declare namespace Column$1 {
6924
7196
  unique: Name;
6925
7197
  };
6926
7198
  };
6927
- export type Nullable<T extends Column$1.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' ? Operator<T | null> : T['operators'][K] } : T[K] };
6928
- export type QueryColumnToNullable<C> = { [K in keyof C]: K extends 'outputType' | 'queryType' ? C[K] | null : C[K] };
6929
- export type QueryColumnToOptional<C> = { [K in keyof C]: K extends 'outputType' ? C[K] | undefined : C[K] };
7199
+ export type Nullable<T extends Column$1.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' ? Operator<T | null> : T['operators'][K] } : T[K] };
7200
+ export type QueryColumnToNullable<C> = { [K in keyof C]: K extends '__outputType' | '__queryType' ? C[K] | null : C[K] };
7201
+ export type QueryColumnToOptional<C> = { [K in keyof C]: K extends '__outputType' ? C[K] | undefined : C[K] };
6930
7202
  interface DataNullable {
6931
7203
  isNullable: true;
6932
7204
  optional: true;
@@ -6935,9 +7207,9 @@ declare namespace Column$1 {
6935
7207
  equals: Operator<T | null>;
6936
7208
  not: Operator<T | null>;
6937
7209
  }
6938
- export type Encode<T, InputSchema, Input> = { [K in keyof T]: K extends 'inputType' ? Input : K extends 'inputSchema' ? InputSchema : T[K] };
6939
- 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] };
6940
- export type ParseNull<T extends Column$1.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] };
7210
+ export type Encode<T, InputSchema, Input> = { [K in keyof T]: K extends '__inputType' ? Input : K extends 'inputSchema' ? InputSchema : T[K] };
7211
+ 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] };
7212
+ export type ParseNull<T extends Column$1.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] };
6941
7213
  type DefaultData<T extends Column$1.Data, Value> = { [K in keyof T]: K extends 'default' ? Value extends null ? never : Value : K extends 'optional' ? true : T[K] };
6942
7214
  export type Default<T extends Column$1.Pick.Data, Value> = { [K in keyof T]: K extends 'data' ? DefaultData<T['data'], Value> : T[K] };
6943
7215
  type DefaultSelectData<T extends Column$1.Data, Value> = { [K in keyof T]: K extends 'explicitSelect' ? Value extends true ? false : true : T[K] };
@@ -6947,7 +7219,7 @@ declare namespace Column$1 {
6947
7219
  appReadOnly: true;
6948
7220
  };
6949
7221
  }
6950
- export type Generated<T extends Column$1.Pick.Data> = { [K in keyof T]: K extends 'data' ? { [K in keyof T['data']]: K extends 'default' ? true : T['data'][K] } : K extends 'inputType' ? never : T[K] };
7222
+ export type Generated<T extends Column$1.Pick.Data> = { [K in keyof T]: K extends 'data' ? { [K in keyof T['data']]: K extends 'default' ? true : T['data'][K] } : K extends '__inputType' ? never : T[K] };
6951
7223
  export {};
6952
7224
  }
6953
7225
  export namespace Pick {
@@ -6955,17 +7227,17 @@ declare namespace Column$1 {
6955
7227
  data: Column$1.Data;
6956
7228
  }
6957
7229
  interface Type {
6958
- type: unknown;
7230
+ __type: unknown;
6959
7231
  }
6960
7232
  interface OutputType {
6961
- outputType: unknown;
7233
+ __outputType: unknown;
6962
7234
  }
6963
7235
  interface InputType {
6964
- inputType: unknown;
7236
+ __inputType: unknown;
6965
7237
  }
6966
7238
  interface DataAndInputType extends Data, InputType {}
6967
7239
  interface NullType {
6968
- nullType: unknown;
7240
+ __nullType: unknown;
6969
7241
  }
6970
7242
  interface OutputTypeAndOperators extends OutputType {
6971
7243
  operators: unknown;
@@ -6975,22 +7247,22 @@ declare namespace Column$1 {
6975
7247
  }
6976
7248
  interface QueryColumn extends OutputType {
6977
7249
  dataType: string;
6978
- type: unknown;
6979
- queryType: unknown;
7250
+ __type: unknown;
7251
+ __queryType: unknown;
6980
7252
  operators: any;
6981
7253
  }
6982
7254
  interface QueryColumnOfType<T> {
6983
7255
  dataType: string;
6984
- type: T;
6985
- outputType: T;
6986
- queryType: T;
7256
+ __type: T;
7257
+ __outputType: T;
7258
+ __queryType: T;
6987
7259
  operators: any;
6988
7260
  }
6989
7261
  interface QueryColumnOfTypeAndOps<DataType, T, Ops> {
6990
7262
  dataType: DataType;
6991
- type: T;
6992
- outputType: T;
6993
- queryType: T;
7263
+ __type: T;
7264
+ __outputType: T;
7265
+ __queryType: T;
6994
7266
  operators: Ops;
6995
7267
  }
6996
7268
  interface QueryColumnOfDataType<T extends string> extends QueryColumn {
@@ -7010,8 +7282,8 @@ declare namespace Column$1 {
7010
7282
  querySchema: any;
7011
7283
  }
7012
7284
  interface ForNullable extends Data, Type, InputType, OutputType, TypeSchemas {
7013
- nullType: unknown;
7014
- queryType: unknown;
7285
+ __nullType: unknown;
7286
+ __queryType: unknown;
7015
7287
  operators: unknown;
7016
7288
  }
7017
7289
  interface ForParse extends Type, NullType, NullSchema {}
@@ -7061,9 +7333,9 @@ declare namespace Column$1 {
7061
7333
  type StringOrMessage = string | Message;
7062
7334
  }
7063
7335
  export interface InputOutputQueryTypes {
7064
- inputType: unknown;
7065
- outputType: unknown;
7066
- queryType: unknown;
7336
+ __inputType: unknown;
7337
+ __outputType: unknown;
7338
+ __queryType: unknown;
7067
7339
  }
7068
7340
  export interface InputOutputQueryTypesWithSchemas extends InputOutputQueryTypes {
7069
7341
  inputSchema: unknown;
@@ -7154,24 +7426,24 @@ declare namespace Column$1 {
7154
7426
  export type AsTypeArg<Schema> = AsTypeArgWithType<Schema> | AsTypeArgWithoutType<Schema>;
7155
7427
  export {};
7156
7428
  }
7157
- declare abstract class Column$1<Schema extends ColumnTypeSchemaArg$1 = ColumnTypeSchemaArg$1, Type = unknown, InputSchema = any, Ops = any, InputType = Type, OutputType = Type, OutputSchema = InputSchema, QueryType = InputType, QuerySchema = InputSchema> {
7158
- inputSchema: InputSchema;
7159
- outputSchema: OutputSchema;
7160
- querySchema: QuerySchema;
7429
+ declare abstract class Column$1 {
7430
+ abstract __schema: ColumnTypeSchemaArg$1;
7161
7431
  abstract dataType: string;
7162
- abstract operators: Ops;
7432
+ abstract operators: any;
7163
7433
  abstract toCode(ctx: ColumnToCodeCtx$1, key: string): Code$1;
7164
- type: Type;
7165
- inputType: InputType;
7166
- outputType: OutputType;
7167
- queryType: QueryType;
7168
- nullType: unknown;
7434
+ abstract __type: unknown;
7435
+ abstract __inputType: unknown;
7436
+ abstract __outputType: unknown;
7437
+ abstract __queryType: unknown;
7438
+ __nullType: unknown;
7169
7439
  nullSchema: unknown;
7170
- isNullable: boolean;
7440
+ abstract inputSchema: unknown;
7441
+ abstract outputSchema: unknown;
7442
+ abstract querySchema: unknown;
7171
7443
  data: Column.Data;
7172
- error: Schema['error'];
7444
+ error: this['__schema']['error'];
7173
7445
  _parse?: (input: unknown) => unknown;
7174
- constructor(schema: ColumnTypeSchemaArg$1, inputSchema: InputSchema, outputSchema?: OutputSchema, querySchema?: QuerySchema);
7446
+ constructor(schema: ColumnTypeSchemaArg$1, inputSchema: unknown, outputSchema?: unknown, querySchema?: unknown);
7175
7447
  /**
7176
7448
  * Set a default value to a column. Columns that have defaults become optional when creating a record.
7177
7449
  *
@@ -7198,7 +7470,7 @@ declare abstract class Column$1<Schema extends ColumnTypeSchemaArg$1 = ColumnTyp
7198
7470
  *
7199
7471
  * @param value - default value or a function returning a value
7200
7472
  */
7201
- default<T extends Column.Pick.DataAndInputType, Value extends T['inputType'] | null | RawSqlBase$1 | (() => T['inputType'])>(this: T, value: Value): Column.Modifiers.Default<T, Value>;
7473
+ default<T extends Column.Pick.DataAndInputType, Value extends T['__inputType'] | null | RawSqlBase$1 | (() => T['__inputType'])>(this: T, value: Value): Column.Modifiers.Default<T, Value>;
7202
7474
  /**
7203
7475
  * Use `hasDefault` to let the column be omitted when creating records.
7204
7476
  *
@@ -7244,7 +7516,7 @@ declare abstract class Column$1<Schema extends ColumnTypeSchemaArg$1 = ColumnTyp
7244
7516
  * }
7245
7517
  * ```
7246
7518
  */
7247
- nullable: Schema['nullable'];
7519
+ nullable: this['__schema']['nullable'];
7248
7520
  /**
7249
7521
  * Set a custom function to process value for the column when creating or updating a record.
7250
7522
  *
@@ -7280,7 +7552,7 @@ declare abstract class Column$1<Schema extends ColumnTypeSchemaArg$1 = ColumnTyp
7280
7552
  *
7281
7553
  * @param fn - function to encode value for a database, argument type is specified by you, return type must be compatible with a database
7282
7554
  */
7283
- encode: Schema['encode'];
7555
+ encode: this['__schema']['encode'];
7284
7556
  /**
7285
7557
  * Set a custom function to process value after loading it from a database.
7286
7558
  *
@@ -7318,7 +7590,7 @@ declare abstract class Column$1<Schema extends ColumnTypeSchemaArg$1 = ColumnTyp
7318
7590
  *
7319
7591
  * @param fn - function to parse a value from the database, argument is the type of this column, return type is up to you
7320
7592
  */
7321
- parse: Schema['parse'];
7593
+ parse: this['__schema']['parse'];
7322
7594
  /**
7323
7595
  * Use `parseNull` to specify runtime defaults at selection time.
7324
7596
  *
@@ -7363,7 +7635,7 @@ declare abstract class Column$1<Schema extends ColumnTypeSchemaArg$1 = ColumnTyp
7363
7635
  * })
7364
7636
  * ```
7365
7637
  */
7366
- parseNull: Schema['parseNull'];
7638
+ parseNull: this['__schema']['parseNull'];
7367
7639
  /**
7368
7640
  * This method changes a column type without modifying its behavior.
7369
7641
  * This is needed when converting columns to a validation schema, the converter will pick a different type specified by `.as`.
@@ -7383,17 +7655,17 @@ declare abstract class Column$1<Schema extends ColumnTypeSchemaArg$1 = ColumnTyp
7383
7655
  * @param column - other column type to inherit from
7384
7656
  */
7385
7657
  as<T extends {
7386
- inputType: unknown;
7387
- outputType: unknown;
7658
+ __inputType: unknown;
7659
+ __outputType: unknown;
7388
7660
  data: Column.Data;
7389
7661
  }, C extends {
7390
- inputType: T['inputType'];
7391
- outputType: T['outputType'];
7662
+ __inputType: T['__inputType'];
7663
+ __outputType: T['__outputType'];
7392
7664
  }>(this: T, column: C): C;
7393
7665
  /**
7394
7666
  * @deprecated use narrowType instead
7395
7667
  */
7396
- asType: Schema['asType'];
7668
+ asType: this['__schema']['asType'];
7397
7669
  /**
7398
7670
  * `narrowType` narrows TypeScript types of a column. It sets input, output, query type altogether.
7399
7671
  *
@@ -7436,8 +7708,10 @@ declare abstract class Column$1<Schema extends ColumnTypeSchemaArg$1 = ColumnTyp
7436
7708
  * // size will be typed as 'small' | 'medium' | 'large'
7437
7709
  * const size = await db.table.get('size');
7438
7710
  * ```
7711
+ *
7712
+ * @deprecated use `type` instead
7439
7713
  */
7440
- narrowType: Schema['narrowType'];
7714
+ narrowType: this['__schema']['narrowType'];
7441
7715
  /**
7442
7716
  * Allows to narrow different TypeScript types of a column granularly.
7443
7717
  *
@@ -7493,17 +7767,19 @@ declare abstract class Column$1<Schema extends ColumnTypeSchemaArg$1 = ColumnTyp
7493
7767
  * // size will be typed as 'small' | 'medium' | 'large'
7494
7768
  * const size = await db.table.get('size');
7495
7769
  * ```
7770
+ *
7771
+ * @deprecated use `type`, `inputType`, `outputType`, `queryType` instead
7496
7772
  */
7497
- narrowAllTypes: Schema['narrowAllTypes'];
7773
+ narrowAllTypes: this['__schema']['narrowAllTypes'];
7498
7774
  input<T extends {
7499
7775
  inputSchema: unknown;
7500
- }, InputSchema extends Schema['type']>(this: T, fn: (schema: T['inputSchema']) => InputSchema): { [K in keyof T]: K extends 'inputSchema' ? InputSchema : T[K] };
7776
+ }, InputSchema extends this['__schema']['__schemaType']>(this: T, fn: (schema: T['inputSchema']) => InputSchema): { [K in keyof T]: K extends 'inputSchema' ? InputSchema : T[K] };
7501
7777
  output<T extends {
7502
7778
  outputSchema: unknown;
7503
- }, OutputSchema extends Schema['type']>(this: T, fn: (schema: T['outputSchema']) => OutputSchema): { [K in keyof T]: K extends 'outputSchema' ? OutputSchema : T[K] };
7779
+ }, OutputSchema extends this['__schema']['__schemaType']>(this: T, fn: (schema: T['outputSchema']) => OutputSchema): { [K in keyof T]: K extends 'outputSchema' ? OutputSchema : T[K] };
7504
7780
  query<T extends {
7505
7781
  querySchema: unknown;
7506
- }, QuerySchema extends Schema['type']>(this: T, fn: (schema: T['querySchema']) => QuerySchema): { [K in keyof T]: K extends 'querySchema' ? QuerySchema : T[K] };
7782
+ }, QuerySchema extends this['__schema']['__schemaType']>(this: T, fn: (schema: T['querySchema']) => QuerySchema): { [K in keyof T]: K extends 'querySchema' ? QuerySchema : T[K] };
7507
7783
  /**
7508
7784
  * Set a database column name.
7509
7785
  *
@@ -7597,7 +7873,7 @@ declare abstract class Column$1<Schema extends ColumnTypeSchemaArg$1 = ColumnTyp
7597
7873
  * }
7598
7874
  * ```
7599
7875
  */
7600
- setOnCreate<T extends Column.Pick.QueryInit>(this: T, fn: (arg: QueryHookUtils$1<PickQueryInputType$1>) => T['inputType'] | void): T;
7876
+ setOnCreate<T extends Column.Pick.QueryInit>(this: T, fn: (arg: QueryHookUtils$1<PickQueryInputType$1>) => T['__inputType'] | void): T;
7601
7877
  /**
7602
7878
  * Set a column value when updating a record.
7603
7879
  * This works for [readOnly](#readonly) columns as well.
@@ -7614,7 +7890,7 @@ declare abstract class Column$1<Schema extends ColumnTypeSchemaArg$1 = ColumnTyp
7614
7890
  * }
7615
7891
  * ```
7616
7892
  */
7617
- setOnUpdate<T extends Column.Pick.QueryInit>(this: T, fn: (arg: QueryHookUtils$1<PickQueryInputType$1>) => T['inputType'] | void): T;
7893
+ setOnUpdate<T extends Column.Pick.QueryInit>(this: T, fn: (arg: QueryHookUtils$1<PickQueryInputType$1>) => T['__inputType'] | void): T;
7618
7894
  /**
7619
7895
  * Set a column value when creating or updating a record.
7620
7896
  * This works for [readOnly](#readonly) columns as well.
@@ -7631,7 +7907,7 @@ declare abstract class Column$1<Schema extends ColumnTypeSchemaArg$1 = ColumnTyp
7631
7907
  * }
7632
7908
  * ```
7633
7909
  */
7634
- setOnSave<T extends Column.Pick.QueryInit>(this: T, fn: (arg: QueryHookUtils$1<PickQueryInputType$1>) => T['inputType'] | void): T;
7910
+ setOnSave<T extends Column.Pick.QueryInit>(this: T, fn: (arg: QueryHookUtils$1<PickQueryInputType$1>) => T['__inputType'] | void): T;
7635
7911
  /**
7636
7912
  * Mark the column as a primary key.
7637
7913
  * This column type becomes an argument of the `.find` method.
@@ -8211,7 +8487,7 @@ interface ToSQLQuery extends IsQuery$1 {
8211
8487
  }
8212
8488
  type UnionArgs<T extends PickQueryResult> = ({
8213
8489
  result: { [K in keyof T['result']]: {
8214
- queryType: T['result'][K]['queryType'];
8490
+ __queryType: T['result'][K]['__queryType'];
8215
8491
  } };
8216
8492
  } | ((q: T) => Expression$1))[];
8217
8493
  declare class Union {
@@ -8335,7 +8611,7 @@ declare class Clear {
8335
8611
  type HavingArgFn<T> = (q: T) => {
8336
8612
  result: {
8337
8613
  value: {
8338
- outputType: boolean;
8614
+ __outputType: boolean;
8339
8615
  };
8340
8616
  };
8341
8617
  };
@@ -8408,7 +8684,7 @@ interface QueryPluckSelf extends PickQuerySelectable, PickQueryRelationsWithData
8408
8684
  type PluckArg<T extends QueryPluckSelf> = SelectableOrExpression<T> | ((q: SelectAsFnArg<T>) => Expression$1 | Query.Pick.SingleValueResult);
8409
8685
  type PluckResult<T extends QueryPluckSelf, S extends PluckArg<T>> = S extends ((q: never) => infer R) ? R extends Expression$1 ? SetQueryReturnsPluck<T, R> : R extends Query.Pick.SingleValueResult ? { [K in keyof T]: K extends '__hasSelect' ? true : K extends 'result' ? {
8410
8686
  pluck: R['result']['value'];
8411
- } : K extends 'returnType' ? 'pluck' : K extends 'then' ? QueryThen<R['result']['value']['outputType'][]> : T[K] } : never : S extends SelectableOrExpression<T> ? SetQueryReturnsPluck<T, S> : never;
8687
+ } : K extends 'returnType' ? 'pluck' : K extends 'then' ? QueryThen<R['result']['value']['__outputType'][]> : T[K] } : never : S extends SelectableOrExpression<T> ? SetQueryReturnsPluck<T, S> : never;
8412
8688
  declare class QueryPluck {
8413
8689
  /**
8414
8690
  * `.pluck` returns a single array of a single selected column values:
@@ -8580,15 +8856,15 @@ interface QueryHelper<T extends PickQueryTableMetaShapeTableAs, Args extends any
8580
8856
  interface NarrowTypeSelf extends PickQueryResultReturnType {
8581
8857
  returnType: undefined | 'all' | 'one' | 'oneOrThrow' | 'value' | 'valueOrThrow' | 'pluck';
8582
8858
  }
8583
- type NarrowInvalidKeys<T extends PickQueryResult, Narrow> = { [K in keyof Narrow]: K extends keyof T['result'] ? Narrow[K] extends T['result'][K]['outputType'] ? never : K : K }[keyof Narrow];
8859
+ type NarrowInvalidKeys<T extends PickQueryResult, Narrow> = { [K in keyof Narrow]: K extends keyof T['result'] ? Narrow[K] extends T['result'][K]['__outputType'] ? never : K : K }[keyof Narrow];
8584
8860
  interface NarrowValueTypeResult<T extends PickQueryResultReturnType, Narrow> extends Column$1.QueryColumns {
8585
- value: { [K in keyof T['result']['value']]: K extends 'outputType' ? Narrow : T['result']['value'][K] };
8861
+ value: { [K in keyof T['result']['value']]: K extends '__outputType' ? Narrow : T['result']['value'][K] };
8586
8862
  }
8587
8863
  interface NarrowPluckTypeResult<T extends PickQueryResultReturnType, Narrow> extends Column$1.QueryColumns {
8588
- pluck: { [K in keyof T['result']['pluck']]: K extends 'outputType' ? Narrow extends unknown[] ? Narrow[number] : Narrow : T['result']['pluck'][K] };
8864
+ pluck: { [K in keyof T['result']['pluck']]: K extends '__outputType' ? Narrow extends unknown[] ? Narrow[number] : Narrow : T['result']['pluck'][K] };
8589
8865
  }
8590
8866
  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] };
8591
- 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>;
8867
+ 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>;
8592
8868
  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 {}
8593
8869
  declare class QueryMethods<ColumnTypes> {
8594
8870
  /**
@@ -9019,10 +9295,10 @@ declare class QueryMethods<ColumnTypes> {
9019
9295
  * ```
9020
9296
  */
9021
9297
  narrowType<T extends NarrowTypeSelf>(this: T): <Narrow>() => T['returnType'] extends undefined | 'all' | 'one' | 'oneOrThrow' ? [NarrowInvalidKeys<T, Narrow>] extends [never] ? { [K in keyof T]: K extends 'result' ? T['result'] & { [K in keyof Narrow]: {
9022
- outputType: Narrow[K];
9298
+ __outputType: Narrow[K];
9023
9299
  } } : K extends 'then' ? QueryThenByQuery<T, T['result'] & { [K in keyof Narrow]: {
9024
- outputType: Narrow[K];
9025
- } }> : T[K] } : `narrowType() error: provided type does not extend the '${NarrowInvalidKeys<T, Narrow> & string}' column type` : (T['returnType'] extends 'pluck' ? Narrow extends unknown[] ? Narrow[number] : Narrow : Narrow) extends (T['returnType'] extends 'pluck' ? T['result']['pluck']['outputType'] : T['result']['value']['outputType']) ? { [K in keyof T]: K extends 'result' ? T['returnType'] extends 'value' | 'valueOrThrow' ? NarrowValueTypeResult<T, Narrow> : NarrowPluckTypeResult<T, Narrow> : K extends 'then' ? QueryThenByQuery<T, T['returnType'] extends 'value' | 'valueOrThrow' ? NarrowValueTypeResult<T, Narrow> : NarrowPluckTypeResult<T, Narrow>> : T[K] } : 'narrowType() error: provided type does not extend the returning column column type';
9300
+ __outputType: Narrow[K];
9301
+ } }> : T[K] } : `narrowType() error: provided type does not extend the '${NarrowInvalidKeys<T, Narrow> & string}' column type` : (T['returnType'] extends 'pluck' ? Narrow extends unknown[] ? Narrow[number] : Narrow : Narrow) extends (T['returnType'] extends 'pluck' ? T['result']['pluck']['__outputType'] : T['result']['value']['__outputType']) ? { [K in keyof T]: K extends 'result' ? T['returnType'] extends 'value' | 'valueOrThrow' ? NarrowValueTypeResult<T, Narrow> : NarrowPluckTypeResult<T, Narrow> : K extends 'then' ? QueryThenByQuery<T, T['returnType'] extends 'value' | 'valueOrThrow' ? NarrowValueTypeResult<T, Narrow> : NarrowPluckTypeResult<T, Narrow>> : T[K] } : 'narrowType() error: provided type does not extend the returning column column type';
9026
9302
  if<T extends PickQueryResultReturnType, R extends PickQueryResult>(this: T, condition: boolean | null | undefined, fn: (q: T) => R & {
9027
9303
  returnType: T['returnType'];
9028
9304
  }): QueryIfResult<T, R>;
@@ -9096,7 +9372,7 @@ interface Query extends IsQuery$1, PickQueryTable, PickQueryShape$1, PickQuerySe
9096
9372
  returnType: QueryReturnType$1;
9097
9373
  qb: QueryBuilder;
9098
9374
  columnTypes: unknown;
9099
- inputType: RecordUnknown$1;
9375
+ __inputType: RecordUnknown$1;
9100
9376
  q: QueryData$1;
9101
9377
  then: QueryThen<unknown>;
9102
9378
  catch: QueryCatch;
@@ -9133,43 +9409,43 @@ declare namespace Query {
9133
9409
  }
9134
9410
  }
9135
9411
  }
9136
- type SelectableOfType<T extends PickQuerySelectable, Type> = { [K in keyof T['__selectable']]: T['__selectable'][K]['column']['type'] extends Type | null ? K : never }[keyof T['__selectable']];
9137
- type SelectableOrExpressionOfType<T extends PickQuerySelectable, C extends Column$1.Pick.Type> = SelectableOfType<T, C['type']> | Expression$1<Column$1.Pick.QueryColumnOfType<C['type'] | null>>;
9412
+ type SelectableOfType<T extends PickQuerySelectable, Type> = { [K in keyof T['__selectable']]: T['__selectable'][K]['column']['__type'] extends Type | null ? K : never }[keyof T['__selectable']];
9413
+ type SelectableOrExpressionOfType<T extends PickQuerySelectable, C extends Column$1.Pick.Type> = SelectableOfType<T, C['__type']> | Expression$1<Column$1.Pick.QueryColumnOfType<C['__type'] | null>>;
9138
9414
  type SetQueryReturnsAll<T extends PickQueryResult> = { [K in keyof T]: K extends 'returnType' ? 'all' : K extends 'then' ? QueryThenShallowSimplifyArr<ColumnsShape$1.Output<T['result']>> : T[K] } & QueryHasWhere$1;
9139
9415
  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;
9140
- 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] };
9416
+ 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] };
9141
9417
  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] };
9142
- 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] };
9418
+ 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] };
9143
9419
  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] };
9144
9420
  type SetQueryReturnsOne<T extends PickQueryResult> = { [K in keyof T]: K extends 'returnType' ? 'oneOrThrow' : K extends 'then' ? QueryThenShallowSimplify<ColumnsShape$1.Output<T['result']>> : T[K] };
9145
9421
  type SetQueryReturnsOneResult<T extends PickQueryResult, Result extends Column$1.QueryColumns> = { [K in keyof T]: K extends 'returnType' ? 'oneOrThrow' : K extends 'result' ? Result : K extends 'then' ? QueryThenShallowSimplify<ColumnsShape$1.Output<Result>> : T[K] };
9146
9422
  type SetQueryReturnsRows<T extends PickQueryResult> = { [K in keyof T]: K extends 'returnType' ? 'rows' : K extends 'then' ? QueryThen<ColumnsShape$1.Output<T['result']>[keyof T['result']][][]> : T[K] };
9147
9423
  type SetQueryReturnsPluck<T extends PickQuerySelectable, S extends keyof T['__selectable'] | Expression$1> = S extends keyof T['__selectable'] ? { [K in keyof T]: K extends '__hasSelect' ? true : K extends 'result' ? {
9148
9424
  pluck: T['__selectable'][S]['column'];
9149
- } : K extends 'returnType' ? 'pluck' : K extends 'then' ? QueryThen<T['__selectable'][S]['column']['outputType'][]> : T[K] } : { [K in keyof T]: K extends '__hasSelect' ? true : K extends 'result' ? {
9425
+ } : K extends 'returnType' ? 'pluck' : K extends 'then' ? QueryThen<T['__selectable'][S]['column']['__outputType'][]> : T[K] } : { [K in keyof T]: K extends '__hasSelect' ? true : K extends 'result' ? {
9150
9426
  pluck: S extends Expression$1 ? S['result']['value'] : never;
9151
- } : K extends 'returnType' ? 'pluck' : K extends 'then' ? QueryThen<(S extends Expression$1 ? S['result']['value']['outputType'] : never)[]> : T[K] };
9427
+ } : K extends 'returnType' ? 'pluck' : K extends 'then' ? QueryThen<(S extends Expression$1 ? S['result']['value']['__outputType'] : never)[]> : T[K] };
9152
9428
  type SetValueQueryReturnsPluckColumn<T extends PickQueryResult> = { [K in keyof T]: K extends 'result' ? {
9153
9429
  pluck: T['result']['value'];
9154
- } : K extends 'returnType' ? 'pluck' : K extends 'then' ? QueryThen<T['result']['value']['outputType'][]> : T[K] } & QueryHasSelect;
9430
+ } : K extends 'returnType' ? 'pluck' : K extends 'then' ? QueryThen<T['result']['value']['__outputType'][]> : T[K] } & QueryHasSelect;
9155
9431
  type SetQueryReturnsPluckColumnResult<T extends PickQueryResult, Result extends Column$1.QueryColumns> = { [K in keyof T]: K extends 'result' ? {
9156
9432
  pluck: T['result']['value'];
9157
- } : K extends 'returnType' ? 'pluck' : K extends 'result' ? Result : K extends 'then' ? QueryThen<T['result']['value']['outputType'][]> : T[K] } & QueryHasSelect;
9433
+ } : K extends 'returnType' ? 'pluck' : K extends 'result' ? Result : K extends 'then' ? QueryThen<T['result']['value']['__outputType'][]> : T[K] } & QueryHasSelect;
9158
9434
  type SetQueryReturnsValueOrThrow<T extends PickQuerySelectable, Arg extends keyof T['__selectable']> = SetQueryReturnsColumnOrThrow<T, T['__selectable'][Arg]['column']> & T['__selectable'][Arg]['column']['operators'];
9159
- type SetValueQueryReturnsValueOrThrow<T extends PickQueryResult> = { [K in keyof T]: K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<T['result']['value']['outputType']> : T[K] };
9160
- type SetQueryReturnsValueOptional<T extends PickQuerySelectable, Arg extends GetStringArg<T>> = SetQueryReturnsColumnOptional<T, { [K in keyof T['__selectable'][Arg]['column']]: K extends 'outputType' ? T['__selectable'][Arg]['column'][K] | undefined : T['__selectable'][Arg]['column'][K] }> & Omit<T['__selectable'][Arg]['column']['operators'], 'equals' | 'not'> & Column$1.Modifiers.OperatorsNullable<T['__selectable'][Arg]['column']>;
9435
+ type SetValueQueryReturnsValueOrThrow<T extends PickQueryResult> = { [K in keyof T]: K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<T['result']['value']['__outputType']> : T[K] };
9436
+ type SetQueryReturnsValueOptional<T extends PickQuerySelectable, Arg extends GetStringArg<T>> = SetQueryReturnsColumnOptional<T, { [K in keyof T['__selectable'][Arg]['column']]: K extends '__outputType' ? T['__selectable'][Arg]['column'][K] | undefined : T['__selectable'][Arg]['column'][K] }> & Omit<T['__selectable'][Arg]['column']['operators'], 'equals' | 'not'> & Column$1.Modifiers.OperatorsNullable<T['__selectable'][Arg]['column']>;
9161
9437
  type SetQueryReturnsColumnOrThrow<T, Column extends Column.Pick.OutputType> = { [K in keyof T]: K extends 'result' ? {
9162
9438
  value: Column;
9163
- } : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<Column['outputType']> : T[K] } & QueryHasSelect;
9439
+ } : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<Column['__outputType']> : T[K] } & QueryHasSelect;
9164
9440
  type SetQueryReturnsColumnOptional<T, Column extends Column.Pick.OutputType> = { [K in keyof T]: K extends 'result' ? {
9165
9441
  value: Column;
9166
- } : K extends 'returnType' ? 'value' : K extends 'then' ? QueryThen<Column['outputType'] | undefined> : T[K] } & QueryHasSelect;
9442
+ } : K extends 'returnType' ? 'value' : K extends 'then' ? QueryThen<Column['__outputType'] | undefined> : T[K] } & QueryHasSelect;
9167
9443
  type SetQueryReturnsColumn<T extends PickQueryResult> = { [K in keyof T]: K extends 'result' ? {
9168
9444
  value: T['result']['pluck'];
9169
- } : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<T['result']['pluck']['outputType']> : T[K] } & QueryHasSelect;
9445
+ } : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<T['result']['pluck']['__outputType']> : T[K] } & QueryHasSelect;
9170
9446
  type SetQueryReturnsColumnResult<T extends PickQueryResult, Result extends Column$1.QueryColumns> = { [K in keyof T]: K extends 'result' ? {
9171
9447
  value: T['result']['pluck'];
9172
- } : K extends 'returnType' ? 'valueOrThrow' : K extends 'result' ? Result : K extends 'then' ? QueryThen<Result['pluck']['outputType']> : T[K] } & QueryHasSelect;
9448
+ } : K extends 'returnType' ? 'valueOrThrow' : K extends 'result' ? Result : K extends 'then' ? QueryThen<Result['pluck']['__outputType']> : T[K] } & QueryHasSelect;
9173
9449
  type SetQueryReturnsRowCount<T extends PickQueryResult> = { [K in keyof T]: K extends 'returnType' ? 'valueOrThrow' : K extends 'result' ? {
9174
9450
  value: Column$1.Pick.QueryColumnOfType<number>;
9175
9451
  } : K extends 'then' ? QueryThen<number> : T[K] };
@@ -9184,11 +9460,11 @@ interface QueryOrExpressionBooleanOrNullResult {
9184
9460
  };
9185
9461
  }
9186
9462
  interface UpdateSelf extends PickQuerySelectable, PickQueryResult, PickQueryRelations$1, PickQueryWithData, PickQueryReturnType, PickQueryShape$1, PickQueryInputType$1, PickQueryAs, PickQueryHasSelect, PickQueryHasWhere, Query.Pick.IsNotReadOnly {}
9187
- type UpdateData$1<T extends UpdateSelf> = { [K in keyof T['inputType'] | keyof T['relations']]?: K extends keyof T['inputType'] ? T['inputType'][K] | ((q: { [K in keyof T['relations'] | keyof T]: K extends keyof T['relations'] ? T['relations'][K]['query'] : K extends keyof T ? T[K] : never }) => QueryOrExpression$1<T['inputType'][K]>) : T['returnType'] extends undefined | 'all' ? T['relations'][K]['dataForUpdate'] : T['relations'][K]['dataForUpdateOne'] };
9463
+ type UpdateData$1<T extends UpdateSelf> = { [K in keyof T['__inputType'] | keyof T['relations']]?: K extends keyof T['__inputType'] ? T['__inputType'][K] | ((q: { [K in keyof T['relations'] | keyof T]: K extends keyof T['relations'] ? T['relations'][K]['query'] : K extends keyof T ? T[K] : never }) => QueryOrExpression$1<T['__inputType'][K]>) : T['returnType'] extends undefined | 'all' ? T['relations'][K]['dataForUpdate'] : T['relations'][K]['dataForUpdateOne'] };
9188
9464
  type UpdateArg<T extends UpdateSelf> = T['__hasWhere'] extends true ? UpdateData$1<T> : 'Update statement must have where conditions. To update all prefix `update` with `all()`';
9189
9465
  type UpdateResult<T extends UpdateSelf> = T['__hasSelect'] extends true ? T : T['returnType'] extends undefined | 'all' ? SetQueryReturnsRowCountMany<T> : SetQueryReturnsRowCount<T>;
9190
- type NumericColumns<T extends UpdateSelf> = { [K in keyof T['inputType']]: Exclude<T['shape'][K]['queryType'], string> extends number | bigint | null ? K : never }[keyof T['inputType']];
9191
- type ChangeCountArg<T extends UpdateSelf> = NumericColumns<T> | { [K in NumericColumns<T>]?: T['shape'][K]['type'] extends number | null ? number : number | string | bigint };
9466
+ type NumericColumns<T extends UpdateSelf> = { [K in keyof T['__inputType']]: Exclude<T['shape'][K]['__queryType'], string> extends number | bigint | null ? K : never }[keyof T['__inputType']];
9467
+ type ChangeCountArg<T extends UpdateSelf> = NumericColumns<T> | { [K in NumericColumns<T>]?: T['shape'][K]['__type'] extends number | null ? number : number | string | bigint };
9192
9468
  interface UpdateManyBySelf extends UpdateSelf {
9193
9469
  internal: {
9194
9470
  uniqueColumns: unknown;
@@ -9197,10 +9473,10 @@ interface UpdateManyBySelf extends UpdateSelf {
9197
9473
  uniqueConstraints: unknown;
9198
9474
  };
9199
9475
  }
9200
- type UpdateManyData<T extends UpdateSelf> = ({ [K in keyof T['shape'] as T['shape'][K] extends Column$1.Modifiers.IsPrimaryKey<string> ? K : never]: T['shape'][K]['queryType'] | Expression$1 } & { [P in keyof T['inputType']]?: T['inputType'][P] | Expression$1 })[];
9476
+ type UpdateManyData<T extends UpdateSelf> = ({ [K in keyof T['shape'] as T['shape'][K] extends Column$1.Modifiers.IsPrimaryKey<string> ? K : never]: T['shape'][K]['__queryType'] | Expression$1 } & { [P in keyof T['__inputType']]?: T['__inputType'][P] | Expression$1 })[];
9201
9477
  type UpdateManyByKeys<T extends UpdateManyBySelf> = T['internal']['uniqueColumnNames'] | T['internal']['uniqueColumnTuples'];
9202
9478
  type UpdateManyByKeyColumns<K> = K extends string[] ? K[number] : K;
9203
- type UpdateManyByData<T extends UpdateSelf, K> = ({ [P in K & keyof T['inputType']]: T['inputType'][P] } & { [P in keyof T['inputType']]?: P extends K ? T['inputType'][P] : T['inputType'][P] | Expression$1 })[];
9479
+ type UpdateManyByData<T extends UpdateSelf, K> = ({ [P in K & keyof T['__inputType']]: T['__inputType'][P] } & { [P in keyof T['__inputType']]?: P extends K ? T['__inputType'][P] : T['__inputType'][P] | Expression$1 })[];
9204
9480
  type UpdateManyResult<T extends UpdateSelf> = T['__hasSelect'] extends true ? T['returnType'] extends 'one' | 'oneOrThrow' ? SetQueryReturnsAllResult<T, T['result']> : T['returnType'] extends 'value' | 'valueOrThrow' ? SetQueryReturnsPluckColumnResult<T, T['result']> : SetQueryResult<T, T['result']> : SetQueryReturnsRowCountMany<T>;
9205
9481
  declare class QueryUpdate {
9206
9482
  /**
@@ -9645,4 +9921,4 @@ declare class QueryUpdate {
9645
9921
  */
9646
9922
  updateManyByOptional<T extends UpdateManyBySelf, Keys extends UpdateManyByKeys<T>, K = UpdateManyByKeyColumns<Keys>>(this: T, keys: Keys, data: UpdateManyByData<T, K>): UpdateManyResult<T> & QueryHasWhere$1;
9647
9923
  }
9648
- 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, 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, quoteIdentifier, quoteObjectKey, quoteTableWithSchema, raw, rawSqlToCode, referencesArgsToCode, returnArg, setColumnData, setColumnEncode, setColumnParse, setColumnParseNull, setCurrentColumnName, setDataValue, setDefaultLanguage, setFreeAlias, setQueryObjectValueImmutable, singleQuote, tableDataMethods, toArray, toCamelCase, toPascalCase, toSnakeCase, wrapAdapterFnWithConnectRetry };
9924
+ 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 };