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.
package/dist/index.d.ts CHANGED
@@ -630,7 +630,7 @@ interface ColumnSchemaGetterTableClass {
630
630
  }
631
631
  type ColumnSchemaGetterColumns<T extends ColumnSchemaGetterTableClass> = T['prototype']['columns']['shape'];
632
632
  interface ColumnTypeSchemaArg {
633
- type: unknown;
633
+ __schemaType: unknown;
634
634
  nullable<T extends Column.Pick.ForNullable>(this: T): Column.Modifiers.Nullable<T, unknown, unknown, unknown>;
635
635
  encode: unknown;
636
636
  parse: unknown;
@@ -664,6 +664,7 @@ interface ColumnSchemaConfig<T extends Column.Pick.Data = Column.Pick.Data> exte
664
664
  bit(max?: number): unknown;
665
665
  uuid(): unknown;
666
666
  json(): T;
667
+ jsonText(): T;
667
668
  inputSchema(this: ColumnSchemaGetterTableClass): unknown;
668
669
  outputSchema(this: ColumnSchemaGetterTableClass): unknown;
669
670
  querySchema(this: ColumnSchemaGetterTableClass): unknown;
@@ -956,7 +957,7 @@ interface TableDataMethods<Key extends PropertyKey> {
956
957
  sql: SqlFn;
957
958
  }
958
959
  type TableDataItemsUniqueColumns<Shape extends Column.QueryColumns, T extends MaybeArray<TableDataItem>> = MaybeArray<TableDataItem> extends T ? never : T extends UniqueTableDataItem<Shape> ? ItemUniqueColumns<Shape, T> : T extends unknown[] ? { [Item in T[number] as PropertyKey]: Item extends UniqueTableDataItem<Shape> ? ItemUniqueColumns<Shape, Item> : never }[PropertyKey] : never;
959
- type ItemUniqueColumns<Shape extends Column.QueryColumns, T extends UniqueTableDataItem<Shape>> = { [Column in T['columns'][number]]: UniqueQueryTypeOrExpression<Shape[Column]['queryType']> };
960
+ type ItemUniqueColumns<Shape extends Column.QueryColumns, T extends UniqueTableDataItem<Shape>> = { [Column in T['columns'][number]]: UniqueQueryTypeOrExpression<Shape[Column]['__queryType']> };
960
961
  type TableDataItemsUniqueColumnTuples<Shape extends Column.QueryColumns, T extends MaybeArray<TableDataItem>> = MaybeArray<TableDataItem> extends T ? never : T extends UniqueTableDataItem<Shape> ? T['columns'] : T extends TableDataItem[] ? Exclude<T[number]['columns'], []> : never;
961
962
  type UniqueQueryTypeOrExpression<T> = T | Expression<Column.Pick.QueryColumnOfType<T>>;
962
963
  type TableDataItemsUniqueConstraints<T extends MaybeArray<TableDataItem>> = MaybeArray<TableDataItem> extends T ? never : T extends UniqueTableDataItem ? T['name'] : T extends UniqueTableDataItem[] ? T[number]['name'] : never;
@@ -1054,16 +1055,33 @@ interface NumberColumnData extends BaseNumberData, Column.Data {
1054
1055
  interface SerialColumnData extends NumberColumnData {
1055
1056
  default: Expression;
1056
1057
  }
1057
- declare abstract class NumberBaseColumn<Schema extends ColumnSchemaConfig, SchemaType extends Schema['type']> extends Column<Schema, number, SchemaType, OperatorsNumber> {
1058
+ declare abstract class NumberBaseColumn<Schema extends ColumnSchemaConfig, SchemaType extends Schema['__schemaType']> extends Column {
1059
+ __schema: Schema;
1060
+ __type: number;
1061
+ __inputType: number;
1062
+ inputSchema: SchemaType;
1058
1063
  data: NumberColumnData;
1064
+ __outputType: number;
1065
+ outputSchema: SchemaType;
1066
+ __queryType: number;
1067
+ querySchema: SchemaType;
1059
1068
  operators: OperatorsNumber;
1060
1069
  }
1061
1070
  declare abstract class IntegerBaseColumn<Schema extends ColumnSchemaConfig> extends NumberBaseColumn<Schema, ReturnType<Schema['int']>> {
1062
1071
  data: NumberColumnData;
1072
+ querySchema: ReturnType<Schema['int']>;
1063
1073
  constructor(schema: Schema);
1064
1074
  }
1065
- declare abstract class NumberAsStringBaseColumn<Schema extends ColumnSchemaConfig, InputType = string | number> extends Column<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsNumber, InputType> {
1075
+ declare abstract class NumberAsStringBaseColumn<Schema extends ColumnSchemaConfig, InputType = string | number> extends Column {
1076
+ __schema: Schema;
1077
+ __type: string;
1078
+ __inputType: InputType;
1079
+ inputSchema: ReturnType<Schema['stringSchema']>;
1066
1080
  operators: OperatorsNumber;
1081
+ __outputType: string;
1082
+ outputSchema: ReturnType<Schema['stringSchema']>;
1083
+ __queryType: InputType;
1084
+ querySchema: ReturnType<Schema['stringSchema']>;
1067
1085
  data: Column.Data;
1068
1086
  constructor(schema: Schema);
1069
1087
  }
@@ -1073,6 +1091,7 @@ interface DecimalColumnData extends Column.Data {
1073
1091
  }
1074
1092
  declare class DecimalColumn<Schema extends ColumnSchemaConfig> extends NumberAsStringBaseColumn<Schema> {
1075
1093
  data: DecimalColumnData;
1094
+ querySchema: ReturnType<Schema['stringSchema']>;
1076
1095
  operators: OperatorsNumber;
1077
1096
  dataType: "numeric";
1078
1097
  constructor(schema: Schema, numericPrecision?: number, numericScale?: number);
@@ -1082,35 +1101,41 @@ declare class DecimalColumn<Schema extends ColumnSchemaConfig> extends NumberAsS
1082
1101
  type IdentityColumn<T extends Column.Pick.Data> = Column.Modifiers.Default<T, Expression>;
1083
1102
  declare class SmallIntColumn<Schema extends ColumnSchemaConfig> extends IntegerBaseColumn<Schema> {
1084
1103
  dataType: "int2";
1104
+ querySchema: ReturnType<Schema['int']>;
1085
1105
  constructor(schema: Schema);
1086
1106
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1087
- identity<T extends Column>(this: T, options?: TableData.Identity): IdentityColumn<T>;
1107
+ identity<T extends Column.Pick.Data>(this: T, options?: TableData.Identity): IdentityColumn<T>;
1088
1108
  }
1089
1109
  declare class IntegerColumn<Schema extends ColumnSchemaConfig> extends IntegerBaseColumn<Schema> {
1090
1110
  dataType: "int4";
1111
+ querySchema: ReturnType<Schema['int']>;
1091
1112
  constructor(schema: Schema);
1092
1113
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1093
- identity<T extends Column>(this: T, options?: TableData.Identity): IdentityColumn<T>;
1114
+ identity<T extends Column.Pick.Data>(this: T, options?: TableData.Identity): IdentityColumn<T>;
1094
1115
  }
1095
1116
  declare class BigIntColumn<Schema extends ColumnSchemaConfig> extends NumberAsStringBaseColumn<Schema, string | number | bigint> {
1096
1117
  dataType: "int8";
1118
+ querySchema: ReturnType<Schema['stringSchema']>;
1097
1119
  constructor(schema: Schema);
1098
1120
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1099
- identity<T extends Column>(this: T, options?: TableData.Identity): IdentityColumn<T>;
1121
+ identity<T extends Column.Pick.Data>(this: T, options?: TableData.Identity): IdentityColumn<T>;
1100
1122
  }
1101
1123
  declare class RealColumn<Schema extends ColumnSchemaConfig> extends NumberBaseColumn<Schema, ReturnType<Schema['number']>> {
1102
1124
  dataType: "float4";
1125
+ querySchema: ReturnType<Schema['number']>;
1103
1126
  constructor(schema: Schema);
1104
1127
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1105
1128
  }
1106
1129
  declare class DoublePrecisionColumn<Schema extends ColumnSchemaConfig> extends NumberAsStringBaseColumn<Schema> {
1107
1130
  dataType: "float8";
1131
+ querySchema: ReturnType<Schema['stringSchema']>;
1108
1132
  constructor(schema: Schema);
1109
1133
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1110
1134
  }
1111
1135
  declare class SmallSerialColumn<Schema extends ColumnSchemaConfig> extends IntegerBaseColumn<Schema> {
1112
1136
  dataType: "int2";
1113
1137
  data: SerialColumnData;
1138
+ querySchema: ReturnType<Schema['int']>;
1114
1139
  constructor(schema: Schema);
1115
1140
  toSQL(): string;
1116
1141
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
@@ -1118,6 +1143,7 @@ declare class SmallSerialColumn<Schema extends ColumnSchemaConfig> extends Integ
1118
1143
  declare class SerialColumn<Schema extends ColumnSchemaConfig> extends IntegerBaseColumn<Schema> {
1119
1144
  dataType: "int4";
1120
1145
  data: SerialColumnData;
1146
+ querySchema: ReturnType<Schema['int']>;
1121
1147
  constructor(schema: Schema);
1122
1148
  toSQL(): string;
1123
1149
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
@@ -1125,6 +1151,7 @@ declare class SerialColumn<Schema extends ColumnSchemaConfig> extends IntegerBas
1125
1151
  declare class BigSerialColumn<Schema extends ColumnSchemaConfig> extends NumberAsStringBaseColumn<Schema> {
1126
1152
  dataType: "int8";
1127
1153
  data: SerialColumnData;
1154
+ querySchema: ReturnType<Schema['stringSchema']>;
1128
1155
  constructor(schema: Schema);
1129
1156
  toSQL(): string;
1130
1157
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
@@ -1138,9 +1165,17 @@ declare const getDateAsDateFn: (column: {
1138
1165
  data: Column.Data;
1139
1166
  dateParsedByDriver?: boolean;
1140
1167
  }) => (value: unknown) => Date;
1141
- declare abstract class DateBaseColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, string, ReturnType<Schema['stringNumberDate']>, OperatorsDate, DateColumnInput, string, ReturnType<Schema['stringSchema']>> {
1168
+ declare abstract class DateBaseColumn<Schema extends ColumnSchemaConfig> extends Column {
1142
1169
  dateParsedByDriver?: boolean | undefined;
1170
+ __schema: Schema;
1171
+ __type: string;
1172
+ __inputType: DateColumnInput;
1173
+ inputSchema: ReturnType<Schema['stringNumberDate']>;
1143
1174
  data: DateColumnData;
1175
+ __outputType: string;
1176
+ outputSchema: ReturnType<Schema['stringSchema']>;
1177
+ __queryType: DateColumnInput;
1178
+ querySchema: ReturnType<Schema['stringNumberDate']>;
1144
1179
  operators: OperatorsDate;
1145
1180
  asNumber: Schema['dateAsNumber'];
1146
1181
  asDate: Schema['dateAsDate'];
@@ -1170,42 +1205,66 @@ declare class TimestampTZColumn<Schema extends ColumnSchemaConfig> extends DateT
1170
1205
  baseDataType: "timestamp";
1171
1206
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1172
1207
  }
1173
- declare class TimeColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsTime> {
1208
+ declare class TimeColumn<Schema extends ColumnSchemaConfig> extends Column {
1209
+ __schema: Schema;
1210
+ __type: string;
1211
+ __inputType: ReturnType<Schema['stringSchema']>;
1212
+ inputSchema: ReturnType<Schema['stringSchema']>;
1174
1213
  data: DateColumnData & {
1175
1214
  dateTimePrecision?: number;
1176
1215
  };
1216
+ __outputType: string;
1217
+ outputSchema: ReturnType<Schema['stringSchema']>;
1218
+ __queryType: string;
1219
+ querySchema: ReturnType<Schema['stringSchema']>;
1177
1220
  dataType: "time";
1178
1221
  operators: OperatorsTime;
1179
1222
  constructor(schema: Schema, dateTimePrecision?: number);
1180
1223
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1181
1224
  }
1182
- declare class IntervalColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, PostgresInterval, ReturnType<Schema['timeInterval']>, OperatorsDate, Partial<PostgresInterval>, PostgresInterval> {
1225
+ declare class IntervalColumn<Schema extends ColumnSchemaConfig> extends Column {
1226
+ __schema: Schema;
1227
+ __type: PostgresInterval;
1183
1228
  data: Column.Data & {
1184
1229
  fields?: string;
1185
1230
  precision?: number;
1186
1231
  };
1232
+ __inputType: Partial<PostgresInterval>;
1233
+ inputSchema: ReturnType<Schema['timeInterval']>;
1234
+ __outputType: PostgresInterval;
1235
+ outputSchema: ReturnType<Schema['timeInterval']>;
1236
+ __queryType: PostgresInterval;
1237
+ querySchema: ReturnType<Schema['timeInterval']>;
1187
1238
  dataType: "interval";
1188
1239
  operators: OperatorsDate;
1189
1240
  constructor(schema: Schema, fields?: string, precision?: number, parse?: (input: string) => PostgresInterval);
1190
1241
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1191
1242
  toSQL(): string;
1192
1243
  }
1193
- declare class EnumColumn<Schema extends ColumnTypeSchemaArg, SchemaType extends Schema['type'], const T extends readonly string[]> extends Column<Schema, T[number], SchemaType, OperatorsOrdinalText> {
1244
+ declare class EnumColumn<Schema extends ColumnTypeSchemaArg, SchemaType extends Schema['__schemaType'], const T extends readonly string[]> extends Column {
1194
1245
  enumName: string;
1195
1246
  options: T;
1247
+ __schema: Schema;
1196
1248
  operators: OperatorsOrdinalText;
1249
+ __type: T[number];
1250
+ __inputType: T[number];
1251
+ inputSchema: SchemaType;
1252
+ __outputType: T[number];
1253
+ outputSchema: SchemaType;
1254
+ __queryType: T[number];
1255
+ querySchema: SchemaType;
1197
1256
  dataType: string;
1198
1257
  constructor(schema: Schema, enumName: string, options: T, schemaType: SchemaType);
1199
1258
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1200
1259
  toSQL(): string;
1201
1260
  }
1202
1261
  interface ArrayColumnValue {
1203
- type: unknown;
1262
+ __type: unknown;
1204
1263
  inputSchema: any;
1205
- inputType: unknown;
1206
- outputType: unknown;
1264
+ __inputType: unknown;
1265
+ __outputType: unknown;
1207
1266
  outputSchema: any;
1208
- queryType: any;
1267
+ __queryType: any;
1209
1268
  querySchema: any;
1210
1269
  toSQL(): string;
1211
1270
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
@@ -1215,67 +1274,90 @@ interface ArrayData<Item extends ArrayColumnValue> extends Column.Data, ArrayMet
1215
1274
  item: Item;
1216
1275
  arrayDims: number;
1217
1276
  }
1218
- declare class ArrayColumn<Schema extends ColumnTypeSchemaArg, Item extends ArrayColumnValue, InputType, OutputType, QueryType> extends Column<Schema, Item['type'][], InputType, OperatorsArray<Item['queryType']>, Item['inputType'][], Item['outputType'][], OutputType, Item['queryType'][], QueryType> {
1277
+ declare class ArrayColumn<Schema extends ColumnTypeSchemaArg, Item extends ArrayColumnValue, InputType, OutputType, QueryType> extends Column {
1278
+ __schema: Schema;
1219
1279
  dataType: "array";
1220
- operators: OperatorsArray<Item["queryType"]>;
1280
+ operators: OperatorsArray<Item["__queryType"]>;
1221
1281
  data: ArrayData<Item>;
1222
- constructor(schema: Schema, item: Item, inputType: InputType, defaultEncode?: (input: unknown) => unknown, outputType?: OutputType, queryType?: QueryType);
1282
+ __type: Item['__type'][];
1283
+ __inputType: Item['__type'][];
1284
+ inputSchema: InputType;
1285
+ __outputType: Item['__outputType'][];
1286
+ outputSchema: OutputType;
1287
+ __queryType: Item['__queryType'][];
1288
+ querySchema: QueryType;
1289
+ constructor(schema: Schema, item: Item, __inputType: InputType, defaultEncode?: (input: unknown) => unknown, __outputType?: OutputType, __queryType?: QueryType);
1223
1290
  toSQL(): string;
1224
1291
  toCode(this: ArrayColumn<ColumnSchemaConfig, ArrayColumnValue, unknown, unknown, unknown>, ctx: ColumnToCodeCtx, key: string): Code;
1225
1292
  }
1226
- declare class JSONColumn<T, Schema extends ColumnTypeSchemaArg, InputSchema = Schema['type']> extends Column<Schema, T, InputSchema, OperatorsJson> {
1293
+ declare class JSONColumn<T, Schema extends ColumnTypeSchemaArg, InputSchema = Schema['__schemaType']> extends Column {
1294
+ __schema: Schema;
1227
1295
  dataType: "jsonb";
1296
+ __type: T;
1297
+ __inputType: T;
1298
+ inputSchema: InputSchema;
1299
+ __outputType: T;
1300
+ outputSchema: InputSchema;
1301
+ __queryType: T;
1302
+ querySchema: InputSchema;
1228
1303
  operators: OperatorsJson;
1229
- constructor(schema: Schema, inputType: Schema['type'], encodedByDriver?: boolean);
1304
+ constructor(schema: Schema, __inputType: InputSchema, encodedByDriver?: boolean);
1230
1305
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1231
1306
  }
1232
- declare class JSONTextColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, unknown, ReturnType<Schema['unknown']>, OperatorsText> {
1307
+ declare class JSONTextColumn<T, Schema extends ColumnTypeSchemaArg, InputSchema = Schema['__schemaType']> extends Column {
1308
+ __schema: Schema;
1233
1309
  dataType: "json";
1310
+ __type: T;
1311
+ __inputType: T;
1312
+ inputSchema: InputSchema;
1313
+ __outputType: T;
1314
+ outputSchema: InputSchema;
1315
+ __queryType: T;
1316
+ querySchema: InputSchema;
1234
1317
  operators: OperatorsText;
1235
1318
  private static _instance;
1236
- static get instance(): JSONTextColumn<DefaultSchemaConfig>;
1237
- constructor(schema: Schema);
1319
+ static get instance(): JSONTextColumn<unknown, DefaultSchemaConfig, unknown>;
1320
+ constructor(schema: Schema, __inputType: InputSchema);
1238
1321
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1239
1322
  }
1240
1323
  interface DefaultSchemaConfig extends ColumnSchemaConfig<Column> {
1241
- parse<T extends Column.Pick.ForParse, Output>(this: T, fn: (input: T['type']) => Output): Column.Modifiers.Parse<T, unknown, Output>;
1324
+ parse<T extends Column.Pick.ForParse, Output>(this: T, fn: (input: T['__type']) => Output): Column.Modifiers.Parse<T, unknown, Output>;
1242
1325
  parseNull<T extends Column.Pick.ForParseNull, Output>(this: T, fn: () => Output): Column.Modifiers.ParseNull<T, unknown, Output>;
1243
- encode<T extends {
1244
- type: unknown;
1245
- }, Input>(this: T, fn: (input: Input) => unknown): Column.Modifiers.Encode<T, unknown, Input>;
1326
+ encode<T extends Column.Pick.Type, Input>(this: T, fn: (input: Input) => unknown): Column.Modifiers.Encode<T, unknown, Input>;
1246
1327
  /**
1247
1328
  * @deprecated use narrowType instead
1248
1329
  */
1249
1330
  asType<T, Types extends {
1250
1331
  type: unknown;
1251
- inputType: unknown;
1252
- outputType: unknown;
1253
- queryType: unknown;
1332
+ __inputType: unknown;
1333
+ __outputType: unknown;
1334
+ __queryType: unknown;
1254
1335
  }>(this: T, _fn: (type: <Type, Input = Type, Output = Type, Query = Type>() => {
1255
1336
  type: Type;
1256
- inputType: Input;
1257
- outputType: Output;
1258
- queryType: Query;
1259
- }) => Types): { [K in keyof T]: K extends keyof Types ? Types[K] : T[K] };
1260
- narrowType<T extends Column.InputOutputQueryTypes, Types extends Column.InputOutputQueryTypes>(this: T, _fn: (type: <Type extends (T['inputType'] extends T['outputType'] & T['queryType'] ? T['outputType'] & T['queryType'] : T['inputType'] & T['outputType'] & T['queryType'])>() => {
1261
- inputType: T['inputType'] extends never ? never : Type;
1262
- outputType: Type;
1263
- queryType: Type;
1337
+ __inputType: Input;
1338
+ __outputType: Output;
1339
+ __queryType: Query;
1340
+ }) => Types): { [K in keyof T]: K extends '__type' ? Types['type'] : K extends keyof Types ? Types[K] : T[K] };
1341
+ narrowType<T extends Column.InputOutputQueryTypes, Types extends Column.InputOutputQueryTypes>(this: T, _fn: (type: <Type extends (T['__inputType'] extends T['__outputType'] & T['__queryType'] ? T['__outputType'] & T['__queryType'] : T['__inputType'] & T['__outputType'] & T['__queryType'])>() => {
1342
+ __inputType: T['__inputType'] extends never ? never : Type;
1343
+ __outputType: Type;
1344
+ __queryType: Type;
1264
1345
  }) => Types): { [K in keyof T]: K extends keyof Types ? Types[K] : T[K] };
1265
1346
  narrowAllTypes<T extends Column.InputOutputQueryTypes, Types extends Column.InputOutputQueryTypes>(this: T, _fn: (type: <Types extends {
1266
- input?: T['inputType'];
1267
- output?: T['outputType'];
1268
- query?: T['queryType'];
1347
+ input?: T['__inputType'];
1348
+ output?: T['__outputType'];
1349
+ query?: T['__queryType'];
1269
1350
  }>() => {
1270
- inputType: undefined extends Types['input'] ? T['inputType'] : Types['input'];
1271
- outputType: undefined extends Types['output'] ? T['outputType'] : Types['output'];
1272
- queryType: undefined extends Types['query'] ? T['queryType'] : Types['query'];
1351
+ __inputType: undefined extends Types['input'] ? T['__inputType'] : Types['input'];
1352
+ __outputType: undefined extends Types['output'] ? T['__outputType'] : Types['output'];
1353
+ __queryType: undefined extends Types['query'] ? T['__queryType'] : Types['query'];
1273
1354
  }) => Types): { [K in keyof T]: K extends keyof Types ? Types[K] : T[K] };
1274
- dateAsNumber<T extends Column>(this: T): Column.Modifiers.Parse<T, unknown, number>;
1275
- dateAsDate<T extends Column>(this: T): Column.Modifiers.Parse<T, unknown, Date>;
1355
+ dateAsNumber<T extends Column.Pick.ForParse>(this: T): Column.Modifiers.Parse<T, unknown, number>;
1356
+ dateAsDate<T extends Column.Pick.ForParse>(this: T): Column.Modifiers.Parse<T, unknown, Date>;
1276
1357
  enum<const T extends readonly [string, ...string[]]>(dataType: string, type: T): EnumColumn<DefaultSchemaConfig, unknown, T>;
1277
1358
  array<Item extends ArrayColumnValue>(item: Item): ArrayColumn<DefaultSchemaConfig, Item, unknown, unknown, unknown>;
1278
1359
  json<T>(): JSONColumn<unknown extends T ? MaybeArray<string | number | boolean | object> : T, DefaultSchemaConfig>;
1360
+ jsonText<T>(): JSONTextColumn<unknown extends T ? MaybeArray<string | number | boolean | object> : T, DefaultSchemaConfig>;
1279
1361
  inputSchema(): undefined;
1280
1362
  outputSchema(): undefined;
1281
1363
  querySchema(): undefined;
@@ -1302,8 +1384,16 @@ interface DefaultSchemaConfig extends ColumnSchemaConfig<Column> {
1302
1384
  declare const defaultSchemaConfig: (options?: AdapterSchemaConfigOptions) => DefaultSchemaConfig;
1303
1385
  declare const internalSchemaConfig: DefaultSchemaConfig;
1304
1386
  type TextColumnData = StringData;
1305
- declare abstract class TextBaseColumn<Schema extends ColumnSchemaConfig, Ops = OperatorsText> extends Column<Schema, string, ReturnType<Schema['stringSchema']>, Ops> {
1387
+ declare abstract class TextBaseColumn<Schema extends ColumnSchemaConfig, Ops = OperatorsText> extends Column {
1388
+ __schema: Schema;
1389
+ __type: string;
1390
+ __inputType: string;
1391
+ inputSchema: ReturnType<Schema['stringSchema']>;
1306
1392
  data: TextColumnData;
1393
+ __outputType: string;
1394
+ outputSchema: ReturnType<Schema['stringSchema']>;
1395
+ __queryType: string;
1396
+ querySchema: ReturnType<Schema['stringSchema']>;
1307
1397
  operators: Ops;
1308
1398
  constructor(schema: Schema, schemaType?: ReturnType<Schema['stringSchema']>);
1309
1399
  }
@@ -1329,93 +1419,206 @@ declare class TextColumn<Schema extends ColumnSchemaConfig> extends TextBaseColu
1329
1419
  minArg?: number;
1330
1420
  maxArg?: number;
1331
1421
  };
1422
+ querySchema: ReturnType<Schema['stringSchema']>;
1332
1423
  operators: OperatorsOrdinalText;
1333
1424
  private static _instance;
1334
1425
  static get instance(): TextColumn<DefaultSchemaConfig>;
1335
1426
  constructor(schema: Schema);
1336
1427
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1337
1428
  }
1338
- declare class ByteaColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, string, ReturnType<Schema['buffer']>, OperatorsOrdinalText, Buffer, Buffer, ReturnType<Schema['buffer']>, string, ReturnType<Schema['stringSchema']>> {
1429
+ declare class ByteaColumn<Schema extends ColumnSchemaConfig> extends Column {
1430
+ __schema: Schema;
1339
1431
  dataType: "bytea";
1340
1432
  operators: OperatorsOrdinalText;
1433
+ __type: string;
1434
+ __inputType: Buffer;
1435
+ inputSchema: ReturnType<Schema['buffer']>;
1436
+ __outputType: Buffer;
1437
+ outputSchema: ReturnType<Schema['buffer']>;
1438
+ __queryType: string;
1439
+ querySchema: ReturnType<Schema['stringSchema']>;
1341
1440
  constructor(schema: Schema);
1342
1441
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1343
1442
  }
1344
- declare class PointColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
1443
+ declare class PointColumn<Schema extends ColumnSchemaConfig> extends Column {
1444
+ __schema: Schema;
1345
1445
  dataType: "point";
1446
+ __type: string;
1447
+ __inputType: string;
1448
+ inputSchema: ReturnType<Schema['stringSchema']>;
1449
+ __outputType: string;
1450
+ outputSchema: ReturnType<Schema['stringSchema']>;
1451
+ __queryType: string;
1452
+ querySchema: ReturnType<Schema['stringSchema']>;
1346
1453
  operators: OperatorsText;
1347
1454
  constructor(schema: Schema);
1348
1455
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1349
1456
  }
1350
- declare class LineColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
1457
+ declare class LineColumn<Schema extends ColumnSchemaConfig> extends Column {
1458
+ __schema: Schema;
1351
1459
  dataType: "line";
1460
+ __type: string;
1461
+ __inputType: string;
1462
+ inputSchema: ReturnType<Schema['stringSchema']>;
1463
+ __outputType: string;
1464
+ outputSchema: ReturnType<Schema['stringSchema']>;
1465
+ __queryType: string;
1466
+ querySchema: ReturnType<Schema['stringSchema']>;
1352
1467
  operators: OperatorsText;
1353
1468
  constructor(schema: Schema);
1354
1469
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1355
1470
  }
1356
- declare class LsegColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
1471
+ declare class LsegColumn<Schema extends ColumnSchemaConfig> extends Column {
1472
+ __schema: Schema;
1357
1473
  dataType: "lseg";
1474
+ __type: string;
1475
+ __inputType: string;
1476
+ inputSchema: ReturnType<Schema['stringSchema']>;
1477
+ __outputType: string;
1478
+ outputSchema: ReturnType<Schema['stringSchema']>;
1479
+ __queryType: string;
1480
+ querySchema: ReturnType<Schema['stringSchema']>;
1358
1481
  operators: OperatorsText;
1359
1482
  constructor(schema: Schema);
1360
1483
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1361
1484
  }
1362
- declare class BoxColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
1485
+ declare class BoxColumn<Schema extends ColumnSchemaConfig> extends Column {
1486
+ __schema: Schema;
1363
1487
  dataType: "box";
1488
+ __type: string;
1489
+ __inputType: string;
1490
+ inputSchema: ReturnType<Schema['stringSchema']>;
1491
+ __outputType: string;
1492
+ outputSchema: ReturnType<Schema['stringSchema']>;
1493
+ __queryType: string;
1494
+ querySchema: ReturnType<Schema['stringSchema']>;
1364
1495
  operators: OperatorsText;
1365
1496
  constructor(schema: Schema);
1366
1497
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1367
1498
  }
1368
- declare class PathColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
1499
+ declare class PathColumn<Schema extends ColumnSchemaConfig> extends Column {
1500
+ __schema: Schema;
1369
1501
  dataType: "path";
1502
+ __type: string;
1503
+ __inputType: string;
1504
+ inputSchema: ReturnType<Schema['stringSchema']>;
1505
+ __outputType: string;
1506
+ outputSchema: ReturnType<Schema['stringSchema']>;
1507
+ __queryType: string;
1508
+ querySchema: ReturnType<Schema['stringSchema']>;
1370
1509
  operators: OperatorsText;
1371
1510
  constructor(schema: Schema);
1372
1511
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1373
1512
  }
1374
- declare class PolygonColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
1513
+ declare class PolygonColumn<Schema extends ColumnSchemaConfig> extends Column {
1514
+ __schema: Schema;
1375
1515
  dataType: "polygon";
1516
+ __type: string;
1517
+ __inputType: string;
1518
+ inputSchema: ReturnType<Schema['stringSchema']>;
1519
+ __outputType: string;
1520
+ outputSchema: ReturnType<Schema['stringSchema']>;
1521
+ __queryType: string;
1522
+ querySchema: ReturnType<Schema['stringSchema']>;
1376
1523
  operators: OperatorsText;
1377
1524
  constructor(schema: Schema);
1378
1525
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1379
1526
  }
1380
- declare class CircleColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
1527
+ declare class CircleColumn<Schema extends ColumnSchemaConfig> extends Column {
1528
+ __schema: Schema;
1381
1529
  dataType: "circle";
1530
+ __type: string;
1531
+ __inputType: string;
1532
+ inputSchema: ReturnType<Schema['stringSchema']>;
1533
+ __outputType: string;
1534
+ outputSchema: ReturnType<Schema['stringSchema']>;
1535
+ __queryType: string;
1536
+ querySchema: ReturnType<Schema['stringSchema']>;
1382
1537
  operators: OperatorsText;
1383
1538
  constructor(schema: Schema);
1384
1539
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1385
1540
  }
1386
- declare class MoneyColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, string, ReturnType<Schema['number']>, OperatorsNumber, string | number, number, ReturnType<Schema['number']>, string | number> {
1541
+ declare class MoneyColumn<Schema extends ColumnSchemaConfig> extends Column {
1542
+ __schema: Schema;
1387
1543
  dataType: "money";
1544
+ __type: string;
1388
1545
  data: NumberColumnData;
1546
+ __inputType: string | number;
1547
+ inputSchema: ReturnType<Schema['number']>;
1548
+ __outputType: number;
1549
+ outputSchema: ReturnType<Schema['number']>;
1550
+ __queryType: string | number;
1551
+ querySchema: ReturnType<Schema['number']>;
1389
1552
  operators: OperatorsNumber;
1390
1553
  constructor(schema: Schema);
1391
1554
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1392
1555
  }
1393
- declare class CidrColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
1556
+ declare class CidrColumn<Schema extends ColumnSchemaConfig> extends Column {
1557
+ __schema: Schema;
1394
1558
  dataType: "cidr";
1559
+ __type: string;
1560
+ __inputType: string;
1561
+ inputSchema: ReturnType<Schema['stringSchema']>;
1562
+ __outputType: string;
1563
+ outputSchema: ReturnType<Schema['stringSchema']>;
1564
+ __queryType: string;
1565
+ querySchema: ReturnType<Schema['stringSchema']>;
1395
1566
  operators: OperatorsText;
1396
1567
  constructor(schema: Schema);
1397
1568
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1398
1569
  }
1399
- declare class InetColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsOrdinalText> {
1570
+ declare class InetColumn<Schema extends ColumnSchemaConfig> extends Column {
1571
+ __schema: Schema;
1400
1572
  dataType: "inet";
1573
+ __type: string;
1574
+ __inputType: string;
1575
+ inputSchema: ReturnType<Schema['stringSchema']>;
1576
+ __outputType: string;
1577
+ outputSchema: ReturnType<Schema['stringSchema']>;
1578
+ __queryType: string;
1579
+ querySchema: ReturnType<Schema['stringSchema']>;
1401
1580
  operators: OperatorsOrdinalText;
1402
1581
  constructor(schema: Schema);
1403
1582
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1404
1583
  }
1405
- declare class MacAddrColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsOrdinalText> {
1584
+ declare class MacAddrColumn<Schema extends ColumnSchemaConfig> extends Column {
1585
+ __schema: Schema;
1406
1586
  dataType: "macaddr";
1587
+ __type: string;
1588
+ __inputType: string;
1589
+ inputSchema: ReturnType<Schema['stringSchema']>;
1590
+ __outputType: string;
1591
+ outputSchema: ReturnType<Schema['stringSchema']>;
1592
+ __queryType: string;
1593
+ querySchema: ReturnType<Schema['stringSchema']>;
1407
1594
  operators: OperatorsOrdinalText;
1408
1595
  constructor(schema: Schema);
1409
1596
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1410
1597
  }
1411
- declare class MacAddr8Column<Schema extends ColumnSchemaConfig> extends Column<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsOrdinalText> {
1598
+ declare class MacAddr8Column<Schema extends ColumnSchemaConfig> extends Column {
1599
+ __schema: Schema;
1412
1600
  dataType: "macaddr8";
1601
+ __type: string;
1602
+ __inputType: string;
1603
+ inputSchema: ReturnType<Schema['stringSchema']>;
1604
+ __outputType: string;
1605
+ outputSchema: ReturnType<Schema['stringSchema']>;
1606
+ __queryType: string;
1607
+ querySchema: ReturnType<Schema['stringSchema']>;
1413
1608
  operators: OperatorsOrdinalText;
1414
1609
  constructor(schema: Schema);
1415
1610
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1416
1611
  }
1417
- declare class BitColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, string, ReturnType<Schema['bit']>, OperatorsOrdinalText> {
1612
+ declare class BitColumn<Schema extends ColumnSchemaConfig> extends Column {
1613
+ __schema: Schema;
1418
1614
  dataType: "bit";
1615
+ __type: string;
1616
+ __inputType: string;
1617
+ inputSchema: ReturnType<Schema['bit']>;
1618
+ __outputType: string;
1619
+ outputSchema: ReturnType<Schema['bit']>;
1620
+ __queryType: string;
1621
+ querySchema: ReturnType<Schema['bit']>;
1419
1622
  operators: OperatorsOrdinalText;
1420
1623
  data: Column.Data & {
1421
1624
  length: number;
@@ -1424,8 +1627,16 @@ declare class BitColumn<Schema extends ColumnSchemaConfig> extends Column<Schema
1424
1627
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1425
1628
  toSQL(): string;
1426
1629
  }
1427
- declare class BitVaryingColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, string, ReturnType<Schema['bit']>, OperatorsOrdinalText> {
1630
+ declare class BitVaryingColumn<Schema extends ColumnSchemaConfig> extends Column {
1631
+ __schema: Schema;
1428
1632
  dataType: "varbit";
1633
+ __type: string;
1634
+ __inputType: string;
1635
+ inputSchema: ReturnType<Schema['bit']>;
1636
+ __outputType: string;
1637
+ outputSchema: ReturnType<Schema['bit']>;
1638
+ __queryType: string;
1639
+ querySchema: ReturnType<Schema['bit']>;
1429
1640
  operators: OperatorsOrdinalText;
1430
1641
  data: Column.Data & {
1431
1642
  length?: number;
@@ -1435,9 +1646,17 @@ declare class BitVaryingColumn<Schema extends ColumnSchemaConfig> extends Column
1435
1646
  toSQL(): string;
1436
1647
  }
1437
1648
  type TsVectorGeneratedColumns = string[] | SearchWeightRecord;
1438
- declare class TsVectorColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsOrdinalText> {
1649
+ declare class TsVectorColumn<Schema extends ColumnSchemaConfig> extends Column {
1439
1650
  defaultLanguage: string;
1651
+ __schema: Schema;
1440
1652
  dataType: "tsvector";
1653
+ __type: string;
1654
+ __inputType: string;
1655
+ inputSchema: ReturnType<Schema['stringSchema']>;
1656
+ __outputType: string;
1657
+ outputSchema: ReturnType<Schema['stringSchema']>;
1658
+ __queryType: string;
1659
+ querySchema: ReturnType<Schema['stringSchema']>;
1441
1660
  operators: OperatorsOrdinalText;
1442
1661
  constructor(schema: Schema, defaultLanguage?: string);
1443
1662
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
@@ -1467,14 +1686,30 @@ declare class TsVectorColumn<Schema extends ColumnSchemaConfig> extends Column<S
1467
1686
  */
1468
1687
  generated<T extends Column.Pick.Data>(this: T, ...args: StaticSQLArgs | [language: string, columns: TsVectorGeneratedColumns] | [columns: TsVectorGeneratedColumns]): Column.Modifiers.Generated<T>;
1469
1688
  }
1470
- declare class TsQueryColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsOrdinalText> {
1689
+ declare class TsQueryColumn<Schema extends ColumnSchemaConfig> extends Column {
1690
+ __schema: Schema;
1471
1691
  dataType: "tsquery";
1692
+ __type: string;
1693
+ __inputType: string;
1694
+ inputSchema: ReturnType<Schema['stringSchema']>;
1695
+ __outputType: string;
1696
+ outputSchema: ReturnType<Schema['stringSchema']>;
1697
+ __queryType: string;
1698
+ querySchema: ReturnType<Schema['stringSchema']>;
1472
1699
  operators: OperatorsOrdinalText;
1473
1700
  constructor(schema: Schema);
1474
1701
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1475
1702
  }
1476
- declare class UUIDColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, string, ReturnType<Schema['uuid']>, OperatorsOrdinalText> {
1703
+ declare class UUIDColumn<Schema extends ColumnSchemaConfig> extends Column {
1704
+ __schema: Schema;
1477
1705
  dataType: "uuid";
1706
+ __type: string;
1707
+ __inputType: string;
1708
+ inputSchema: ReturnType<Schema['uuid']>;
1709
+ __outputType: string;
1710
+ outputSchema: ReturnType<Schema['uuid']>;
1711
+ __queryType: string;
1712
+ querySchema: ReturnType<Schema['uuid']>;
1478
1713
  operators: OperatorsOrdinalText;
1479
1714
  constructor(schema: Schema);
1480
1715
  /**
@@ -1489,8 +1724,16 @@ declare class UUIDColumn<Schema extends ColumnSchemaConfig> extends Column<Schem
1489
1724
  };
1490
1725
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1491
1726
  }
1492
- declare class XMLColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
1727
+ declare class XMLColumn<Schema extends ColumnSchemaConfig> extends Column {
1728
+ __schema: Schema;
1493
1729
  dataType: "xml";
1730
+ __type: string;
1731
+ __inputType: string;
1732
+ inputSchema: ReturnType<Schema['stringSchema']>;
1733
+ __outputType: string;
1734
+ outputSchema: ReturnType<Schema['stringSchema']>;
1735
+ __queryType: string;
1736
+ querySchema: ReturnType<Schema['stringSchema']>;
1494
1737
  operators: OperatorsText;
1495
1738
  private static _instance;
1496
1739
  static get instance(): XMLColumn<DefaultSchemaConfig>;
@@ -1498,18 +1741,28 @@ declare class XMLColumn<Schema extends ColumnSchemaConfig> extends Column<Schema
1498
1741
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1499
1742
  }
1500
1743
  declare class CitextColumn<Schema extends ColumnSchemaConfig> extends TextBaseColumn<Schema, OperatorsOrdinalText> {
1744
+ __schema: Schema;
1501
1745
  dataType: "citext";
1502
1746
  data: TextColumnData & {
1503
1747
  minArg?: number;
1504
1748
  maxArg?: number;
1505
1749
  };
1750
+ querySchema: ReturnType<Schema['stringSchema']>;
1506
1751
  operators: OperatorsOrdinalText;
1507
1752
  constructor(schema: Schema);
1508
1753
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1509
1754
  }
1510
- declare class BooleanColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, boolean, ReturnType<Schema['boolean']>, OperatorsBoolean> {
1755
+ declare class BooleanColumn<Schema extends ColumnSchemaConfig> extends Column {
1756
+ __schema: Schema;
1511
1757
  dataType: "bool";
1512
1758
  operators: OperatorsBoolean;
1759
+ __type: boolean;
1760
+ __inputType: boolean;
1761
+ inputSchema: ReturnType<Schema['boolean']>;
1762
+ __outputType: boolean;
1763
+ outputSchema: ReturnType<Schema['boolean']>;
1764
+ __queryType: boolean;
1765
+ querySchema: ReturnType<Schema['boolean']>;
1513
1766
  private static _instance;
1514
1767
  static get instance(): BooleanColumn<DefaultSchemaConfig>;
1515
1768
  constructor(schema: Schema);
@@ -1533,20 +1786,29 @@ interface TimestampHelpers {
1533
1786
  timestampNoTZ(): T;
1534
1787
  }): Timestamps<T>;
1535
1788
  }
1536
- declare class CustomTypeColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, unknown, ReturnType<Schema['unknown']>, OperatorsAny> {
1789
+ declare class CustomTypeColumn<Schema extends ColumnSchemaConfig> extends Column {
1537
1790
  typeName: string;
1538
1791
  typeSchema?: string | undefined;
1792
+ __schema: Schema;
1539
1793
  operators: OperatorsAny;
1794
+ __type: unknown;
1795
+ __inputType: unknown;
1796
+ inputSchema: ReturnType<Schema['unknown']>;
1797
+ __outputType: unknown;
1798
+ outputSchema: ReturnType<Schema['unknown']>;
1799
+ __queryType: unknown;
1800
+ querySchema: ReturnType<Schema['unknown']>;
1801
+ data: Column.Data;
1540
1802
  dataType: string;
1541
1803
  constructor(schema: Schema, typeName: string, typeSchema?: string | undefined, extension?: string);
1542
1804
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1543
1805
  as<T extends {
1544
- inputType: unknown;
1545
- outputType: unknown;
1806
+ __inputType: unknown;
1807
+ __outputType: unknown;
1546
1808
  data: Column.Data;
1547
1809
  }, C extends {
1548
- inputType: T['inputType'];
1549
- outputType: T['outputType'];
1810
+ __inputType: T['__inputType'];
1811
+ __outputType: T['__outputType'];
1550
1812
  }>(this: T, column: C): C;
1551
1813
  }
1552
1814
  declare class DomainColumn<Schema extends ColumnSchemaConfig> extends CustomTypeColumn<Schema> {
@@ -1557,8 +1819,16 @@ interface PostgisPoint {
1557
1819
  lat: number;
1558
1820
  srid?: number;
1559
1821
  }
1560
- declare class PostgisGeographyPointColumn<Schema extends ColumnSchemaConfig> extends Column<Schema, PostgisPoint, ReturnType<Schema['geographyPointSchema']>, OperatorsAny> {
1822
+ declare class PostgisGeographyPointColumn<Schema extends ColumnSchemaConfig> extends Column {
1823
+ __schema: Schema;
1561
1824
  dataType: string;
1825
+ __type: PostgisPoint;
1826
+ __inputType: PostgisPoint;
1827
+ inputSchema: ReturnType<Schema['geographyPointSchema']>;
1828
+ __outputType: PostgisPoint;
1829
+ outputSchema: ReturnType<Schema['geographyPointSchema']>;
1830
+ __queryType: PostgisPoint;
1831
+ querySchema: ReturnType<Schema['geographyPointSchema']>;
1562
1832
  operators: OperatorsAny;
1563
1833
  static encode: ({
1564
1834
  srid,
@@ -1617,7 +1887,7 @@ interface DefaultColumnTypes<SchemaConfig extends ColumnSchemaConfig> extends Ti
1617
1887
  uuid(): UUIDColumn<SchemaConfig>;
1618
1888
  xml(): XMLColumn<SchemaConfig>;
1619
1889
  json: SchemaConfig['json'];
1620
- jsonText(): JSONTextColumn<SchemaConfig>;
1890
+ jsonText: SchemaConfig['jsonText'];
1621
1891
  type(dataType: string): CustomTypeColumn<SchemaConfig>;
1622
1892
  domain(dataType: string): DomainColumn<SchemaConfig>;
1623
1893
  geography: {
@@ -1700,8 +1970,8 @@ interface QueryThen<T> {
1700
1970
  type QueryThenShallowSimplify<T> = QueryThen<ShallowSimplify<T>>;
1701
1971
  type QueryThenShallowSimplifyArr<T> = QueryThen<ShallowSimplify<T>[]>;
1702
1972
  type QueryThenShallowSimplifyOptional<T> = QueryThen<ShallowSimplify<T> | undefined>;
1703
- type QueryThenByQuery<T extends PickQueryReturnType, Result extends Column.QueryColumns> = T['returnType'] extends undefined | 'all' ? QueryThenShallowSimplifyArr<ColumnsShape.Output<Result>> : T['returnType'] extends 'one' ? QueryThenShallowSimplifyOptional<ColumnsShape.Output<Result>> : T['returnType'] extends 'oneOrThrow' ? QueryThenShallowSimplify<ColumnsShape.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.Output<Result>[keyof Result][][]> : T['returnType'] extends 'pluck' ? QueryThen<Result['pluck']['outputType'][]> : QueryThen<void>;
1704
- type QueryThenByReturnType<T extends QueryReturnType, Result extends Column.QueryColumns> = T extends undefined | 'all' ? QueryThenShallowSimplifyArr<ColumnsShape.Output<Result>> : T extends 'one' ? QueryThenShallowSimplifyOptional<ColumnsShape.Output<Result>> : T extends 'oneOrThrow' ? QueryThenShallowSimplify<ColumnsShape.Output<Result>> : T extends 'value' ? QueryThen<Result['value']['outputType'] | undefined> : T extends 'valueOrThrow' ? QueryThen<Result['value']['outputType']> : T extends 'rows' ? QueryThen<ColumnsShape.Output<Result>[keyof Result][][]> : T extends 'pluck' ? QueryThen<Result['pluck']['outputType'][]> : QueryThen<void>;
1973
+ type QueryThenByQuery<T extends PickQueryReturnType, Result extends Column.QueryColumns> = T['returnType'] extends undefined | 'all' ? QueryThenShallowSimplifyArr<ColumnsShape.Output<Result>> : T['returnType'] extends 'one' ? QueryThenShallowSimplifyOptional<ColumnsShape.Output<Result>> : T['returnType'] extends 'oneOrThrow' ? QueryThenShallowSimplify<ColumnsShape.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.Output<Result>[keyof Result][][]> : T['returnType'] extends 'pluck' ? QueryThen<Result['pluck']['__outputType'][]> : QueryThen<void>;
1974
+ type QueryThenByReturnType<T extends QueryReturnType, Result extends Column.QueryColumns> = T extends undefined | 'all' ? QueryThenShallowSimplifyArr<ColumnsShape.Output<Result>> : T extends 'one' ? QueryThenShallowSimplifyOptional<ColumnsShape.Output<Result>> : T extends 'oneOrThrow' ? QueryThenShallowSimplify<ColumnsShape.Output<Result>> : T extends 'value' ? QueryThen<Result['value']['__outputType'] | undefined> : T extends 'valueOrThrow' ? QueryThen<Result['value']['__outputType']> : T extends 'rows' ? QueryThen<ColumnsShape.Output<Result>[keyof Result][][]> : T extends 'pluck' ? QueryThen<Result['pluck']['__outputType'][]> : QueryThen<void>;
1705
1975
  interface QueryCatch {
1706
1976
  <Q, TResult = never>(this: {
1707
1977
  then: (onfulfilled?: (value: Q) => any) => any;
@@ -2595,7 +2865,7 @@ declare namespace Order {
2595
2865
  export type Arg<T extends ArgThis> = ArgKey<T> | ArgTsQuery<T> | { [K in ArgKey<T> | ArgTsQuery<T>]?: K extends ArgTsQuery<T> ? OrderTsQueryConfig : SortDir } | Expression;
2596
2866
  export type Args<T extends ArgThis> = Arg<T>[];
2597
2867
  type ArgTsQuery<T extends ArgThis> = string | undefined extends T['__tsQuery'] ? never : Exclude<T['__tsQuery'], undefined>;
2598
- 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']];
2868
+ 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']];
2599
2869
  export {};
2600
2870
  }
2601
2871
  declare class QueryOrder {
@@ -2701,40 +2971,40 @@ interface ColumnsShape {
2701
2971
  }
2702
2972
  declare namespace ColumnsShape {
2703
2973
  export type DefaultSelectKeys<S extends Column.QueryColumnsInit> = { [K in keyof S]: S[K]['data']['explicitSelect'] extends true | undefined ? never : K }[keyof S];
2704
- export type DefaultOutput<Set extends Column.QueryColumnsInit> = { [K in DefaultSelectKeys<Set>]: Set[K]['outputType'] };
2705
- export type Input<Shape extends Column.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'] };
2706
- export type InputPartial<Shape extends Column.QueryColumnsInit> = { [K in keyof Shape]?: Shape[K]['inputType'] };
2707
- export type Output<Shape extends Column.QueryColumns> = { [K in keyof Shape]: Shape[K]['outputType'] };
2708
- export type DefaultSelectOutput<Shape extends Column.QueryColumnsInit> = { [K in { [K in keyof Shape]: Shape[K]['data']['explicitSelect'] extends true | undefined ? never : K }[keyof Shape]]: Shape[K]['outputType'] };
2974
+ export type DefaultOutput<Set extends Column.QueryColumnsInit> = { [K in DefaultSelectKeys<Set>]: Set[K]['__outputType'] };
2975
+ export type Input<Shape extends Column.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'] };
2976
+ export type InputPartial<Shape extends Column.QueryColumnsInit> = { [K in keyof Shape]?: Shape[K]['__inputType'] };
2977
+ export type Output<Shape extends Column.QueryColumns> = { [K in keyof Shape]: Shape[K]['__outputType'] };
2978
+ export type DefaultSelectOutput<Shape extends Column.QueryColumnsInit> = { [K in { [K in keyof Shape]: Shape[K]['data']['explicitSelect'] extends true | undefined ? never : K }[keyof Shape]]: Shape[K]['__outputType'] };
2709
2979
  export interface MapToObjectColumn<Shape extends Column.QueryColumns> {
2710
2980
  dataType: 'object';
2711
- type: { [K in keyof Shape]: Shape[K]['type'] };
2712
- outputType: ShallowSimplify<ObjectOutput<Shape>>;
2713
- queryType: { [K in keyof Shape]: Shape[K]['queryType'] };
2981
+ __type: { [K in keyof Shape]: Shape[K]['__type'] };
2982
+ __outputType: ShallowSimplify<ObjectOutput<Shape>>;
2983
+ __queryType: { [K in keyof Shape]: Shape[K]['__queryType'] };
2714
2984
  operators: OperatorsAny;
2715
2985
  }
2716
2986
  export interface MapToNullableObjectColumn<Shape extends Column.QueryColumns> {
2717
2987
  dataType: 'object';
2718
- type: { [K in keyof Shape]: Shape[K]['type'] };
2719
- outputType: ShallowSimplify<ObjectOutput<Shape>> | undefined;
2720
- queryType: { [K in keyof Shape]: Shape[K]['queryType'] } | null;
2988
+ __type: { [K in keyof Shape]: Shape[K]['__type'] };
2989
+ __outputType: ShallowSimplify<ObjectOutput<Shape>> | undefined;
2990
+ __queryType: { [K in keyof Shape]: Shape[K]['__queryType'] } | null;
2721
2991
  operators: OperatorsAny;
2722
2992
  }
2723
2993
  export interface MapToPluckColumn<Shape extends Column.QueryColumns> {
2724
2994
  dataType: 'array';
2725
- type: Shape['pluck']['type'][];
2726
- outputType: Shape['pluck']['outputType'][];
2727
- queryType: Shape['pluck']['queryType'][];
2995
+ __type: Shape['pluck']['__type'][];
2996
+ __outputType: Shape['pluck']['__outputType'][];
2997
+ __queryType: Shape['pluck']['__queryType'][];
2728
2998
  operators: OperatorsAny;
2729
2999
  }
2730
3000
  export interface MapToObjectArrayColumn<Shape extends Column.QueryColumns> {
2731
3001
  dataType: 'array';
2732
- type: { [K in keyof Shape]: Shape[K]['type'] }[];
2733
- outputType: ShallowSimplify<ObjectOutput<Shape>>[];
2734
- queryType: { [K in keyof Shape]: Shape[K]['queryType'] }[];
3002
+ __type: { [K in keyof Shape]: Shape[K]['__type'] }[];
3003
+ __outputType: ShallowSimplify<ObjectOutput<Shape>>[];
3004
+ __queryType: { [K in keyof Shape]: Shape[K]['__queryType'] }[];
2735
3005
  operators: OperatorsAny;
2736
3006
  }
2737
- type ObjectOutput<Shape extends Column.QueryColumns> = { [K in keyof Shape]: Shape[K]['outputType'] };
3007
+ type ObjectOutput<Shape extends Column.QueryColumns> = { [K in keyof Shape]: Shape[K]['__outputType'] };
2738
3008
  export {};
2739
3009
  }
2740
3010
  interface SelectSelf extends PickQuerySelectable, PickQueryHasSelect, PickQueryDefaultSelect, PickQueryShape, PickQueryRelations, PickQueryResult, PickQueryReturnType, PickQueryWithData {}
@@ -3162,16 +3432,16 @@ interface OperatorsCount extends OperatorsNumber {
3162
3432
  type CountColumn = Column.Pick.QueryColumnOfTypeAndOps<'int8', number, OperatorsCount>;
3163
3433
  type CountReturn<T> = SetQueryReturnsColumnOrThrow<T, CountColumn> & OperatorsCount;
3164
3434
  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<Column.Pick.QueryColumnOfDataType<DataType>>;
3165
- type NumericReturn<T extends PickQuerySelectable, Arg> = Arg extends keyof T['__selectable'] ? SetQueryReturnsColumnOrThrow<T, Column.Pick.QueryColumnOfTypeAndOps<T['__selectable'][Arg]['column']['dataType'], T['__selectable'][Arg]['column']['type'] | null, OperatorsNumber>> & OperatorsNumber : Arg extends Expression ? SetQueryReturnsColumnOrThrow<T, Column.Pick.QueryColumnOfTypeAndOps<Arg['result']['value']['dataType'], Arg['result']['value']['type'] | null, OperatorsNumber>> & OperatorsNumber : never;
3435
+ type NumericReturn<T extends PickQuerySelectable, Arg> = Arg extends keyof T['__selectable'] ? SetQueryReturnsColumnOrThrow<T, Column.Pick.QueryColumnOfTypeAndOps<T['__selectable'][Arg]['column']['dataType'], T['__selectable'][Arg]['column']['__type'] | null, OperatorsNumber>> & OperatorsNumber : Arg extends Expression ? SetQueryReturnsColumnOrThrow<T, Column.Pick.QueryColumnOfTypeAndOps<Arg['result']['value']['dataType'], Arg['result']['value']['__type'] | null, OperatorsNumber>> & OperatorsNumber : never;
3166
3436
  type NullableNumberReturn<T, DataType> = SetQueryReturnsColumnOrThrow<T, Column.Pick.QueryColumnOfTypeAndOps<DataType, number | null, OperatorsNumber>> & OperatorsNumber;
3167
3437
  type BooleanQueryColumn = Column.Pick.QueryColumnOfTypeAndOps<'bool', boolean, OperatorsBoolean>;
3168
3438
  type BooleanNullable = Column.Pick.QueryColumnOfTypeAndOps<'bool', boolean | null, OperatorsBoolean>;
3169
3439
  type NullableBooleanReturn<T> = SetQueryReturnsColumnOrThrow<T, BooleanNullable> & OperatorsBoolean;
3170
3440
  type NullableJSONAggReturn<T extends PickQuerySelectable, Arg extends SelectableOrExpression<T>> = SetQueryReturnsColumnOrThrow<T, {
3171
3441
  dataType: 'json';
3172
- type: (ExpressionOutput<T, Arg>['type'] | null)[] | null;
3173
- outputType: (ExpressionOutput<T, Arg>['outputType'] | null)[] | null;
3174
- queryType: (ExpressionOutput<T, Arg>['queryType'] | null)[] | null;
3442
+ __type: (ExpressionOutput<T, Arg>['__type'] | null)[] | null;
3443
+ __outputType: (ExpressionOutput<T, Arg>['__outputType'] | null)[] | null;
3444
+ __queryType: (ExpressionOutput<T, Arg>['__queryType'] | null)[] | null;
3175
3445
  operators: OperatorsArray<never>;
3176
3446
  }> & OperatorsArray<never>;
3177
3447
  interface RecordSelectableOrExpression<T extends PickQuerySelectable> {
@@ -3179,9 +3449,9 @@ interface RecordSelectableOrExpression<T extends PickQuerySelectable> {
3179
3449
  }
3180
3450
  type NullableJSONObjectReturn<T extends PickQuerySelectable, Obj extends RecordSelectableOrExpression<T>> = SetQueryReturnsColumnOrThrow<T, {
3181
3451
  dataType: 'json';
3182
- type: { [K in keyof Obj]: ExpressionOutput<T, Obj[K]>['type'] } | null;
3183
- outputType: { [K in keyof Obj]: ExpressionOutput<T, Obj[K]>['outputType'] } | null;
3184
- queryType: { [K in keyof Obj]: ExpressionOutput<T, Obj[K]>['queryType'] } | null;
3452
+ __type: { [K in keyof Obj]: ExpressionOutput<T, Obj[K]>['__type'] } | null;
3453
+ __outputType: { [K in keyof Obj]: ExpressionOutput<T, Obj[K]>['__outputType'] } | null;
3454
+ __queryType: { [K in keyof Obj]: ExpressionOutput<T, Obj[K]>['__queryType'] } | null;
3185
3455
  operators: OperatorsAny;
3186
3456
  }> & OperatorsAny;
3187
3457
  type StringColumn$1 = Column.Pick.QueryColumnOfTypeAndOps<string, string, OperatorsText>;
@@ -3618,11 +3888,11 @@ declare class OrExpression extends Expression<BooleanQueryColumn> {
3618
3888
  interface QueryReturnsFnAdd<T extends PickQueryColumTypes> extends PickQueryHasSelect {
3619
3889
  type<C extends Column.Pick.QueryColumn>(fn: (types: T['columnTypes']) => C): { [K in keyof T]: K extends 'result' ? {
3620
3890
  value: C;
3621
- } : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<C['outputType']> : T[K] } & C['operators'];
3891
+ } : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<C['__outputType']> : T[K] } & C['operators'];
3622
3892
  }
3623
3893
  type SetQueryReturnsFn<T extends PickQueryColumTypes, C extends Column.Pick.OutputType> = { [K in keyof T]: K extends 'result' ? {
3624
3894
  value: C;
3625
- } : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<C['outputType']> : T[K] } & QueryReturnsFnAdd<T>;
3895
+ } : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<C['__outputType']> : T[K] } & QueryReturnsFnAdd<T>;
3626
3896
  declare class QueryExpressions {
3627
3897
  /**
3628
3898
  * `column` references a table column, this can be used in raw SQL or when building a column expression.
@@ -3715,16 +3985,16 @@ declare class QueryExpressions {
3715
3985
  type WhereArg<T extends PickQuerySelectableRelations> = { [K in keyof T['__selectable'] | 'NOT' | 'OR' | 'IN']?: K extends 'NOT' ? WhereArg<T> | WhereArgs<T> : K extends 'OR' ? (WhereArg<T> | WhereArgs<T>)[] : K extends 'IN' ? MaybeArray<{
3716
3986
  columns: (keyof T['__selectable'])[];
3717
3987
  values: unknown[][] | IsQuery | Expression;
3718
- }> : T['__selectable'][K]['column']['queryType'] | null | { [O in keyof T['__selectable'][K]['column']['operators']]?: T['__selectable'][K]['column']['operators'][O]['_opType'] } | {
3988
+ }> : T['__selectable'][K]['column']['__queryType'] | null | { [O in keyof T['__selectable'][K]['column']['operators']]?: T['__selectable'][K]['column']['operators'][O]['_opType'] } | {
3719
3989
  result: {
3720
3990
  value: {
3721
- queryType: T['__selectable'][K]['column']['queryType'] | null;
3991
+ __queryType: T['__selectable'][K]['column']['__queryType'] | null;
3722
3992
  };
3723
3993
  };
3724
3994
  } | ((q: T) => {
3725
3995
  result: {
3726
3996
  value: {
3727
- queryType: T['__selectable'][K]['column']['queryType'] | null;
3997
+ __queryType: T['__selectable'][K]['column']['__queryType'] | null;
3728
3998
  };
3729
3999
  };
3730
4000
  }) } | ((q: WhereQueryBuilder<T>) => QueryOrExpressionBooleanOrNullResult | WhereQueryBuilder<T>);
@@ -3740,12 +4010,12 @@ type WhereQueryBuilder<T extends PickQueryRelations> = EmptyObject extends T['re
3740
4010
  type WhereArgs<T extends PickQuerySelectableRelations> = WhereArg<T>[];
3741
4011
  type WhereNotArgs<T extends PickQuerySelectableRelations> = [WhereArg<T>];
3742
4012
  type WhereInColumn<T extends PickQuerySelectableRelations> = keyof T['__selectable'] | [keyof T['__selectable'], ...(keyof T['__selectable'])[]];
3743
- type WhereInValues<T extends PickQuerySelectableRelations, Column> = Column extends keyof T['__selectable'] ? Iterable<T['__selectable'][Column]['column']['queryType']> | IsQuery | Expression : ({ [I in keyof Column]: Column[I] extends keyof T['__selectable'] ? T['__selectable'][Column[I]]['column']['queryType'] : never } & {
4013
+ type WhereInValues<T extends PickQuerySelectableRelations, Column> = Column extends keyof T['__selectable'] ? Iterable<T['__selectable'][Column]['column']['__queryType']> | IsQuery | Expression : ({ [I in keyof Column]: Column[I] extends keyof T['__selectable'] ? T['__selectable'][Column[I]]['column']['__queryType'] : never } & {
3744
4014
  length: Column extends {
3745
4015
  length: number;
3746
4016
  } ? Column['length'] : never;
3747
4017
  })[] | IsQuery | Expression;
3748
- type WhereInArg<T extends PickQuerySelectableRelations> = { [K in keyof T['__selectable']]?: Iterable<T['__selectable'][K]['column']['queryType']> | IsQuery | Expression };
4018
+ type WhereInArg<T extends PickQuerySelectableRelations> = { [K in keyof T['__selectable']]?: Iterable<T['__selectable'][K]['column']['__queryType']> | IsQuery | Expression };
3749
4019
  interface QueryHasWhere {
3750
4020
  __hasWhere: true;
3751
4021
  }
@@ -4823,6 +5093,7 @@ interface QueryInternal<SinglePrimaryKey = any, UniqueColumns = any, UniqueColum
4823
5093
  comment?: string;
4824
5094
  readOnly?: boolean;
4825
5095
  materialized?: boolean;
5096
+ generatorIgnored?: true;
4826
5097
  primaryKeys?: string[];
4827
5098
  singlePrimaryKey: SinglePrimaryKey;
4828
5099
  uniqueColumns: UniqueColumns;
@@ -4837,6 +5108,7 @@ interface QueryInternal<SinglePrimaryKey = any, UniqueColumns = any, UniqueColum
4837
5108
  tableRls?: Rls.TableConfig;
4838
5109
  tableGrants?: Grant.TableClassGrant[];
4839
5110
  viewData?: {
5111
+ query?: Query;
4840
5112
  sql?: string | RawSqlBase;
4841
5113
  recursive?: boolean;
4842
5114
  checkOption?: 'LOCAL' | 'CASCADED';
@@ -4856,8 +5128,8 @@ interface QueryInternal<SinglePrimaryKey = any, UniqueColumns = any, UniqueColum
4856
5128
  */
4857
5129
  nestedCreateBatchMax: number;
4858
5130
  }
4859
- type ShapeColumnPrimaryKeys<Shape extends Column.QueryColumnsInit> = { [K in { [K in keyof Shape]: Shape[K]['data']['primaryKey'] extends string ? K : never }[keyof Shape]]: UniqueQueryTypeOrExpression<Shape[K]['queryType']> };
4860
- type ShapeUniqueColumns<Shape extends Column.QueryColumnsInit> = { [K in keyof Shape]: Shape[K]['data']['unique'] extends string ? { [C in K]: UniqueQueryTypeOrExpression<Shape[K]['queryType']> } : never }[keyof Shape];
5131
+ type ShapeColumnPrimaryKeys<Shape extends Column.QueryColumnsInit> = { [K in { [K in keyof Shape]: Shape[K]['data']['primaryKey'] extends string ? K : never }[keyof Shape]]: UniqueQueryTypeOrExpression<Shape[K]['__queryType']> };
5132
+ type ShapeUniqueColumns<Shape extends Column.QueryColumnsInit> = { [K in keyof Shape]: Shape[K]['data']['unique'] extends string ? { [C in K]: UniqueQueryTypeOrExpression<Shape[K]['__queryType']> } : never }[keyof Shape];
4861
5133
  type UniqueConstraints<Shape extends Column.QueryColumnsInit> = { [K in keyof Shape]: Shape[K]['data']['primaryKey'] extends string ? string extends Shape[K]['data']['primaryKey'] ? never : Shape[K]['data']['primaryKey'] : Shape[K]['data']['unique'] extends string ? string extends Shape[K]['data']['unique'] ? never : Shape[K]['data']['unique'] : never }[keyof Shape];
4862
5134
  type NoPrimaryKeyOption = 'error' | 'warning' | 'ignore';
4863
5135
  interface DbSharedOptions extends QueryLogOptions {
@@ -4928,6 +5200,10 @@ interface DbTableOptions<ColumnTypes, Table extends string | undefined, Shape ex
4928
5200
  * Mark query objects as backed by a materialized relation.
4929
5201
  */
4930
5202
  materialized?: true | undefined;
5203
+ /**
5204
+ * Exclude a table-like definition from migration DDL generation.
5205
+ */
5206
+ generatorIgnore?: true | undefined;
4931
5207
  /**
4932
5208
  * Computed SQL or JS columns definitions
4933
5209
  */
@@ -4959,8 +5235,8 @@ declare class Db<Table extends string | undefined = undefined, Shape extends Col
4959
5235
  __defaultSelect: DefaultSelect;
4960
5236
  baseQuery: Query;
4961
5237
  columns: (keyof Shape)[];
4962
- outputType: ColumnsShape.DefaultSelectOutput<Shape>;
4963
- inputType: ColumnsShape.Input<Shape>;
5238
+ __outputType: ColumnsShape.DefaultSelectOutput<Shape>;
5239
+ __inputType: ColumnsShape.Input<Shape>;
4964
5240
  result: { [K in DefaultSelect]: Shape[K] };
4965
5241
  returnType: undefined;
4966
5242
  then: QueryThenShallowSimplifyArr<ColumnsShape.DefaultOutput<Shape>>;
@@ -5058,7 +5334,7 @@ type MapTableScopesOption<T> = T extends {
5058
5334
  } ? {
5059
5335
  nonDeleted: unknown;
5060
5336
  } : EmptyObject;
5061
- interface DbResult<ColumnTypes> extends Db<string, never, never, never, never, never, ColumnTypes>, DbTableConstructor<ColumnTypes> {
5337
+ interface DbResult<ColumnTypes> extends Db<undefined, EmptyObject, never, never, never, never, ColumnTypes, never, never>, DbTableConstructor<ColumnTypes> {
5062
5338
  adapterNotInTransaction: Adapter;
5063
5339
  adapter: Adapter;
5064
5340
  close: Adapter['close'];
@@ -5318,6 +5594,9 @@ interface BatchSql extends SqlCommonOptions {
5318
5594
  type Sql = SingleSql | BatchSql;
5319
5595
  declare const quoteTableWithSchema: (query: ToSQLQuery) => string;
5320
5596
  declare const getSqlText: (sql: Sql) => string;
5597
+ declare const queryToSql: (query: Query) => SingleSql;
5598
+ declare const rawSqlToSql: (sql: string | RawSqlBase) => SingleSql;
5599
+ declare const sqlToRawSql: (sql: SingleSql) => RawSqlBase;
5321
5600
  declare class QuerySql<ColumnTypes> {
5322
5601
  /**
5323
5602
  * @deprecated: use `sql` exported from the `createBaseTable` (see "define a base table" in the docs)
@@ -5504,7 +5783,7 @@ interface OperatorToSQL {
5504
5783
  interface Operator<Value, Column extends Column.Pick.OutputTypeAndOperators = Column.Pick.OutputTypeAndOperators> {
5505
5784
  <T extends PickQueryResult>(this: T, arg: Value): { [K in Exclude<keyof T, keyof T['result']['value']['operators']>]: K extends 'result' ? {
5506
5785
  value: Column;
5507
- } : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<Column['outputType']> : T[K] } & Column['operators'];
5786
+ } : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<Column['__outputType']> : T[K] } & Column['operators'];
5508
5787
  _opType: Value;
5509
5788
  }
5510
5789
  interface Base$1<Value> {
@@ -6115,7 +6394,7 @@ interface SelectAsValue {
6115
6394
  [K: string]: string | Query | Expression | undefined;
6116
6395
  }
6117
6396
  declare const getShapeFromSelect: (q: IsQuery, isSubQuery?: boolean) => Column.QueryColumns;
6118
- type AfterHook<Select extends PropertyKey[], Shape extends Column.QueryColumns> = QueryAfterHook<{ [K in Select[number]]: K extends keyof Shape ? Shape[K]['outputType'] : never }[]>;
6397
+ type AfterHook<Select extends PropertyKey[], Shape extends Column.QueryColumns> = QueryAfterHook<{ [K in Select[number]]: K extends keyof Shape ? Shape[K]['__outputType'] : never }[]>;
6119
6398
  type HookSelectArg<T extends PickQueryShape> = (keyof T['shape'] & string)[];
6120
6399
  declare const _hookSelectColumns: (query: Query, columns: string[], asFn: (as: string[]) => void) => void;
6121
6400
  declare class QueryHookUtils<T extends PickQueryInputType> {
@@ -6123,7 +6402,7 @@ declare class QueryHookUtils<T extends PickQueryInputType> {
6123
6402
  columns: string[];
6124
6403
  private key;
6125
6404
  constructor(query: IsQuery, columns: string[], key: 'hookCreateSet' | 'hookUpdateSet');
6126
- set: (data: { [K in keyof T["inputType"]]?: T["inputType"][K] | (() => QueryOrExpression<T["inputType"][K]>) }) => void;
6405
+ set: (data: { [K in keyof T["__inputType"]]?: T["__inputType"][K] | (() => QueryOrExpression<T["__inputType"][K]>) }) => void;
6127
6406
  }
6128
6407
  declare const _queryHookAfterCreate: <T extends PickQueryShape, S extends HookSelectArg<T>>(q: T, select: S, cb: AfterHook<S, T["shape"]>) => T;
6129
6408
  declare const _queryHookAfterUpdate: <T extends PickQueryShape, S extends HookSelectArg<T>>(q: T, select: S, cb: AfterHook<S, T["shape"]>) => T;
@@ -6276,7 +6555,7 @@ interface ColumnDataSelectSqlProp {
6276
6555
  interface SelectSqlCallback {
6277
6556
  (column: ColumnRefExpression<Column.Pick.QueryColumn>): Expression;
6278
6557
  }
6279
- type SelectSqlColumn<T extends Column.Pick.DataAndDataType, Expr extends Expression> = unknown extends Expr['result']['value']['outputType'] ? T : { [K in keyof T]: K extends 'outputType' ? Expr['result']['value']['outputType'] : T[K] };
6558
+ type SelectSqlColumn<T extends Column.Pick.DataAndDataType, Expr extends Expression> = unknown extends Expr['result']['value']['__outputType'] ? T : { [K in keyof T]: K extends '__outputType' ? Expr['result']['value']['__outputType'] : T[K] };
6280
6559
  declare namespace Column {
6281
6560
  export namespace Modifiers {
6282
6561
  export interface IsPrimaryKey<Name extends string> {
@@ -6289,9 +6568,9 @@ declare namespace Column {
6289
6568
  unique: Name;
6290
6569
  };
6291
6570
  };
6292
- export type Nullable<T extends Column.Pick.ForNullable, InputSchema, OutputSchema, QuerySchema> = { [K in keyof T]: K extends 'type' ? T['type'] | null : K extends 'inputType' ? T['inputType'] | null : K extends 'inputSchema' ? InputSchema : K extends 'outputType' ? T['outputType'] | (unknown extends T['nullType'] ? null : T['nullType']) : K extends 'outputSchema' ? OutputSchema : K extends 'queryType' ? T['queryType'] | null : K extends 'querySchema' ? QuerySchema : K extends 'data' ? T['data'] & DataNullable : K extends 'operators' ? { [K in keyof T['operators']]: K extends 'equals' | 'not' ? Operator<T | null> : T['operators'][K] } : T[K] };
6293
- export type QueryColumnToNullable<C> = { [K in keyof C]: K extends 'outputType' | 'queryType' ? C[K] | null : C[K] };
6294
- export type QueryColumnToOptional<C> = { [K in keyof C]: K extends 'outputType' ? C[K] | undefined : C[K] };
6571
+ export type Nullable<T extends Column.Pick.ForNullable, InputSchema, OutputSchema, QuerySchema> = { [K in keyof T]: K extends '__type' ? T['__type'] | null : K extends '__inputType' ? T['__inputType'] | null : K extends 'inputSchema' ? InputSchema : K extends '__outputType' ? T['__outputType'] | (unknown extends T['__nullType'] ? null : T['__nullType']) : K extends 'outputSchema' ? OutputSchema : K extends '__queryType' ? T['__queryType'] | null : K extends 'querySchema' ? QuerySchema : K extends 'data' ? T['data'] & DataNullable : K extends 'operators' ? { [K in keyof T['operators']]: K extends 'equals' | 'not' ? Operator<T | null> : T['operators'][K] } : T[K] };
6572
+ export type QueryColumnToNullable<C> = { [K in keyof C]: K extends '__outputType' | '__queryType' ? C[K] | null : C[K] };
6573
+ export type QueryColumnToOptional<C> = { [K in keyof C]: K extends '__outputType' ? C[K] | undefined : C[K] };
6295
6574
  interface DataNullable {
6296
6575
  isNullable: true;
6297
6576
  optional: true;
@@ -6300,9 +6579,9 @@ declare namespace Column {
6300
6579
  equals: Operator<T | null>;
6301
6580
  not: Operator<T | null>;
6302
6581
  }
6303
- export type Encode<T, InputSchema, Input> = { [K in keyof T]: K extends 'inputType' ? Input : K extends 'inputSchema' ? InputSchema : T[K] };
6304
- 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] };
6305
- export type ParseNull<T extends Column.Pick.ForParseNull, NullSchema, NullType> = { [K in keyof T]: K extends 'outputType' ? null extends T['type'] ? Exclude<T['outputType'], null> | NullType : T['outputType'] : K extends 'nullType' ? NullType : K extends 'outputSchema' ? null extends T['type'] ? T['outputSchema'] | NullSchema : T['outputSchema'] : K extends 'nullSchema' ? NullSchema : T[K] };
6582
+ export type Encode<T, InputSchema, Input> = { [K in keyof T]: K extends '__inputType' ? Input : K extends 'inputSchema' ? InputSchema : T[K] };
6583
+ 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] };
6584
+ export type ParseNull<T extends Column.Pick.ForParseNull, NullSchema, NullType> = { [K in keyof T]: K extends '__outputType' ? null extends T['__type'] ? Exclude<T['__outputType'], null> | NullType : T['__outputType'] : K extends '__nullType' ? NullType : K extends 'outputSchema' ? null extends T['__type'] ? T['outputSchema'] | NullSchema : T['outputSchema'] : K extends 'nullSchema' ? NullSchema : T[K] };
6306
6585
  type DefaultData<T extends Column.Data, Value> = { [K in keyof T]: K extends 'default' ? Value extends null ? never : Value : K extends 'optional' ? true : T[K] };
6307
6586
  export type Default<T extends Column.Pick.Data, Value> = { [K in keyof T]: K extends 'data' ? DefaultData<T['data'], Value> : T[K] };
6308
6587
  type DefaultSelectData<T extends Column.Data, Value> = { [K in keyof T]: K extends 'explicitSelect' ? Value extends true ? false : true : T[K] };
@@ -6312,7 +6591,7 @@ declare namespace Column {
6312
6591
  appReadOnly: true;
6313
6592
  };
6314
6593
  }
6315
- export type Generated<T extends Column.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] };
6594
+ export type Generated<T extends Column.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] };
6316
6595
  export {};
6317
6596
  }
6318
6597
  export namespace Pick {
@@ -6320,17 +6599,17 @@ declare namespace Column {
6320
6599
  data: Column.Data;
6321
6600
  }
6322
6601
  interface Type {
6323
- type: unknown;
6602
+ __type: unknown;
6324
6603
  }
6325
6604
  interface OutputType {
6326
- outputType: unknown;
6605
+ __outputType: unknown;
6327
6606
  }
6328
6607
  interface InputType {
6329
- inputType: unknown;
6608
+ __inputType: unknown;
6330
6609
  }
6331
6610
  interface DataAndInputType extends Data, InputType {}
6332
6611
  interface NullType {
6333
- nullType: unknown;
6612
+ __nullType: unknown;
6334
6613
  }
6335
6614
  interface OutputTypeAndOperators extends OutputType {
6336
6615
  operators: unknown;
@@ -6340,22 +6619,22 @@ declare namespace Column {
6340
6619
  }
6341
6620
  interface QueryColumn extends OutputType {
6342
6621
  dataType: string;
6343
- type: unknown;
6344
- queryType: unknown;
6622
+ __type: unknown;
6623
+ __queryType: unknown;
6345
6624
  operators: any;
6346
6625
  }
6347
6626
  interface QueryColumnOfType<T> {
6348
6627
  dataType: string;
6349
- type: T;
6350
- outputType: T;
6351
- queryType: T;
6628
+ __type: T;
6629
+ __outputType: T;
6630
+ __queryType: T;
6352
6631
  operators: any;
6353
6632
  }
6354
6633
  interface QueryColumnOfTypeAndOps<DataType, T, Ops> {
6355
6634
  dataType: DataType;
6356
- type: T;
6357
- outputType: T;
6358
- queryType: T;
6635
+ __type: T;
6636
+ __outputType: T;
6637
+ __queryType: T;
6359
6638
  operators: Ops;
6360
6639
  }
6361
6640
  interface QueryColumnOfDataType<T extends string> extends QueryColumn {
@@ -6375,8 +6654,8 @@ declare namespace Column {
6375
6654
  querySchema: any;
6376
6655
  }
6377
6656
  interface ForNullable extends Data, Type, InputType, OutputType, TypeSchemas {
6378
- nullType: unknown;
6379
- queryType: unknown;
6657
+ __nullType: unknown;
6658
+ __queryType: unknown;
6380
6659
  operators: unknown;
6381
6660
  }
6382
6661
  interface ForParse extends Type, NullType, NullSchema {}
@@ -6426,9 +6705,9 @@ declare namespace Column {
6426
6705
  type StringOrMessage = string | Message;
6427
6706
  }
6428
6707
  export interface InputOutputQueryTypes {
6429
- inputType: unknown;
6430
- outputType: unknown;
6431
- queryType: unknown;
6708
+ __inputType: unknown;
6709
+ __outputType: unknown;
6710
+ __queryType: unknown;
6432
6711
  }
6433
6712
  export interface InputOutputQueryTypesWithSchemas extends InputOutputQueryTypes {
6434
6713
  inputSchema: unknown;
@@ -6525,24 +6804,24 @@ declare const setDataValue: <T extends Column.Pick.Data, Key extends string, Val
6525
6804
  declare function setCurrentColumnName(name: string): void;
6526
6805
  declare const consumeColumnName: () => string | undefined;
6527
6806
  declare const setDefaultLanguage: (lang?: string) => void;
6528
- declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSchemaArg, Type = unknown, InputSchema = any, Ops = any, InputType = Type, OutputType = Type, OutputSchema = InputSchema, QueryType = InputType, QuerySchema = InputSchema> {
6529
- inputSchema: InputSchema;
6530
- outputSchema: OutputSchema;
6531
- querySchema: QuerySchema;
6807
+ declare abstract class Column {
6808
+ abstract __schema: ColumnTypeSchemaArg;
6532
6809
  abstract dataType: string;
6533
- abstract operators: Ops;
6810
+ abstract operators: any;
6534
6811
  abstract toCode(ctx: ColumnToCodeCtx, key: string): Code;
6535
- type: Type;
6536
- inputType: InputType;
6537
- outputType: OutputType;
6538
- queryType: QueryType;
6539
- nullType: unknown;
6812
+ abstract __type: unknown;
6813
+ abstract __inputType: unknown;
6814
+ abstract __outputType: unknown;
6815
+ abstract __queryType: unknown;
6816
+ __nullType: unknown;
6540
6817
  nullSchema: unknown;
6541
- isNullable: boolean;
6818
+ abstract inputSchema: unknown;
6819
+ abstract outputSchema: unknown;
6820
+ abstract querySchema: unknown;
6542
6821
  data: Column.Data;
6543
- error: Schema['error'];
6822
+ error: this['__schema']['error'];
6544
6823
  _parse?: (input: unknown) => unknown;
6545
- constructor(schema: ColumnTypeSchemaArg, inputSchema: InputSchema, outputSchema?: OutputSchema, querySchema?: QuerySchema);
6824
+ constructor(schema: ColumnTypeSchemaArg, inputSchema: unknown, outputSchema?: unknown, querySchema?: unknown);
6546
6825
  /**
6547
6826
  * Set a default value to a column. Columns that have defaults become optional when creating a record.
6548
6827
  *
@@ -6569,7 +6848,7 @@ declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSch
6569
6848
  *
6570
6849
  * @param value - default value or a function returning a value
6571
6850
  */
6572
- default<T extends Column.Pick.DataAndInputType, Value extends T['inputType'] | null | RawSqlBase | (() => T['inputType'])>(this: T, value: Value): Column.Modifiers.Default<T, Value>;
6851
+ default<T extends Column.Pick.DataAndInputType, Value extends T['__inputType'] | null | RawSqlBase | (() => T['__inputType'])>(this: T, value: Value): Column.Modifiers.Default<T, Value>;
6573
6852
  /**
6574
6853
  * Use `hasDefault` to let the column be omitted when creating records.
6575
6854
  *
@@ -6615,7 +6894,7 @@ declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSch
6615
6894
  * }
6616
6895
  * ```
6617
6896
  */
6618
- nullable: Schema['nullable'];
6897
+ nullable: this['__schema']['nullable'];
6619
6898
  /**
6620
6899
  * Set a custom function to process value for the column when creating or updating a record.
6621
6900
  *
@@ -6651,7 +6930,7 @@ declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSch
6651
6930
  *
6652
6931
  * @param fn - function to encode value for a database, argument type is specified by you, return type must be compatible with a database
6653
6932
  */
6654
- encode: Schema['encode'];
6933
+ encode: this['__schema']['encode'];
6655
6934
  /**
6656
6935
  * Set a custom function to process value after loading it from a database.
6657
6936
  *
@@ -6689,7 +6968,7 @@ declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSch
6689
6968
  *
6690
6969
  * @param fn - function to parse a value from the database, argument is the type of this column, return type is up to you
6691
6970
  */
6692
- parse: Schema['parse'];
6971
+ parse: this['__schema']['parse'];
6693
6972
  /**
6694
6973
  * Use `parseNull` to specify runtime defaults at selection time.
6695
6974
  *
@@ -6734,7 +7013,7 @@ declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSch
6734
7013
  * })
6735
7014
  * ```
6736
7015
  */
6737
- parseNull: Schema['parseNull'];
7016
+ parseNull: this['__schema']['parseNull'];
6738
7017
  /**
6739
7018
  * This method changes a column type without modifying its behavior.
6740
7019
  * This is needed when converting columns to a validation schema, the converter will pick a different type specified by `.as`.
@@ -6754,17 +7033,17 @@ declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSch
6754
7033
  * @param column - other column type to inherit from
6755
7034
  */
6756
7035
  as<T extends {
6757
- inputType: unknown;
6758
- outputType: unknown;
7036
+ __inputType: unknown;
7037
+ __outputType: unknown;
6759
7038
  data: Column.Data;
6760
7039
  }, C extends {
6761
- inputType: T['inputType'];
6762
- outputType: T['outputType'];
7040
+ __inputType: T['__inputType'];
7041
+ __outputType: T['__outputType'];
6763
7042
  }>(this: T, column: C): C;
6764
7043
  /**
6765
7044
  * @deprecated use narrowType instead
6766
7045
  */
6767
- asType: Schema['asType'];
7046
+ asType: this['__schema']['asType'];
6768
7047
  /**
6769
7048
  * `narrowType` narrows TypeScript types of a column. It sets input, output, query type altogether.
6770
7049
  *
@@ -6807,8 +7086,10 @@ declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSch
6807
7086
  * // size will be typed as 'small' | 'medium' | 'large'
6808
7087
  * const size = await db.table.get('size');
6809
7088
  * ```
7089
+ *
7090
+ * @deprecated use `type` instead
6810
7091
  */
6811
- narrowType: Schema['narrowType'];
7092
+ narrowType: this['__schema']['narrowType'];
6812
7093
  /**
6813
7094
  * Allows to narrow different TypeScript types of a column granularly.
6814
7095
  *
@@ -6864,17 +7145,19 @@ declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSch
6864
7145
  * // size will be typed as 'small' | 'medium' | 'large'
6865
7146
  * const size = await db.table.get('size');
6866
7147
  * ```
7148
+ *
7149
+ * @deprecated use `type`, `inputType`, `outputType`, `queryType` instead
6867
7150
  */
6868
- narrowAllTypes: Schema['narrowAllTypes'];
7151
+ narrowAllTypes: this['__schema']['narrowAllTypes'];
6869
7152
  input<T extends {
6870
7153
  inputSchema: unknown;
6871
- }, InputSchema extends Schema['type']>(this: T, fn: (schema: T['inputSchema']) => InputSchema): { [K in keyof T]: K extends 'inputSchema' ? InputSchema : T[K] };
7154
+ }, InputSchema extends this['__schema']['__schemaType']>(this: T, fn: (schema: T['inputSchema']) => InputSchema): { [K in keyof T]: K extends 'inputSchema' ? InputSchema : T[K] };
6872
7155
  output<T extends {
6873
7156
  outputSchema: unknown;
6874
- }, OutputSchema extends Schema['type']>(this: T, fn: (schema: T['outputSchema']) => OutputSchema): { [K in keyof T]: K extends 'outputSchema' ? OutputSchema : T[K] };
7157
+ }, OutputSchema extends this['__schema']['__schemaType']>(this: T, fn: (schema: T['outputSchema']) => OutputSchema): { [K in keyof T]: K extends 'outputSchema' ? OutputSchema : T[K] };
6875
7158
  query<T extends {
6876
7159
  querySchema: unknown;
6877
- }, QuerySchema extends Schema['type']>(this: T, fn: (schema: T['querySchema']) => QuerySchema): { [K in keyof T]: K extends 'querySchema' ? QuerySchema : T[K] };
7160
+ }, QuerySchema extends this['__schema']['__schemaType']>(this: T, fn: (schema: T['querySchema']) => QuerySchema): { [K in keyof T]: K extends 'querySchema' ? QuerySchema : T[K] };
6878
7161
  /**
6879
7162
  * Set a database column name.
6880
7163
  *
@@ -6968,7 +7251,7 @@ declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSch
6968
7251
  * }
6969
7252
  * ```
6970
7253
  */
6971
- setOnCreate<T extends Column.Pick.QueryInit>(this: T, fn: (arg: QueryHookUtils<PickQueryInputType>) => T['inputType'] | void): T;
7254
+ setOnCreate<T extends Column.Pick.QueryInit>(this: T, fn: (arg: QueryHookUtils<PickQueryInputType>) => T['__inputType'] | void): T;
6972
7255
  /**
6973
7256
  * Set a column value when updating a record.
6974
7257
  * This works for [readOnly](#readonly) columns as well.
@@ -6985,7 +7268,7 @@ declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSch
6985
7268
  * }
6986
7269
  * ```
6987
7270
  */
6988
- setOnUpdate<T extends Column.Pick.QueryInit>(this: T, fn: (arg: QueryHookUtils<PickQueryInputType>) => T['inputType'] | void): T;
7271
+ setOnUpdate<T extends Column.Pick.QueryInit>(this: T, fn: (arg: QueryHookUtils<PickQueryInputType>) => T['__inputType'] | void): T;
6989
7272
  /**
6990
7273
  * Set a column value when creating or updating a record.
6991
7274
  * This works for [readOnly](#readonly) columns as well.
@@ -7002,7 +7285,7 @@ declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSch
7002
7285
  * }
7003
7286
  * ```
7004
7287
  */
7005
- setOnSave<T extends Column.Pick.QueryInit>(this: T, fn: (arg: QueryHookUtils<PickQueryInputType>) => T['inputType'] | void): T;
7288
+ setOnSave<T extends Column.Pick.QueryInit>(this: T, fn: (arg: QueryHookUtils<PickQueryInputType>) => T['__inputType'] | void): T;
7006
7289
  /**
7007
7290
  * Mark the column as a primary key.
7008
7291
  * This column type becomes an argument of the `.find` method.
@@ -7522,11 +7805,11 @@ declare class QueryCreateFrom {
7522
7805
  }
7523
7806
  interface CreateSelf extends PickQueryHasSelect, PickQueryDefaults, PickQueryResult, PickQueryRelations, PickQueryWithData, PickQueryReturnType, PickQueryShape, PickQueryUniqueProperties, PickQueryInputType, Query.Pick.IsNotReadOnly {}
7524
7807
  type CreateData<T extends CreateSelf> = EmptyObject extends T['relations'] ? CreateDataWithDefaults<T, keyof T['__defaults']> : CreateRelationsData<T>;
7525
- type CreateDataWithDefaults<T extends CreateSelf, 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 };
7526
- type CreateDataWithDefaultsForRelations<T extends CreateSelf, 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> };
7527
- type CreateColumn<T extends CreateSelf, K extends keyof T['inputType']> = T['inputType'][K] | ((q: T) => QueryOrExpression<T['inputType'][K]>);
7808
+ type CreateDataWithDefaults<T extends CreateSelf, 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 };
7809
+ type CreateDataWithDefaultsForRelations<T extends CreateSelf, 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> };
7810
+ type CreateColumn<T extends CreateSelf, K extends keyof T['__inputType']> = T['__inputType'][K] | ((q: T) => QueryOrExpression<T['__inputType'][K]>);
7528
7811
  type CreateRelationsData<T extends CreateSelf> = CreateDataWithDefaultsForRelations<T, keyof T['__defaults'], T['relations'][keyof T['relations']]['omitForeignKeyInCreate']> & CreateRelationsDataOmittingFKeys<T, T['relations'][keyof T['relations']]['dataForCreate']>;
7529
- type CreateRelationsDataOmittingFKeys<T extends CreateSelf, 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;
7812
+ type CreateRelationsDataOmittingFKeys<T extends CreateSelf, 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;
7530
7813
  type CreateResult<T extends CreateSelf, Data> = T extends {
7531
7814
  isCount: true;
7532
7815
  } ? 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>>;
@@ -7541,7 +7824,7 @@ type InsertManyResult<T extends CreateSelf> = T['__hasSelect'] extends true ? T[
7541
7824
  *
7542
7825
  * The same should work as well with any non-null columns passed to `create`, but it's to be implemented later.
7543
7826
  */
7544
- type NarrowCreateResult<T extends CreateSelf, Data> = EmptyObject 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.Pick.QueryColumnOfTypeAndOps<string, Exclude<T['result'][K]['outputType'], null>, T['result'][K]['operators']> : T['result'][K] };
7827
+ type NarrowCreateResult<T extends CreateSelf, Data> = EmptyObject 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.Pick.QueryColumnOfTypeAndOps<string, Exclude<T['result'][K]['__outputType'], null>, T['result'][K]['operators']> : T['result'][K] };
7545
7828
  type IgnoreResult<T extends CreateSelf> = T['returnType'] extends 'oneOrThrow' ? QueryTakeOptional<T> : T['returnType'] extends 'valueOrThrow' ? SetQueryReturnsColumnOptional<T, T['result']['value']> : T;
7546
7829
  type OnConflictArg<T extends PickQueryUniqueProperties> = T['internal']['uniqueColumnNames'] | T['internal']['uniqueColumnTuples'] | Expression | {
7547
7830
  constraint: T['internal']['uniqueConstraints'];
@@ -7568,7 +7851,7 @@ declare const _queryDefaults: <T extends CreateSelf, Data extends Partial<Create
7568
7851
  */
7569
7852
  type CreateMethodsNames = 'create' | 'insert' | 'createMany' | 'insertMany' | CreateFromMethodNames;
7570
7853
  type CreateManyMethodsNames = 'createMany' | 'insertMany' | CreateManyFromMethodNames;
7571
- type ExtraPropertiesAreNotAllowed<T extends CreateSelf, 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}`;
7854
+ type ExtraPropertiesAreNotAllowed<T extends CreateSelf, 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}`;
7572
7855
  declare class QueryCreate {
7573
7856
  /**
7574
7857
  * `create` and `insert` create a single record.
@@ -7842,7 +8125,7 @@ declare class QueryCreate {
7842
8125
  */
7843
8126
  onConflictDoNothing<T extends CreateSelf, Arg extends OnConflictArg<T>>(this: T, arg?: Arg): IgnoreResult<T>;
7844
8127
  }
7845
- type OnConflictSet$1<T extends CreateSelf> = { [K in keyof T['inputType']]?: T['inputType'][K] | (() => QueryOrExpression<T['inputType'][K]>) };
8128
+ type OnConflictSet$1<T extends CreateSelf> = { [K in keyof T['__inputType']]?: T['__inputType'][K] | (() => QueryOrExpression<T['__inputType'][K]>) };
7846
8129
  declare class OnConflictQueryBuilder<T extends CreateSelf, Arg extends OnConflictArg<T> | undefined> {
7847
8130
  private query;
7848
8131
  private onConflict;
@@ -7911,11 +8194,11 @@ declare class OnConflictQueryBuilder<T extends CreateSelf, Arg extends OnConflic
7911
8194
  }): T;
7912
8195
  }
7913
8196
  interface UpdateSelf extends PickQuerySelectable, PickQueryResult, PickQueryRelations, PickQueryWithData, PickQueryReturnType, PickQueryShape, PickQueryInputType, PickQueryAs, PickQueryHasSelect, PickQueryHasWhere, Query.Pick.IsNotReadOnly {}
7914
- type UpdateData<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<T['inputType'][K]>) : T['returnType'] extends undefined | 'all' ? T['relations'][K]['dataForUpdate'] : T['relations'][K]['dataForUpdateOne'] };
8197
+ type UpdateData<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<T['__inputType'][K]>) : T['returnType'] extends undefined | 'all' ? T['relations'][K]['dataForUpdate'] : T['relations'][K]['dataForUpdateOne'] };
7915
8198
  type UpdateArg<T extends UpdateSelf> = T['__hasWhere'] extends true ? UpdateData<T> : 'Update statement must have where conditions. To update all prefix `update` with `all()`';
7916
8199
  type UpdateResult<T extends UpdateSelf> = T['__hasSelect'] extends true ? T : T['returnType'] extends undefined | 'all' ? SetQueryReturnsRowCountMany<T> : SetQueryReturnsRowCount<T>;
7917
- 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']];
7918
- type ChangeCountArg<T extends UpdateSelf> = NumericColumns<T> | { [K in NumericColumns<T>]?: T['shape'][K]['type'] extends number | null ? number : number | string | bigint };
8200
+ 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']];
8201
+ type ChangeCountArg<T extends UpdateSelf> = NumericColumns<T> | { [K in NumericColumns<T>]?: T['shape'][K]['__type'] extends number | null ? number : number | string | bigint };
7919
8202
  interface UpdateManyBySelf extends UpdateSelf {
7920
8203
  internal: {
7921
8204
  uniqueColumns: unknown;
@@ -7924,10 +8207,10 @@ interface UpdateManyBySelf extends UpdateSelf {
7924
8207
  uniqueConstraints: unknown;
7925
8208
  };
7926
8209
  }
7927
- type UpdateManyData<T extends UpdateSelf> = ({ [K in keyof T['shape'] as T['shape'][K] extends Column.Modifiers.IsPrimaryKey<string> ? K : never]: T['shape'][K]['queryType'] | Expression } & { [P in keyof T['inputType']]?: T['inputType'][P] | Expression })[];
8210
+ type UpdateManyData<T extends UpdateSelf> = ({ [K in keyof T['shape'] as T['shape'][K] extends Column.Modifiers.IsPrimaryKey<string> ? K : never]: T['shape'][K]['__queryType'] | Expression } & { [P in keyof T['__inputType']]?: T['__inputType'][P] | Expression })[];
7928
8211
  type UpdateManyByKeys<T extends UpdateManyBySelf> = T['internal']['uniqueColumnNames'] | T['internal']['uniqueColumnTuples'];
7929
8212
  type UpdateManyByKeyColumns<K> = K extends string[] ? K[number] : K;
7930
- 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 })[];
8213
+ 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 })[];
7931
8214
  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>;
7932
8215
  declare const _queryUpdate: <T extends UpdateSelf>(updateSelf: T, arg: UpdateArg<T>) => UpdateResult<T>;
7933
8216
  declare const _queryUpdateOrThrow: <T extends UpdateSelf>(q: T, arg: UpdateArg<T>) => UpdateResult<T>;
@@ -8374,8 +8657,16 @@ declare class QueryUpdate {
8374
8657
  */
8375
8658
  updateManyByOptional<T extends UpdateManyBySelf, Keys extends UpdateManyByKeys<T>, K = UpdateManyByKeyColumns<Keys>>(this: T, keys: Keys, data: UpdateManyByData<T, K>): UpdateManyResult<T> & QueryHasWhere;
8376
8659
  }
8377
- declare abstract class VirtualColumn<Schema extends ColumnSchemaConfig, InputSchema extends Schema['type'] = ReturnType<Schema['never']>> extends Column<Schema, unknown, InputSchema, OperatorsAny> {
8660
+ declare abstract class VirtualColumn<Schema extends ColumnSchemaConfig, InputSchema extends Schema['__schemaType'] = ReturnType<Schema['never']>> extends Column {
8661
+ __schema: Schema;
8378
8662
  dataType: string;
8663
+ __type: unknown;
8664
+ __inputType: unknown;
8665
+ inputSchema: InputSchema;
8666
+ __outputType: unknown;
8667
+ outputSchema: InputSchema;
8668
+ __queryType: unknown;
8669
+ querySchema: ReturnType<Schema['never']>;
8379
8670
  operators: OperatorsAny;
8380
8671
  constructor(schema: Schema, inputSchema?: InputSchema);
8381
8672
  toCode(): never;
@@ -8412,20 +8703,20 @@ interface ComputedOptionsConfig {
8412
8703
  type ComputedOptionsFactory<ColumnTypes, Shape extends Column.QueryColumns> = (t: ComputedMethods<ColumnTypes, Shape>) => ComputedOptionsConfig;
8413
8704
  interface RuntimeComputedQueryColumn<OutputType> extends Column.Pick.QueryColumn {
8414
8705
  dataType: 'runtimeComputed';
8415
- type: never;
8416
- outputType: OutputType;
8417
- queryType: undefined;
8706
+ __type: never;
8707
+ __outputType: OutputType;
8708
+ __queryType: undefined;
8418
8709
  operators: {
8419
8710
  cannotQueryRuntimeComputed: never;
8420
8711
  };
8421
8712
  }
8422
8713
  interface ComputedMethods<ColumnTypes, Shape extends Column.QueryColumns> extends QueryComputedArg<ColumnTypes, Shape> {
8423
- computeAtRuntime<Deps extends keyof Shape, OutputType>(dependsOn: Deps[], fn: (record: { [K in keyof Shape & Deps]: Shape[K]['outputType'] }) => OutputType): {
8714
+ computeAtRuntime<Deps extends keyof Shape, OutputType>(dependsOn: Deps[], fn: (record: { [K in keyof Shape & Deps]: Shape[K]['__outputType'] }) => OutputType): {
8424
8715
  result: {
8425
8716
  value: RuntimeComputedQueryColumn<OutputType>;
8426
8717
  };
8427
8718
  };
8428
- computeBatchAtRuntime<Deps extends keyof Shape, OutputType>(dependsOn: Deps[], fn: (record: { [K in keyof Shape & Deps]: Shape[K]['outputType'] }[]) => MaybePromise<OutputType[]>): {
8719
+ computeBatchAtRuntime<Deps extends keyof Shape, OutputType>(dependsOn: Deps[], fn: (record: { [K in keyof Shape & Deps]: Shape[K]['__outputType'] }[]) => MaybePromise<OutputType[]>): {
8429
8720
  result: {
8430
8721
  value: RuntimeComputedQueryColumn<OutputType>;
8431
8722
  };
@@ -8831,7 +9122,7 @@ interface ToSQLQuery extends IsQuery {
8831
9122
  }
8832
9123
  interface FromQuerySelf extends PickQuerySelectable, PickQueryShape, PickQueryReturnType, PickQueryWithData, PickQueryAs, PickQueryHasSelect {}
8833
9124
  type FromArg<T extends FromQuerySelf> = IsQuery | Exclude<keyof T['withData'], symbol | number>;
8834
- type FromResult<T extends FromQuerySelf, Arg extends MaybeArray<FromArg<T>>> = Arg extends string ? T['withData'] extends WithDataItems ? { [K in keyof T]: K extends '__selectable' ? SelectableFromShape<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<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}`]: {
9125
+ type FromResult<T extends FromQuerySelf, Arg extends MaybeArray<FromArg<T>>> = Arg extends string ? T['withData'] extends WithDataItems ? { [K in keyof T]: K extends '__selectable' ? SelectableFromShape<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<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}`]: {
8835
9126
  as: K;
8836
9127
  column: T['withData'][A]['shape'][K];
8837
9128
  } } : never : A extends PickQueryResultAs ? { [K in keyof A['result'] & string as `${A['__as']}.${K}`]: K extends string ? {
@@ -9172,7 +9463,7 @@ declare class CteQuery {
9172
9463
  }
9173
9464
  type UnionArgs<T extends PickQueryResult> = ({
9174
9465
  result: { [K in keyof T['result']]: {
9175
- queryType: T['result'][K]['queryType'];
9466
+ __queryType: T['result'][K]['__queryType'];
9176
9467
  } };
9177
9468
  } | ((q: T) => Expression))[];
9178
9469
  declare class Union {
@@ -9296,7 +9587,7 @@ declare class Clear {
9296
9587
  type HavingArgFn<T> = (q: T) => {
9297
9588
  result: {
9298
9589
  value: {
9299
- outputType: boolean;
9590
+ __outputType: boolean;
9300
9591
  };
9301
9592
  };
9302
9593
  };
@@ -9526,7 +9817,7 @@ interface QueryPluckSelf extends PickQuerySelectable, PickQueryRelationsWithData
9526
9817
  type PluckArg<T extends QueryPluckSelf> = SelectableOrExpression<T> | ((q: SelectAsFnArg<T>) => Expression | Query.Pick.SingleValueResult);
9527
9818
  type PluckResult<T extends QueryPluckSelf, S extends PluckArg<T>> = S extends ((q: never) => infer R) ? R extends Expression ? SetQueryReturnsPluck<T, R> : R extends Query.Pick.SingleValueResult ? { [K in keyof T]: K extends '__hasSelect' ? true : K extends 'result' ? {
9528
9819
  pluck: R['result']['value'];
9529
- } : K extends 'returnType' ? 'pluck' : K extends 'then' ? QueryThen<R['result']['value']['outputType'][]> : T[K] } : never : S extends SelectableOrExpression<T> ? SetQueryReturnsPluck<T, S> : never;
9820
+ } : K extends 'returnType' ? 'pluck' : K extends 'then' ? QueryThen<R['result']['value']['__outputType'][]> : T[K] } : never : S extends SelectableOrExpression<T> ? SetQueryReturnsPluck<T, S> : never;
9530
9821
  declare class QueryPluck {
9531
9822
  /**
9532
9823
  * `.pluck` returns a single array of a single selected column values:
@@ -9799,15 +10090,15 @@ type QueryHelperResult<T extends IsQueryHelper> = T['__result'];
9799
10090
  interface NarrowTypeSelf extends PickQueryResultReturnType {
9800
10091
  returnType: undefined | 'all' | 'one' | 'oneOrThrow' | 'value' | 'valueOrThrow' | 'pluck';
9801
10092
  }
9802
- 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];
10093
+ 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];
9803
10094
  interface NarrowValueTypeResult<T extends PickQueryResultReturnType, Narrow> extends Column.QueryColumns {
9804
- value: { [K in keyof T['result']['value']]: K extends 'outputType' ? Narrow : T['result']['value'][K] };
10095
+ value: { [K in keyof T['result']['value']]: K extends '__outputType' ? Narrow : T['result']['value'][K] };
9805
10096
  }
9806
10097
  interface NarrowPluckTypeResult<T extends PickQueryResultReturnType, Narrow> extends Column.QueryColumns {
9807
- pluck: { [K in keyof T['result']['pluck']]: K extends 'outputType' ? Narrow extends unknown[] ? Narrow[number] : Narrow : T['result']['pluck'][K] };
10098
+ pluck: { [K in keyof T['result']['pluck']]: K extends '__outputType' ? Narrow extends unknown[] ? Narrow[number] : Narrow : T['result']['pluck'][K] };
9808
10099
  }
9809
10100
  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.Modifiers.QueryColumnToOptional<R['result'][K]> } : K extends 'then' ? QueryIfResultThen<T, R> : T[K] };
9810
- 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>;
10101
+ 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>;
9811
10102
  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, QueryUpsert, QueryOrCreate, QueryGet, QueryPluck, MergeQueryMethods, QuerySql<ColumnTypes>, QueryTransform, QueryMap, QueryScope, SoftDeleteMethods, QueryExpressions, QueryWrap, QueryWindow {}
9812
10103
  declare class QueryMethods<ColumnTypes> {
9813
10104
  /**
@@ -10238,10 +10529,10 @@ declare class QueryMethods<ColumnTypes> {
10238
10529
  * ```
10239
10530
  */
10240
10531
  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]: {
10241
- outputType: Narrow[K];
10532
+ __outputType: Narrow[K];
10242
10533
  } } : K extends 'then' ? QueryThenByQuery<T, T['result'] & { [K in keyof Narrow]: {
10243
- outputType: Narrow[K];
10244
- } }> : 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';
10534
+ __outputType: Narrow[K];
10535
+ } }> : 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';
10245
10536
  if<T extends PickQueryResultReturnType, R extends PickQueryResult>(this: T, condition: boolean | null | undefined, fn: (q: T) => R & {
10246
10537
  returnType: T['returnType'];
10247
10538
  }): QueryIfResult<T, R>;
@@ -10315,7 +10606,7 @@ interface Query extends IsQuery, PickQueryTable, PickQueryShape, PickQuerySelect
10315
10606
  returnType: QueryReturnType;
10316
10607
  qb: QueryBuilder;
10317
10608
  columnTypes: unknown;
10318
- inputType: RecordUnknown;
10609
+ __inputType: RecordUnknown;
10319
10610
  q: QueryData;
10320
10611
  then: QueryThen<unknown>;
10321
10612
  catch: QueryCatch;
@@ -10352,43 +10643,43 @@ declare namespace Query {
10352
10643
  }
10353
10644
  }
10354
10645
  }
10355
- type SelectableOfType<T extends PickQuerySelectable, Type> = { [K in keyof T['__selectable']]: T['__selectable'][K]['column']['type'] extends Type | null ? K : never }[keyof T['__selectable']];
10356
- type SelectableOrExpressionOfType<T extends PickQuerySelectable, C extends Column.Pick.Type> = SelectableOfType<T, C['type']> | Expression<Column.Pick.QueryColumnOfType<C['type'] | null>>;
10646
+ type SelectableOfType<T extends PickQuerySelectable, Type> = { [K in keyof T['__selectable']]: T['__selectable'][K]['column']['__type'] extends Type | null ? K : never }[keyof T['__selectable']];
10647
+ type SelectableOrExpressionOfType<T extends PickQuerySelectable, C extends Column.Pick.Type> = SelectableOfType<T, C['__type']> | Expression<Column.Pick.QueryColumnOfType<C['__type'] | null>>;
10357
10648
  type SetQueryReturnsAll<T extends PickQueryResult> = { [K in keyof T]: K extends 'returnType' ? 'all' : K extends 'then' ? QueryThenShallowSimplifyArr<ColumnsShape.Output<T['result']>> : T[K] } & QueryHasWhere;
10358
10649
  type SetQueryReturnsAllResult<T extends PickQueryResult, Result extends Column.QueryColumns> = { [K in keyof T]: K extends 'returnType' ? 'all' : K extends 'result' ? Result : K extends 'then' ? QueryThenShallowSimplifyArr<T['result']> : T[K] } & QueryHasWhere;
10359
- 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.Output<T['result']>> : T[K] };
10650
+ 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.Output<T['result']>> : T[K] };
10360
10651
  type QueryManyTakeOptional<T extends PickQueryResultReturnType> = { [K in keyof T]: K extends 'returnType' ? 'one' : K extends 'then' ? QueryThenShallowSimplifyOptional<ColumnsShape.Output<T['result']>> : T[K] };
10361
- 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.Output<T['result']>> : T[K] };
10652
+ 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.Output<T['result']>> : T[K] };
10362
10653
  type QueryManyTake<T extends PickQueryResultReturnType> = { [K in keyof T]: K extends 'returnType' ? 'oneOrThrow' : K extends 'then' ? QueryThenShallowSimplify<ColumnsShape.Output<T['result']>> : T[K] };
10363
10654
  type SetQueryReturnsOne<T extends PickQueryResult> = { [K in keyof T]: K extends 'returnType' ? 'oneOrThrow' : K extends 'then' ? QueryThenShallowSimplify<ColumnsShape.Output<T['result']>> : T[K] };
10364
10655
  type SetQueryReturnsOneResult<T extends PickQueryResult, Result extends Column.QueryColumns> = { [K in keyof T]: K extends 'returnType' ? 'oneOrThrow' : K extends 'result' ? Result : K extends 'then' ? QueryThenShallowSimplify<ColumnsShape.Output<Result>> : T[K] };
10365
10656
  type SetQueryReturnsRows<T extends PickQueryResult> = { [K in keyof T]: K extends 'returnType' ? 'rows' : K extends 'then' ? QueryThen<ColumnsShape.Output<T['result']>[keyof T['result']][][]> : T[K] };
10366
10657
  type SetQueryReturnsPluck<T extends PickQuerySelectable, S extends keyof T['__selectable'] | Expression> = S extends keyof T['__selectable'] ? { [K in keyof T]: K extends '__hasSelect' ? true : K extends 'result' ? {
10367
10658
  pluck: T['__selectable'][S]['column'];
10368
- } : 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' ? {
10659
+ } : 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' ? {
10369
10660
  pluck: S extends Expression ? S['result']['value'] : never;
10370
- } : K extends 'returnType' ? 'pluck' : K extends 'then' ? QueryThen<(S extends Expression ? S['result']['value']['outputType'] : never)[]> : T[K] };
10661
+ } : K extends 'returnType' ? 'pluck' : K extends 'then' ? QueryThen<(S extends Expression ? S['result']['value']['__outputType'] : never)[]> : T[K] };
10371
10662
  type SetValueQueryReturnsPluckColumn<T extends PickQueryResult> = { [K in keyof T]: K extends 'result' ? {
10372
10663
  pluck: T['result']['value'];
10373
- } : K extends 'returnType' ? 'pluck' : K extends 'then' ? QueryThen<T['result']['value']['outputType'][]> : T[K] } & QueryHasSelect;
10664
+ } : K extends 'returnType' ? 'pluck' : K extends 'then' ? QueryThen<T['result']['value']['__outputType'][]> : T[K] } & QueryHasSelect;
10374
10665
  type SetQueryReturnsPluckColumnResult<T extends PickQueryResult, Result extends Column.QueryColumns> = { [K in keyof T]: K extends 'result' ? {
10375
10666
  pluck: T['result']['value'];
10376
- } : K extends 'returnType' ? 'pluck' : K extends 'result' ? Result : K extends 'then' ? QueryThen<T['result']['value']['outputType'][]> : T[K] } & QueryHasSelect;
10667
+ } : K extends 'returnType' ? 'pluck' : K extends 'result' ? Result : K extends 'then' ? QueryThen<T['result']['value']['__outputType'][]> : T[K] } & QueryHasSelect;
10377
10668
  type SetQueryReturnsValueOrThrow<T extends PickQuerySelectable, Arg extends keyof T['__selectable']> = SetQueryReturnsColumnOrThrow<T, T['__selectable'][Arg]['column']> & T['__selectable'][Arg]['column']['operators'];
10378
- type SetValueQueryReturnsValueOrThrow<T extends PickQueryResult> = { [K in keyof T]: K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<T['result']['value']['outputType']> : T[K] };
10379
- 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.Modifiers.OperatorsNullable<T['__selectable'][Arg]['column']>;
10669
+ type SetValueQueryReturnsValueOrThrow<T extends PickQueryResult> = { [K in keyof T]: K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<T['result']['value']['__outputType']> : T[K] };
10670
+ 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.Modifiers.OperatorsNullable<T['__selectable'][Arg]['column']>;
10380
10671
  type SetQueryReturnsColumnOrThrow<T, Column extends Column.Pick.OutputType> = { [K in keyof T]: K extends 'result' ? {
10381
10672
  value: Column;
10382
- } : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<Column['outputType']> : T[K] } & QueryHasSelect;
10673
+ } : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<Column['__outputType']> : T[K] } & QueryHasSelect;
10383
10674
  type SetQueryReturnsColumnOptional<T, Column extends Column.Pick.OutputType> = { [K in keyof T]: K extends 'result' ? {
10384
10675
  value: Column;
10385
- } : K extends 'returnType' ? 'value' : K extends 'then' ? QueryThen<Column['outputType'] | undefined> : T[K] } & QueryHasSelect;
10676
+ } : K extends 'returnType' ? 'value' : K extends 'then' ? QueryThen<Column['__outputType'] | undefined> : T[K] } & QueryHasSelect;
10386
10677
  type SetQueryReturnsColumn<T extends PickQueryResult> = { [K in keyof T]: K extends 'result' ? {
10387
10678
  value: T['result']['pluck'];
10388
- } : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<T['result']['pluck']['outputType']> : T[K] } & QueryHasSelect;
10679
+ } : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<T['result']['pluck']['__outputType']> : T[K] } & QueryHasSelect;
10389
10680
  type SetQueryReturnsColumnResult<T extends PickQueryResult, Result extends Column.QueryColumns> = { [K in keyof T]: K extends 'result' ? {
10390
10681
  value: T['result']['pluck'];
10391
- } : K extends 'returnType' ? 'valueOrThrow' : K extends 'result' ? Result : K extends 'then' ? QueryThen<Result['pluck']['outputType']> : T[K] } & QueryHasSelect;
10682
+ } : K extends 'returnType' ? 'valueOrThrow' : K extends 'result' ? Result : K extends 'then' ? QueryThen<Result['pluck']['__outputType']> : T[K] } & QueryHasSelect;
10392
10683
  type SetQueryReturnsRowCount<T extends PickQueryResult> = { [K in keyof T]: K extends 'returnType' ? 'valueOrThrow' : K extends 'result' ? {
10393
10684
  value: Column.Pick.QueryColumnOfType<number>;
10394
10685
  } : K extends 'then' ? QueryThen<number> : T[K] };
@@ -10509,7 +10800,7 @@ interface PickQueryUniqueProperties {
10509
10800
  };
10510
10801
  }
