pqb 0.67.6 → 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 +501 -219
- package/dist/index.js +12 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -11
- package/dist/index.mjs.map +1 -1
- package/dist/internal.d.ts +497 -223
- package/package.json +1 -1
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
|
-
|
|
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]['
|
|
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['
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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['
|
|
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
|
-
|
|
1262
|
+
__type: unknown;
|
|
1204
1263
|
inputSchema: any;
|
|
1205
|
-
|
|
1206
|
-
|
|
1264
|
+
__inputType: unknown;
|
|
1265
|
+
__outputType: unknown;
|
|
1207
1266
|
outputSchema: any;
|
|
1208
|
-
|
|
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
|
|
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["
|
|
1280
|
+
operators: OperatorsArray<Item["__queryType"]>;
|
|
1221
1281
|
data: ArrayData<Item>;
|
|
1222
|
-
|
|
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['
|
|
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,
|
|
1304
|
+
constructor(schema: Schema, __inputType: InputSchema, encodedByDriver?: boolean);
|
|
1230
1305
|
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
1231
1306
|
}
|
|
1232
|
-
declare class JSONTextColumn<Schema extends
|
|
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['
|
|
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
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
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
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
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['
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
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['
|
|
1267
|
-
output?: T['
|
|
1268
|
-
query?: T['
|
|
1347
|
+
input?: T['__inputType'];
|
|
1348
|
+
output?: T['__outputType'];
|
|
1349
|
+
query?: T['__queryType'];
|
|
1269
1350
|
}>() => {
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
1545
|
-
|
|
1806
|
+
__inputType: unknown;
|
|
1807
|
+
__outputType: unknown;
|
|
1546
1808
|
data: Column.Data;
|
|
1547
1809
|
}, C extends {
|
|
1548
|
-
|
|
1549
|
-
|
|
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
|
|
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
|
|
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']['
|
|
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']['
|
|
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']['
|
|
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]['
|
|
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]['
|
|
2706
|
-
export type InputPartial<Shape extends Column.QueryColumnsInit> = { [K in keyof Shape]?: Shape[K]['
|
|
2707
|
-
export type Output<Shape extends Column.QueryColumns> = { [K in keyof Shape]: Shape[K]['
|
|
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]['
|
|
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
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
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
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
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
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
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
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
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]['
|
|
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']['
|
|
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
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
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
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
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['
|
|
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['
|
|
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']['
|
|
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
|
-
|
|
3991
|
+
__queryType: T['__selectable'][K]['column']['__queryType'] | null;
|
|
3722
3992
|
};
|
|
3723
3993
|
};
|
|
3724
3994
|
} | ((q: T) => {
|
|
3725
3995
|
result: {
|
|
3726
3996
|
value: {
|
|
3727
|
-
|
|
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']['
|
|
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']['
|
|
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
|
}
|
|
@@ -4858,8 +5128,8 @@ interface QueryInternal<SinglePrimaryKey = any, UniqueColumns = any, UniqueColum
|
|
|
4858
5128
|
*/
|
|
4859
5129
|
nestedCreateBatchMax: number;
|
|
4860
5130
|
}
|
|
4861
|
-
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]['
|
|
4862
|
-
type ShapeUniqueColumns<Shape extends Column.QueryColumnsInit> = { [K in keyof Shape]: Shape[K]['data']['unique'] extends string ? { [C in K]: UniqueQueryTypeOrExpression<Shape[K]['
|
|
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];
|
|
4863
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];
|
|
4864
5134
|
type NoPrimaryKeyOption = 'error' | 'warning' | 'ignore';
|
|
4865
5135
|
interface DbSharedOptions extends QueryLogOptions {
|
|
@@ -4965,8 +5235,8 @@ declare class Db<Table extends string | undefined = undefined, Shape extends Col
|
|
|
4965
5235
|
__defaultSelect: DefaultSelect;
|
|
4966
5236
|
baseQuery: Query;
|
|
4967
5237
|
columns: (keyof Shape)[];
|
|
4968
|
-
|
|
4969
|
-
|
|
5238
|
+
__outputType: ColumnsShape.DefaultSelectOutput<Shape>;
|
|
5239
|
+
__inputType: ColumnsShape.Input<Shape>;
|
|
4970
5240
|
result: { [K in DefaultSelect]: Shape[K] };
|
|
4971
5241
|
returnType: undefined;
|
|
4972
5242
|
then: QueryThenShallowSimplifyArr<ColumnsShape.DefaultOutput<Shape>>;
|
|
@@ -5064,7 +5334,7 @@ type MapTableScopesOption<T> = T extends {
|
|
|
5064
5334
|
} ? {
|
|
5065
5335
|
nonDeleted: unknown;
|
|
5066
5336
|
} : EmptyObject;
|
|
5067
|
-
interface DbResult<ColumnTypes> extends Db<
|
|
5337
|
+
interface DbResult<ColumnTypes> extends Db<undefined, EmptyObject, never, never, never, never, ColumnTypes, never, never>, DbTableConstructor<ColumnTypes> {
|
|
5068
5338
|
adapterNotInTransaction: Adapter;
|
|
5069
5339
|
adapter: Adapter;
|
|
5070
5340
|
close: Adapter['close'];
|
|
@@ -5513,7 +5783,7 @@ interface OperatorToSQL {
|
|
|
5513
5783
|
interface Operator<Value, Column extends Column.Pick.OutputTypeAndOperators = Column.Pick.OutputTypeAndOperators> {
|
|
5514
5784
|
<T extends PickQueryResult>(this: T, arg: Value): { [K in Exclude<keyof T, keyof T['result']['value']['operators']>]: K extends 'result' ? {
|
|
5515
5785
|
value: Column;
|
|
5516
|
-
} : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<Column['
|
|
5786
|
+
} : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<Column['__outputType']> : T[K] } & Column['operators'];
|
|
5517
5787
|
_opType: Value;
|
|
5518
5788
|
}
|
|
5519
5789
|
interface Base$1<Value> {
|
|
@@ -6124,7 +6394,7 @@ interface SelectAsValue {
|
|
|
6124
6394
|
[K: string]: string | Query | Expression | undefined;
|
|
6125
6395
|
}
|
|
6126
6396
|
declare const getShapeFromSelect: (q: IsQuery, isSubQuery?: boolean) => Column.QueryColumns;
|
|
6127
|
-
type AfterHook<Select extends PropertyKey[], Shape extends Column.QueryColumns> = QueryAfterHook<{ [K in Select[number]]: K extends keyof Shape ? Shape[K]['
|
|
6397
|
+
type AfterHook<Select extends PropertyKey[], Shape extends Column.QueryColumns> = QueryAfterHook<{ [K in Select[number]]: K extends keyof Shape ? Shape[K]['__outputType'] : never }[]>;
|
|
6128
6398
|
type HookSelectArg<T extends PickQueryShape> = (keyof T['shape'] & string)[];
|
|
6129
6399
|
declare const _hookSelectColumns: (query: Query, columns: string[], asFn: (as: string[]) => void) => void;
|
|
6130
6400
|
declare class QueryHookUtils<T extends PickQueryInputType> {
|
|
@@ -6132,7 +6402,7 @@ declare class QueryHookUtils<T extends PickQueryInputType> {
|
|
|
6132
6402
|
columns: string[];
|
|
6133
6403
|
private key;
|
|
6134
6404
|
constructor(query: IsQuery, columns: string[], key: 'hookCreateSet' | 'hookUpdateSet');
|
|
6135
|
-
set: (data: { [K in keyof T["
|
|
6405
|
+
set: (data: { [K in keyof T["__inputType"]]?: T["__inputType"][K] | (() => QueryOrExpression<T["__inputType"][K]>) }) => void;
|
|
6136
6406
|
}
|
|
6137
6407
|
declare const _queryHookAfterCreate: <T extends PickQueryShape, S extends HookSelectArg<T>>(q: T, select: S, cb: AfterHook<S, T["shape"]>) => T;
|
|
6138
6408
|
declare const _queryHookAfterUpdate: <T extends PickQueryShape, S extends HookSelectArg<T>>(q: T, select: S, cb: AfterHook<S, T["shape"]>) => T;
|
|
@@ -6285,7 +6555,7 @@ interface ColumnDataSelectSqlProp {
|
|
|
6285
6555
|
interface SelectSqlCallback {
|
|
6286
6556
|
(column: ColumnRefExpression<Column.Pick.QueryColumn>): Expression;
|
|
6287
6557
|
}
|
|
6288
|
-
type SelectSqlColumn<T extends Column.Pick.DataAndDataType, Expr extends Expression> = unknown extends Expr['result']['value']['
|
|
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] };
|
|
6289
6559
|
declare namespace Column {
|
|
6290
6560
|
export namespace Modifiers {
|
|
6291
6561
|
export interface IsPrimaryKey<Name extends string> {
|
|
@@ -6298,9 +6568,9 @@ declare namespace Column {
|
|
|
6298
6568
|
unique: Name;
|
|
6299
6569
|
};
|
|
6300
6570
|
};
|
|
6301
|
-
export type Nullable<T extends Column.Pick.ForNullable, InputSchema, OutputSchema, QuerySchema> = { [K in keyof T]: K extends '
|
|
6302
|
-
export type QueryColumnToNullable<C> = { [K in keyof C]: K extends '
|
|
6303
|
-
export type QueryColumnToOptional<C> = { [K in keyof C]: K extends '
|
|
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] };
|
|
6304
6574
|
interface DataNullable {
|
|
6305
6575
|
isNullable: true;
|
|
6306
6576
|
optional: true;
|
|
@@ -6309,9 +6579,9 @@ declare namespace Column {
|
|
|
6309
6579
|
equals: Operator<T | null>;
|
|
6310
6580
|
not: Operator<T | null>;
|
|
6311
6581
|
}
|
|
6312
|
-
export type Encode<T, InputSchema, Input> = { [K in keyof T]: K extends '
|
|
6313
|
-
export type Parse<T extends Pick.ForParse, OutputSchema, Output> = { [K in keyof T]: K extends '
|
|
6314
|
-
export type ParseNull<T extends Column.Pick.ForParseNull, NullSchema, NullType> = { [K in keyof T]: K extends '
|
|
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] };
|
|
6315
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] };
|
|
6316
6586
|
export type Default<T extends Column.Pick.Data, Value> = { [K in keyof T]: K extends 'data' ? DefaultData<T['data'], Value> : T[K] };
|
|
6317
6587
|
type DefaultSelectData<T extends Column.Data, Value> = { [K in keyof T]: K extends 'explicitSelect' ? Value extends true ? false : true : T[K] };
|
|
@@ -6321,7 +6591,7 @@ declare namespace Column {
|
|
|
6321
6591
|
appReadOnly: true;
|
|
6322
6592
|
};
|
|
6323
6593
|
}
|
|
6324
|
-
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 '
|
|
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] };
|
|
6325
6595
|
export {};
|
|
6326
6596
|
}
|
|
6327
6597
|
export namespace Pick {
|
|
@@ -6329,17 +6599,17 @@ declare namespace Column {
|
|
|
6329
6599
|
data: Column.Data;
|
|
6330
6600
|
}
|
|
6331
6601
|
interface Type {
|
|
6332
|
-
|
|
6602
|
+
__type: unknown;
|
|
6333
6603
|
}
|
|
6334
6604
|
interface OutputType {
|
|
6335
|
-
|
|
6605
|
+
__outputType: unknown;
|
|
6336
6606
|
}
|
|
6337
6607
|
interface InputType {
|
|
6338
|
-
|
|
6608
|
+
__inputType: unknown;
|
|
6339
6609
|
}
|
|
6340
6610
|
interface DataAndInputType extends Data, InputType {}
|
|
6341
6611
|
interface NullType {
|
|
6342
|
-
|
|
6612
|
+
__nullType: unknown;
|
|
6343
6613
|
}
|
|
6344
6614
|
interface OutputTypeAndOperators extends OutputType {
|
|
6345
6615
|
operators: unknown;
|
|
@@ -6349,22 +6619,22 @@ declare namespace Column {
|
|
|
6349
6619
|
}
|
|
6350
6620
|
interface QueryColumn extends OutputType {
|
|
6351
6621
|
dataType: string;
|
|
6352
|
-
|
|
6353
|
-
|
|
6622
|
+
__type: unknown;
|
|
6623
|
+
__queryType: unknown;
|
|
6354
6624
|
operators: any;
|
|
6355
6625
|
}
|
|
6356
6626
|
interface QueryColumnOfType<T> {
|
|
6357
6627
|
dataType: string;
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6628
|
+
__type: T;
|
|
6629
|
+
__outputType: T;
|
|
6630
|
+
__queryType: T;
|
|
6361
6631
|
operators: any;
|
|
6362
6632
|
}
|
|
6363
6633
|
interface QueryColumnOfTypeAndOps<DataType, T, Ops> {
|
|
6364
6634
|
dataType: DataType;
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6635
|
+
__type: T;
|
|
6636
|
+
__outputType: T;
|
|
6637
|
+
__queryType: T;
|
|
6368
6638
|
operators: Ops;
|
|
6369
6639
|
}
|
|
6370
6640
|
interface QueryColumnOfDataType<T extends string> extends QueryColumn {
|
|
@@ -6384,8 +6654,8 @@ declare namespace Column {
|
|
|
6384
6654
|
querySchema: any;
|
|
6385
6655
|
}
|
|
6386
6656
|
interface ForNullable extends Data, Type, InputType, OutputType, TypeSchemas {
|
|
6387
|
-
|
|
6388
|
-
|
|
6657
|
+
__nullType: unknown;
|
|
6658
|
+
__queryType: unknown;
|
|
6389
6659
|
operators: unknown;
|
|
6390
6660
|
}
|
|
6391
6661
|
interface ForParse extends Type, NullType, NullSchema {}
|
|
@@ -6435,9 +6705,9 @@ declare namespace Column {
|
|
|
6435
6705
|
type StringOrMessage = string | Message;
|
|
6436
6706
|
}
|
|
6437
6707
|
export interface InputOutputQueryTypes {
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6708
|
+
__inputType: unknown;
|
|
6709
|
+
__outputType: unknown;
|
|
6710
|
+
__queryType: unknown;
|
|
6441
6711
|
}
|
|
6442
6712
|
export interface InputOutputQueryTypesWithSchemas extends InputOutputQueryTypes {
|
|
6443
6713
|
inputSchema: unknown;
|
|
@@ -6534,24 +6804,24 @@ declare const setDataValue: <T extends Column.Pick.Data, Key extends string, Val
|
|
|
6534
6804
|
declare function setCurrentColumnName(name: string): void;
|
|
6535
6805
|
declare const consumeColumnName: () => string | undefined;
|
|
6536
6806
|
declare const setDefaultLanguage: (lang?: string) => void;
|
|
6537
|
-
declare abstract class Column
|
|
6538
|
-
|
|
6539
|
-
outputSchema: OutputSchema;
|
|
6540
|
-
querySchema: QuerySchema;
|
|
6807
|
+
declare abstract class Column {
|
|
6808
|
+
abstract __schema: ColumnTypeSchemaArg;
|
|
6541
6809
|
abstract dataType: string;
|
|
6542
|
-
abstract operators:
|
|
6810
|
+
abstract operators: any;
|
|
6543
6811
|
abstract toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6812
|
+
abstract __type: unknown;
|
|
6813
|
+
abstract __inputType: unknown;
|
|
6814
|
+
abstract __outputType: unknown;
|
|
6815
|
+
abstract __queryType: unknown;
|
|
6816
|
+
__nullType: unknown;
|
|
6549
6817
|
nullSchema: unknown;
|
|
6550
|
-
|
|
6818
|
+
abstract inputSchema: unknown;
|
|
6819
|
+
abstract outputSchema: unknown;
|
|
6820
|
+
abstract querySchema: unknown;
|
|
6551
6821
|
data: Column.Data;
|
|
6552
|
-
error:
|
|
6822
|
+
error: this['__schema']['error'];
|
|
6553
6823
|
_parse?: (input: unknown) => unknown;
|
|
6554
|
-
constructor(schema: ColumnTypeSchemaArg, inputSchema:
|
|
6824
|
+
constructor(schema: ColumnTypeSchemaArg, inputSchema: unknown, outputSchema?: unknown, querySchema?: unknown);
|
|
6555
6825
|
/**
|
|
6556
6826
|
* Set a default value to a column. Columns that have defaults become optional when creating a record.
|
|
6557
6827
|
*
|
|
@@ -6578,7 +6848,7 @@ declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSch
|
|
|
6578
6848
|
*
|
|
6579
6849
|
* @param value - default value or a function returning a value
|
|
6580
6850
|
*/
|
|
6581
|
-
default<T extends Column.Pick.DataAndInputType, Value extends T['
|
|
6851
|
+
default<T extends Column.Pick.DataAndInputType, Value extends T['__inputType'] | null | RawSqlBase | (() => T['__inputType'])>(this: T, value: Value): Column.Modifiers.Default<T, Value>;
|
|
6582
6852
|
/**
|
|
6583
6853
|
* Use `hasDefault` to let the column be omitted when creating records.
|
|
6584
6854
|
*
|
|
@@ -6624,7 +6894,7 @@ declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSch
|
|
|
6624
6894
|
* }
|
|
6625
6895
|
* ```
|
|
6626
6896
|
*/
|
|
6627
|
-
nullable:
|
|
6897
|
+
nullable: this['__schema']['nullable'];
|
|
6628
6898
|
/**
|
|
6629
6899
|
* Set a custom function to process value for the column when creating or updating a record.
|
|
6630
6900
|
*
|
|
@@ -6660,7 +6930,7 @@ declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSch
|
|
|
6660
6930
|
*
|
|
6661
6931
|
* @param fn - function to encode value for a database, argument type is specified by you, return type must be compatible with a database
|
|
6662
6932
|
*/
|
|
6663
|
-
encode:
|
|
6933
|
+
encode: this['__schema']['encode'];
|
|
6664
6934
|
/**
|
|
6665
6935
|
* Set a custom function to process value after loading it from a database.
|
|
6666
6936
|
*
|
|
@@ -6698,7 +6968,7 @@ declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSch
|
|
|
6698
6968
|
*
|
|
6699
6969
|
* @param fn - function to parse a value from the database, argument is the type of this column, return type is up to you
|
|
6700
6970
|
*/
|
|
6701
|
-
parse:
|
|
6971
|
+
parse: this['__schema']['parse'];
|
|
6702
6972
|
/**
|
|
6703
6973
|
* Use `parseNull` to specify runtime defaults at selection time.
|
|
6704
6974
|
*
|
|
@@ -6743,7 +7013,7 @@ declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSch
|
|
|
6743
7013
|
* })
|
|
6744
7014
|
* ```
|
|
6745
7015
|
*/
|
|
6746
|
-
parseNull:
|
|
7016
|
+
parseNull: this['__schema']['parseNull'];
|
|
6747
7017
|
/**
|
|
6748
7018
|
* This method changes a column type without modifying its behavior.
|
|
6749
7019
|
* This is needed when converting columns to a validation schema, the converter will pick a different type specified by `.as`.
|
|
@@ -6763,17 +7033,17 @@ declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSch
|
|
|
6763
7033
|
* @param column - other column type to inherit from
|
|
6764
7034
|
*/
|
|
6765
7035
|
as<T extends {
|
|
6766
|
-
|
|
6767
|
-
|
|
7036
|
+
__inputType: unknown;
|
|
7037
|
+
__outputType: unknown;
|
|
6768
7038
|
data: Column.Data;
|
|
6769
7039
|
}, C extends {
|
|
6770
|
-
|
|
6771
|
-
|
|
7040
|
+
__inputType: T['__inputType'];
|
|
7041
|
+
__outputType: T['__outputType'];
|
|
6772
7042
|
}>(this: T, column: C): C;
|
|
6773
7043
|
/**
|
|
6774
7044
|
* @deprecated use narrowType instead
|
|
6775
7045
|
*/
|
|
6776
|
-
asType:
|
|
7046
|
+
asType: this['__schema']['asType'];
|
|
6777
7047
|
/**
|
|
6778
7048
|
* `narrowType` narrows TypeScript types of a column. It sets input, output, query type altogether.
|
|
6779
7049
|
*
|
|
@@ -6816,8 +7086,10 @@ declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSch
|
|
|
6816
7086
|
* // size will be typed as 'small' | 'medium' | 'large'
|
|
6817
7087
|
* const size = await db.table.get('size');
|
|
6818
7088
|
* ```
|
|
7089
|
+
*
|
|
7090
|
+
* @deprecated use `type` instead
|
|
6819
7091
|
*/
|
|
6820
|
-
narrowType:
|
|
7092
|
+
narrowType: this['__schema']['narrowType'];
|
|
6821
7093
|
/**
|
|
6822
7094
|
* Allows to narrow different TypeScript types of a column granularly.
|
|
6823
7095
|
*
|
|
@@ -6873,17 +7145,19 @@ declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSch
|
|
|
6873
7145
|
* // size will be typed as 'small' | 'medium' | 'large'
|
|
6874
7146
|
* const size = await db.table.get('size');
|
|
6875
7147
|
* ```
|
|
7148
|
+
*
|
|
7149
|
+
* @deprecated use `type`, `inputType`, `outputType`, `queryType` instead
|
|
6876
7150
|
*/
|
|
6877
|
-
narrowAllTypes:
|
|
7151
|
+
narrowAllTypes: this['__schema']['narrowAllTypes'];
|
|
6878
7152
|
input<T extends {
|
|
6879
7153
|
inputSchema: unknown;
|
|
6880
|
-
}, InputSchema extends
|
|
7154
|
+
}, InputSchema extends this['__schema']['__schemaType']>(this: T, fn: (schema: T['inputSchema']) => InputSchema): { [K in keyof T]: K extends 'inputSchema' ? InputSchema : T[K] };
|
|
6881
7155
|
output<T extends {
|
|
6882
7156
|
outputSchema: unknown;
|
|
6883
|
-
}, OutputSchema extends
|
|
7157
|
+
}, OutputSchema extends this['__schema']['__schemaType']>(this: T, fn: (schema: T['outputSchema']) => OutputSchema): { [K in keyof T]: K extends 'outputSchema' ? OutputSchema : T[K] };
|
|
6884
7158
|
query<T extends {
|
|
6885
7159
|
querySchema: unknown;
|
|
6886
|
-
}, QuerySchema extends
|
|
7160
|
+
}, QuerySchema extends this['__schema']['__schemaType']>(this: T, fn: (schema: T['querySchema']) => QuerySchema): { [K in keyof T]: K extends 'querySchema' ? QuerySchema : T[K] };
|
|
6887
7161
|
/**
|
|
6888
7162
|
* Set a database column name.
|
|
6889
7163
|
*
|
|
@@ -6977,7 +7251,7 @@ declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSch
|
|
|
6977
7251
|
* }
|
|
6978
7252
|
* ```
|
|
6979
7253
|
*/
|
|
6980
|
-
setOnCreate<T extends Column.Pick.QueryInit>(this: T, fn: (arg: QueryHookUtils<PickQueryInputType>) => T['
|
|
7254
|
+
setOnCreate<T extends Column.Pick.QueryInit>(this: T, fn: (arg: QueryHookUtils<PickQueryInputType>) => T['__inputType'] | void): T;
|
|
6981
7255
|
/**
|
|
6982
7256
|
* Set a column value when updating a record.
|
|
6983
7257
|
* This works for [readOnly](#readonly) columns as well.
|
|
@@ -6994,7 +7268,7 @@ declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSch
|
|
|
6994
7268
|
* }
|
|
6995
7269
|
* ```
|
|
6996
7270
|
*/
|
|
6997
|
-
setOnUpdate<T extends Column.Pick.QueryInit>(this: T, fn: (arg: QueryHookUtils<PickQueryInputType>) => T['
|
|
7271
|
+
setOnUpdate<T extends Column.Pick.QueryInit>(this: T, fn: (arg: QueryHookUtils<PickQueryInputType>) => T['__inputType'] | void): T;
|
|
6998
7272
|
/**
|
|
6999
7273
|
* Set a column value when creating or updating a record.
|
|
7000
7274
|
* This works for [readOnly](#readonly) columns as well.
|
|
@@ -7011,7 +7285,7 @@ declare abstract class Column<Schema extends ColumnTypeSchemaArg = ColumnTypeSch
|
|
|
7011
7285
|
* }
|
|
7012
7286
|
* ```
|
|
7013
7287
|
*/
|
|
7014
|
-
setOnSave<T extends Column.Pick.QueryInit>(this: T, fn: (arg: QueryHookUtils<PickQueryInputType>) => T['
|
|
7288
|
+
setOnSave<T extends Column.Pick.QueryInit>(this: T, fn: (arg: QueryHookUtils<PickQueryInputType>) => T['__inputType'] | void): T;
|
|
7015
7289
|
/**
|
|
7016
7290
|
* Mark the column as a primary key.
|
|
7017
7291
|
* This column type becomes an argument of the `.find` method.
|
|
@@ -7531,11 +7805,11 @@ declare class QueryCreateFrom {
|
|
|
7531
7805
|
}
|
|
7532
7806
|
interface CreateSelf extends PickQueryHasSelect, PickQueryDefaults, PickQueryResult, PickQueryRelations, PickQueryWithData, PickQueryReturnType, PickQueryShape, PickQueryUniqueProperties, PickQueryInputType, Query.Pick.IsNotReadOnly {}
|
|
7533
7807
|
type CreateData<T extends CreateSelf> = EmptyObject extends T['relations'] ? CreateDataWithDefaults<T, keyof T['__defaults']> : CreateRelationsData<T>;
|
|
7534
|
-
type CreateDataWithDefaults<T extends CreateSelf, Defaults extends PropertyKey> = { [K in keyof T['
|
|
7535
|
-
type CreateDataWithDefaultsForRelations<T extends CreateSelf, Defaults extends keyof T['
|
|
7536
|
-
type CreateColumn<T extends CreateSelf, K extends keyof T['
|
|
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]>);
|
|
7537
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']>;
|
|
7538
|
-
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['
|
|
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;
|
|
7539
7813
|
type CreateResult<T extends CreateSelf, Data> = T extends {
|
|
7540
7814
|
isCount: true;
|
|
7541
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>>;
|
|
@@ -7550,7 +7824,7 @@ type InsertManyResult<T extends CreateSelf> = T['__hasSelect'] extends true ? T[
|
|
|
7550
7824
|
*
|
|
7551
7825
|
* The same should work as well with any non-null columns passed to `create`, but it's to be implemented later.
|
|
7552
7826
|
*/
|
|
7553
|
-
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]['
|
|
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] };
|
|
7554
7828
|
type IgnoreResult<T extends CreateSelf> = T['returnType'] extends 'oneOrThrow' ? QueryTakeOptional<T> : T['returnType'] extends 'valueOrThrow' ? SetQueryReturnsColumnOptional<T, T['result']['value']> : T;
|
|
7555
7829
|
type OnConflictArg<T extends PickQueryUniqueProperties> = T['internal']['uniqueColumnNames'] | T['internal']['uniqueColumnTuples'] | Expression | {
|
|
7556
7830
|
constraint: T['internal']['uniqueConstraints'];
|
|
@@ -7577,7 +7851,7 @@ declare const _queryDefaults: <T extends CreateSelf, Data extends Partial<Create
|
|
|
7577
7851
|
*/
|
|
7578
7852
|
type CreateMethodsNames = 'create' | 'insert' | 'createMany' | 'insertMany' | CreateFromMethodNames;
|
|
7579
7853
|
type CreateManyMethodsNames = 'createMany' | 'insertMany' | CreateManyFromMethodNames;
|
|
7580
|
-
type ExtraPropertiesAreNotAllowed<T extends CreateSelf, Data> = keyof Data extends keyof T['
|
|
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}`;
|
|
7581
7855
|
declare class QueryCreate {
|
|
7582
7856
|
/**
|
|
7583
7857
|
* `create` and `insert` create a single record.
|
|
@@ -7851,7 +8125,7 @@ declare class QueryCreate {
|
|
|
7851
8125
|
*/
|
|
7852
8126
|
onConflictDoNothing<T extends CreateSelf, Arg extends OnConflictArg<T>>(this: T, arg?: Arg): IgnoreResult<T>;
|
|
7853
8127
|
}
|
|
7854
|
-
type OnConflictSet$1<T extends CreateSelf> = { [K in keyof T['
|
|
8128
|
+
type OnConflictSet$1<T extends CreateSelf> = { [K in keyof T['__inputType']]?: T['__inputType'][K] | (() => QueryOrExpression<T['__inputType'][K]>) };
|
|
7855
8129
|
declare class OnConflictQueryBuilder<T extends CreateSelf, Arg extends OnConflictArg<T> | undefined> {
|
|
7856
8130
|
private query;
|
|
7857
8131
|
private onConflict;
|
|
@@ -7920,11 +8194,11 @@ declare class OnConflictQueryBuilder<T extends CreateSelf, Arg extends OnConflic
|
|
|
7920
8194
|
}): T;
|
|
7921
8195
|
}
|
|
7922
8196
|
interface UpdateSelf extends PickQuerySelectable, PickQueryResult, PickQueryRelations, PickQueryWithData, PickQueryReturnType, PickQueryShape, PickQueryInputType, PickQueryAs, PickQueryHasSelect, PickQueryHasWhere, Query.Pick.IsNotReadOnly {}
|
|
7923
|
-
type UpdateData<T extends UpdateSelf> = { [K in keyof T['
|
|
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'] };
|
|
7924
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()`';
|
|
7925
8199
|
type UpdateResult<T extends UpdateSelf> = T['__hasSelect'] extends true ? T : T['returnType'] extends undefined | 'all' ? SetQueryReturnsRowCountMany<T> : SetQueryReturnsRowCount<T>;
|
|
7926
|
-
type NumericColumns<T extends UpdateSelf> = { [K in keyof T['
|
|
7927
|
-
type ChangeCountArg<T extends UpdateSelf> = NumericColumns<T> | { [K in NumericColumns<T>]?: T['shape'][K]['
|
|
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 };
|
|
7928
8202
|
interface UpdateManyBySelf extends UpdateSelf {
|
|
7929
8203
|
internal: {
|
|
7930
8204
|
uniqueColumns: unknown;
|
|
@@ -7933,10 +8207,10 @@ interface UpdateManyBySelf extends UpdateSelf {
|
|
|
7933
8207
|
uniqueConstraints: unknown;
|
|
7934
8208
|
};
|
|
7935
8209
|
}
|
|
7936
|
-
type UpdateManyData<T extends UpdateSelf> = ({ [K in keyof T['shape'] as T['shape'][K] extends Column.Modifiers.IsPrimaryKey<string> ? K : never]: T['shape'][K]['
|
|
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 })[];
|
|
7937
8211
|
type UpdateManyByKeys<T extends UpdateManyBySelf> = T['internal']['uniqueColumnNames'] | T['internal']['uniqueColumnTuples'];
|
|
7938
8212
|
type UpdateManyByKeyColumns<K> = K extends string[] ? K[number] : K;
|
|
7939
|
-
type UpdateManyByData<T extends UpdateSelf, K> = ({ [P in K & keyof T['
|
|
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 })[];
|
|
7940
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>;
|
|
7941
8215
|
declare const _queryUpdate: <T extends UpdateSelf>(updateSelf: T, arg: UpdateArg<T>) => UpdateResult<T>;
|
|
7942
8216
|
declare const _queryUpdateOrThrow: <T extends UpdateSelf>(q: T, arg: UpdateArg<T>) => UpdateResult<T>;
|
|
@@ -8383,8 +8657,16 @@ declare class QueryUpdate {
|
|
|
8383
8657
|
*/
|
|
8384
8658
|
updateManyByOptional<T extends UpdateManyBySelf, Keys extends UpdateManyByKeys<T>, K = UpdateManyByKeyColumns<Keys>>(this: T, keys: Keys, data: UpdateManyByData<T, K>): UpdateManyResult<T> & QueryHasWhere;
|
|
8385
8659
|
}
|
|
8386
|
-
declare abstract class VirtualColumn<Schema extends ColumnSchemaConfig, InputSchema extends Schema['
|
|
8660
|
+
declare abstract class VirtualColumn<Schema extends ColumnSchemaConfig, InputSchema extends Schema['__schemaType'] = ReturnType<Schema['never']>> extends Column {
|
|
8661
|
+
__schema: Schema;
|
|
8387
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']>;
|
|
8388
8670
|
operators: OperatorsAny;
|
|
8389
8671
|
constructor(schema: Schema, inputSchema?: InputSchema);
|
|
8390
8672
|
toCode(): never;
|
|
@@ -8421,20 +8703,20 @@ interface ComputedOptionsConfig {
|
|
|
8421
8703
|
type ComputedOptionsFactory<ColumnTypes, Shape extends Column.QueryColumns> = (t: ComputedMethods<ColumnTypes, Shape>) => ComputedOptionsConfig;
|
|
8422
8704
|
interface RuntimeComputedQueryColumn<OutputType> extends Column.Pick.QueryColumn {
|
|
8423
8705
|
dataType: 'runtimeComputed';
|
|
8424
|
-
|
|
8425
|
-
|
|
8426
|
-
|
|
8706
|
+
__type: never;
|
|
8707
|
+
__outputType: OutputType;
|
|
8708
|
+
__queryType: undefined;
|
|
8427
8709
|
operators: {
|
|
8428
8710
|
cannotQueryRuntimeComputed: never;
|
|
8429
8711
|
};
|
|
8430
8712
|
}
|
|
8431
8713
|
interface ComputedMethods<ColumnTypes, Shape extends Column.QueryColumns> extends QueryComputedArg<ColumnTypes, Shape> {
|
|
8432
|
-
computeAtRuntime<Deps extends keyof Shape, OutputType>(dependsOn: Deps[], fn: (record: { [K in keyof Shape & Deps]: Shape[K]['
|
|
8714
|
+
computeAtRuntime<Deps extends keyof Shape, OutputType>(dependsOn: Deps[], fn: (record: { [K in keyof Shape & Deps]: Shape[K]['__outputType'] }) => OutputType): {
|
|
8433
8715
|
result: {
|
|
8434
8716
|
value: RuntimeComputedQueryColumn<OutputType>;
|
|
8435
8717
|
};
|
|
8436
8718
|
};
|
|
8437
|
-
computeBatchAtRuntime<Deps extends keyof Shape, OutputType>(dependsOn: Deps[], fn: (record: { [K in keyof Shape & Deps]: Shape[K]['
|
|
8719
|
+
computeBatchAtRuntime<Deps extends keyof Shape, OutputType>(dependsOn: Deps[], fn: (record: { [K in keyof Shape & Deps]: Shape[K]['__outputType'] }[]) => MaybePromise<OutputType[]>): {
|
|
8438
8720
|
result: {
|
|
8439
8721
|
value: RuntimeComputedQueryColumn<OutputType>;
|
|
8440
8722
|
};
|
|
@@ -8840,7 +9122,7 @@ interface ToSQLQuery extends IsQuery {
|
|
|
8840
9122
|
}
|
|
8841
9123
|
interface FromQuerySelf extends PickQuerySelectable, PickQueryShape, PickQueryReturnType, PickQueryWithData, PickQueryAs, PickQueryHasSelect {}
|
|
8842
9124
|
type FromArg<T extends FromQuerySelf> = IsQuery | Exclude<keyof T['withData'], symbol | number>;
|
|
8843
|
-
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 '
|
|
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}`]: {
|
|
8844
9126
|
as: K;
|
|
8845
9127
|
column: T['withData'][A]['shape'][K];
|
|
8846
9128
|
} } : never : A extends PickQueryResultAs ? { [K in keyof A['result'] & string as `${A['__as']}.${K}`]: K extends string ? {
|
|
@@ -9181,7 +9463,7 @@ declare class CteQuery {
|
|
|
9181
9463
|
}
|
|
9182
9464
|
type UnionArgs<T extends PickQueryResult> = ({
|
|
9183
9465
|
result: { [K in keyof T['result']]: {
|
|
9184
|
-
|
|
9466
|
+
__queryType: T['result'][K]['__queryType'];
|
|
9185
9467
|
} };
|
|
9186
9468
|
} | ((q: T) => Expression))[];
|
|
9187
9469
|
declare class Union {
|
|
@@ -9305,7 +9587,7 @@ declare class Clear {
|
|
|
9305
9587
|
type HavingArgFn<T> = (q: T) => {
|
|
9306
9588
|
result: {
|
|
9307
9589
|
value: {
|
|
9308
|
-
|
|
9590
|
+
__outputType: boolean;
|
|
9309
9591
|
};
|
|
9310
9592
|
};
|
|
9311
9593
|
};
|
|
@@ -9535,7 +9817,7 @@ interface QueryPluckSelf extends PickQuerySelectable, PickQueryRelationsWithData
|
|
|
9535
9817
|
type PluckArg<T extends QueryPluckSelf> = SelectableOrExpression<T> | ((q: SelectAsFnArg<T>) => Expression | Query.Pick.SingleValueResult);
|
|
9536
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' ? {
|
|
9537
9819
|
pluck: R['result']['value'];
|
|
9538
|
-
} : K extends 'returnType' ? 'pluck' : K extends 'then' ? QueryThen<R['result']['value']['
|
|
9820
|
+
} : K extends 'returnType' ? 'pluck' : K extends 'then' ? QueryThen<R['result']['value']['__outputType'][]> : T[K] } : never : S extends SelectableOrExpression<T> ? SetQueryReturnsPluck<T, S> : never;
|
|
9539
9821
|
declare class QueryPluck {
|
|
9540
9822
|
/**
|
|
9541
9823
|
* `.pluck` returns a single array of a single selected column values:
|
|
@@ -9808,15 +10090,15 @@ type QueryHelperResult<T extends IsQueryHelper> = T['__result'];
|
|
|
9808
10090
|
interface NarrowTypeSelf extends PickQueryResultReturnType {
|
|
9809
10091
|
returnType: undefined | 'all' | 'one' | 'oneOrThrow' | 'value' | 'valueOrThrow' | 'pluck';
|
|
9810
10092
|
}
|
|
9811
|
-
type NarrowInvalidKeys<T extends PickQueryResult, Narrow> = { [K in keyof Narrow]: K extends keyof T['result'] ? Narrow[K] extends T['result'][K]['
|
|
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];
|
|
9812
10094
|
interface NarrowValueTypeResult<T extends PickQueryResultReturnType, Narrow> extends Column.QueryColumns {
|
|
9813
|
-
value: { [K in keyof T['result']['value']]: K extends '
|
|
10095
|
+
value: { [K in keyof T['result']['value']]: K extends '__outputType' ? Narrow : T['result']['value'][K] };
|
|
9814
10096
|
}
|
|
9815
10097
|
interface NarrowPluckTypeResult<T extends PickQueryResultReturnType, Narrow> extends Column.QueryColumns {
|
|
9816
|
-
pluck: { [K in keyof T['result']['pluck']]: K extends '
|
|
10098
|
+
pluck: { [K in keyof T['result']['pluck']]: K extends '__outputType' ? Narrow extends unknown[] ? Narrow[number] : Narrow : T['result']['pluck'][K] };
|
|
9817
10099
|
}
|
|
9818
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] };
|
|
9819
|
-
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]['
|
|
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>;
|
|
9820
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 {}
|
|
9821
10103
|
declare class QueryMethods<ColumnTypes> {
|
|
9822
10104
|
/**
|
|
@@ -10247,10 +10529,10 @@ declare class QueryMethods<ColumnTypes> {
|
|
|
10247
10529
|
* ```
|
|
10248
10530
|
*/
|
|
10249
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]: {
|
|
10250
|
-
|
|
10532
|
+
__outputType: Narrow[K];
|
|
10251
10533
|
} } : K extends 'then' ? QueryThenByQuery<T, T['result'] & { [K in keyof Narrow]: {
|
|
10252
|
-
|
|
10253
|
-
} }> : 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']['
|
|
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';
|
|
10254
10536
|
if<T extends PickQueryResultReturnType, R extends PickQueryResult>(this: T, condition: boolean | null | undefined, fn: (q: T) => R & {
|
|
10255
10537
|
returnType: T['returnType'];
|
|
10256
10538
|
}): QueryIfResult<T, R>;
|
|
@@ -10324,7 +10606,7 @@ interface Query extends IsQuery, PickQueryTable, PickQueryShape, PickQuerySelect
|
|
|
10324
10606
|
returnType: QueryReturnType;
|
|
10325
10607
|
qb: QueryBuilder;
|
|
10326
10608
|
columnTypes: unknown;
|
|
10327
|
-
|
|
10609
|
+
__inputType: RecordUnknown;
|
|
10328
10610
|
q: QueryData;
|
|
10329
10611
|
then: QueryThen<unknown>;
|
|
10330
10612
|
catch: QueryCatch;
|
|
@@ -10361,43 +10643,43 @@ declare namespace Query {
|
|
|
10361
10643
|
}
|
|
10362
10644
|
}
|
|
10363
10645
|
}
|
|
10364
|
-
type SelectableOfType<T extends PickQuerySelectable, Type> = { [K in keyof T['__selectable']]: T['__selectable'][K]['column']['
|
|
10365
|
-
type SelectableOrExpressionOfType<T extends PickQuerySelectable, C extends Column.Pick.Type> = SelectableOfType<T, C['
|
|
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>>;
|
|
10366
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;
|
|
10367
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;
|
|
10368
|
-
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']['
|
|
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] };
|
|
10369
10651
|
type QueryManyTakeOptional<T extends PickQueryResultReturnType> = { [K in keyof T]: K extends 'returnType' ? 'one' : K extends 'then' ? QueryThenShallowSimplifyOptional<ColumnsShape.Output<T['result']>> : T[K] };
|
|
10370
|
-
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']['
|
|
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] };
|
|
10371
10653
|
type QueryManyTake<T extends PickQueryResultReturnType> = { [K in keyof T]: K extends 'returnType' ? 'oneOrThrow' : K extends 'then' ? QueryThenShallowSimplify<ColumnsShape.Output<T['result']>> : T[K] };
|
|
10372
10654
|
type SetQueryReturnsOne<T extends PickQueryResult> = { [K in keyof T]: K extends 'returnType' ? 'oneOrThrow' : K extends 'then' ? QueryThenShallowSimplify<ColumnsShape.Output<T['result']>> : T[K] };
|
|
10373
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] };
|
|
10374
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] };
|
|
10375
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' ? {
|
|
10376
10658
|
pluck: T['__selectable'][S]['column'];
|
|
10377
|
-
} : K extends 'returnType' ? 'pluck' : K extends 'then' ? QueryThen<T['__selectable'][S]['column']['
|
|
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' ? {
|
|
10378
10660
|
pluck: S extends Expression ? S['result']['value'] : never;
|
|
10379
|
-
} : K extends 'returnType' ? 'pluck' : K extends 'then' ? QueryThen<(S extends Expression ? S['result']['value']['
|
|
10661
|
+
} : K extends 'returnType' ? 'pluck' : K extends 'then' ? QueryThen<(S extends Expression ? S['result']['value']['__outputType'] : never)[]> : T[K] };
|
|
10380
10662
|
type SetValueQueryReturnsPluckColumn<T extends PickQueryResult> = { [K in keyof T]: K extends 'result' ? {
|
|
10381
10663
|
pluck: T['result']['value'];
|
|
10382
|
-
} : K extends 'returnType' ? 'pluck' : K extends 'then' ? QueryThen<T['result']['value']['
|
|
10664
|
+
} : K extends 'returnType' ? 'pluck' : K extends 'then' ? QueryThen<T['result']['value']['__outputType'][]> : T[K] } & QueryHasSelect;
|
|
10383
10665
|
type SetQueryReturnsPluckColumnResult<T extends PickQueryResult, Result extends Column.QueryColumns> = { [K in keyof T]: K extends 'result' ? {
|
|
10384
10666
|
pluck: T['result']['value'];
|
|
10385
|
-
} : K extends 'returnType' ? 'pluck' : K extends 'result' ? Result : K extends 'then' ? QueryThen<T['result']['value']['
|
|
10667
|
+
} : K extends 'returnType' ? 'pluck' : K extends 'result' ? Result : K extends 'then' ? QueryThen<T['result']['value']['__outputType'][]> : T[K] } & QueryHasSelect;
|
|
10386
10668
|
type SetQueryReturnsValueOrThrow<T extends PickQuerySelectable, Arg extends keyof T['__selectable']> = SetQueryReturnsColumnOrThrow<T, T['__selectable'][Arg]['column']> & T['__selectable'][Arg]['column']['operators'];
|
|
10387
|
-
type SetValueQueryReturnsValueOrThrow<T extends PickQueryResult> = { [K in keyof T]: K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<T['result']['value']['
|
|
10388
|
-
type SetQueryReturnsValueOptional<T extends PickQuerySelectable, Arg extends GetStringArg<T>> = SetQueryReturnsColumnOptional<T, { [K in keyof T['__selectable'][Arg]['column']]: K extends '
|
|
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']>;
|
|
10389
10671
|
type SetQueryReturnsColumnOrThrow<T, Column extends Column.Pick.OutputType> = { [K in keyof T]: K extends 'result' ? {
|
|
10390
10672
|
value: Column;
|
|
10391
|
-
} : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<Column['
|
|
10673
|
+
} : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<Column['__outputType']> : T[K] } & QueryHasSelect;
|
|
10392
10674
|
type SetQueryReturnsColumnOptional<T, Column extends Column.Pick.OutputType> = { [K in keyof T]: K extends 'result' ? {
|
|
10393
10675
|
value: Column;
|
|
10394
|
-
} : K extends 'returnType' ? 'value' : K extends 'then' ? QueryThen<Column['
|
|
10676
|
+
} : K extends 'returnType' ? 'value' : K extends 'then' ? QueryThen<Column['__outputType'] | undefined> : T[K] } & QueryHasSelect;
|
|
10395
10677
|
type SetQueryReturnsColumn<T extends PickQueryResult> = { [K in keyof T]: K extends 'result' ? {
|
|
10396
10678
|
value: T['result']['pluck'];
|
|
10397
|
-
} : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<T['result']['pluck']['
|
|
10679
|
+
} : K extends 'returnType' ? 'valueOrThrow' : K extends 'then' ? QueryThen<T['result']['pluck']['__outputType']> : T[K] } & QueryHasSelect;
|
|
10398
10680
|
type SetQueryReturnsColumnResult<T extends PickQueryResult, Result extends Column.QueryColumns> = { [K in keyof T]: K extends 'result' ? {
|
|
10399
10681
|
value: T['result']['pluck'];
|
|
10400
|
-
} : K extends 'returnType' ? 'valueOrThrow' : K extends 'result' ? Result : K extends 'then' ? QueryThen<Result['pluck']['
|
|
10682
|
+
} : K extends 'returnType' ? 'valueOrThrow' : K extends 'result' ? Result : K extends 'then' ? QueryThen<Result['pluck']['__outputType']> : T[K] } & QueryHasSelect;
|
|
10401
10683
|
type SetQueryReturnsRowCount<T extends PickQueryResult> = { [K in keyof T]: K extends 'returnType' ? 'valueOrThrow' : K extends 'result' ? {
|
|
10402
10684
|
value: Column.Pick.QueryColumnOfType<number>;
|
|
10403
10685
|
} : K extends 'then' ? QueryThen<number> : T[K] };
|
|
@@ -10518,7 +10800,7 @@ interface PickQueryUniqueProperties {
|
|
|
10518
10800
|
};
|
|
10519
10801
|
}
|
|
10520
10802
|
interface PickQueryInputType {
|
|
10521
|
-
|
|
10803
|
+
__inputType: RecordUnknown;
|
|
10522
10804
|
}
|
|
10523
10805
|
interface PickQueryWithData {
|
|
10524
10806
|
withData: WithDataItems;
|
|
@@ -10761,4 +11043,4 @@ declare const testTransaction: {
|
|
|
10761
11043
|
*/
|
|
10762
11044
|
close(arg: Arg$1): Promise<void>;
|
|
10763
11045
|
};
|
|
10764
|
-
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, 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 };
|
|
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 };
|