10511
10802
  interface PickQueryInputType {
10512
- inputType: RecordUnknown;
10803
+ __inputType: RecordUnknown;
10513
10804
  }
10514
10805
  interface PickQueryWithData {
10515
10806
  withData: WithDataItems;
@@ -10752,4 +11043,4 @@ declare const testTransaction: {
10752
11043
  */
10753
11044
  close(arg: Arg$1): Promise<void>;
10754
11045
  };
10755
- 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, 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, DateBaseColumn, DateColumn, type DateColumnData, DateTimeBaseClass, DateTimeTzBaseClass, Db, 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, IntegerBaseColumn, IntegerColumn, IntervalColumn, type IsQuery, type IsolationLevel, JSONColumn, JSONTextColumn, type JoinQueryMethod, type JoinedShapes, LimitedTextBaseColumn, LineColumn, LsegColumn, MacAddr8Column, MacAddrColumn, type MapTableScopesOption, type MaybeArray, type MaybePromise, type MergeQuery, MoneyColumn, type NoPrimaryKeyOption, type NonUniqDataItem, NotFoundError, NumberAsStringBaseColumn, NumberBaseColumn, type NumberColumnData, Operators, type OperatorsArray, type OperatorsJson, type OperatorsOrdinalText, OrchidOrmInternalError, type Ord, PathColumn, type PickQueryInputType, type PickQueryInternal, type PickQueryQ, type PickQueryRelations, type PickQuerySelectableRelations, type PickQueryShape, PointColumn, PolygonColumn, PostgisGeographyPointColumn, type Query, type QueryAfterHook, type QueryBeforeActionHook, type QueryBeforeHook, type QueryData, QueryError, type QueryHasWhere, type QueryHelperResult, 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 RefreshMaterializedViewOptions, 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, TextBaseColumn, 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 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, copyTableData, createDbWithAdapter, deepCompare, defaultSchemaConfig, emptyArray, emptyObject, escapeForMigration, escapeString, excludeInnerToCode, exhaustive, getCallerFilePath, getClonedQueryData, getColumnBaseType, getColumnInfo, 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, refreshMaterializedView, returnArg, setColumnData, setColumnEncode, setColumnParse, setColumnParseNull, setCurrentColumnName, setDataValue, setDefaultLanguage, setFreeAlias, setQueryObjectValueImmutable, singleQuote, tableDataMethods, testTransaction, toArray, toCamelCase, toPascalCase, toSnakeCase, wrapAdapterFnWithConnectRetry };
11046
+ 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, 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, DateBaseColumn, DateColumn, type DateColumnData, DateTimeBaseClass, DateTimeTzBaseClass, Db, 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, IntegerBaseColumn, IntegerColumn, IntervalColumn, type IsQuery, type IsolationLevel, JSONColumn, JSONTextColumn, type JoinQueryMethod, type JoinedShapes, LimitedTextBaseColumn, LineColumn, LsegColumn, MacAddr8Column, MacAddrColumn, type MapTableScopesOption, type MaybeArray, type MaybePromise, type MergeQuery, MoneyColumn, type NoPrimaryKeyOption, type NonUniqDataItem, NotFoundError, NumberAsStringBaseColumn, NumberBaseColumn, type NumberColumnData, Operators, type OperatorsArray, type OperatorsJson, type OperatorsOrdinalText, type OperatorsText, OrchidOrmInternalError, type Ord, PathColumn, type PickQueryInputType, type PickQueryInternal, type PickQueryQ, type PickQueryRelations, type PickQuerySelectableRelations, type PickQueryShape, PointColumn, PolygonColumn, PostgisGeographyPointColumn, type Query, type QueryAfterHook, type QueryBeforeActionHook, type QueryBeforeHook, type QueryData, QueryError, type QueryHasWhere, type QueryHelperResult, 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 RefreshMaterializedViewOptions, 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, TextBaseColumn, 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 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, copyTableData, createDbWithAdapter, deepCompare, defaultSchemaConfig, emptyArray, emptyObject, escapeForMigration, escapeString, excludeInnerToCode, exhaustive, getCallerFilePath, getClonedQueryData, getColumnBaseType, getColumnInfo, 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, refreshMaterializedView, returnArg, setColumnData, setColumnEncode, setColumnParse, setColumnParseNull, setCurrentColumnName, setDataValue, setDefaultLanguage, setFreeAlias, setQueryObjectValueImmutable, singleQuote, sqlToRawSql, tableDataMethods, testTransaction, toArray, toCamelCase, toPascalCase, toSnakeCase, wrapAdapterFnWithConnectRetry };