pqb 0.0.4 → 0.0.6
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 +134 -2
- package/dist/index.esm.js +202 -202
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +225 -201
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/columnSchema/json/index.ts +19 -0
- package/src/columnSchema/json.ts +23 -19
- package/src/db.ts +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1129,7 +1129,99 @@ declare type DbOptions<CT extends ColumnTypesBase = ColumnTypes> = ({
|
|
|
1129
1129
|
} | Omit<AdapterOptions, 'log'>) & QueryLogOptions & {
|
|
1130
1130
|
columnTypes?: CT;
|
|
1131
1131
|
};
|
|
1132
|
-
declare const createDb: <CT extends ColumnTypesBase
|
|
1132
|
+
declare const createDb: <CT extends ColumnTypesBase = {
|
|
1133
|
+
smallint: () => SmallIntColumn;
|
|
1134
|
+
integer: () => IntegerColumn;
|
|
1135
|
+
bigint: () => BigIntColumn;
|
|
1136
|
+
numeric: <Precision extends number | undefined = undefined, Scale extends number | undefined = undefined>(precision?: Precision | undefined, scale?: Scale | undefined) => DecimalColumn<Precision, Scale>;
|
|
1137
|
+
decimal: <Precision_1 extends number | undefined = undefined, Scale_1 extends number | undefined = undefined>(precision?: Precision_1 | undefined, scale?: Scale_1 | undefined) => DecimalColumn<Precision_1, Scale_1>;
|
|
1138
|
+
real: () => RealColumn;
|
|
1139
|
+
doublePrecision: () => DoublePrecisionColumn;
|
|
1140
|
+
smallSerial: () => SmallSerialColumn;
|
|
1141
|
+
serial: () => SerialColumn;
|
|
1142
|
+
bigSerial: () => BigSerialColumn;
|
|
1143
|
+
money: () => MoneyColumn;
|
|
1144
|
+
varchar: <Limit extends number | undefined = undefined>(limit?: Limit | undefined) => VarCharColumn<Limit>;
|
|
1145
|
+
char: <Limit_1 extends number | undefined = undefined>(limit?: Limit_1 | undefined) => CharColumn<Limit_1>;
|
|
1146
|
+
text: () => TextColumn;
|
|
1147
|
+
string: () => TextColumn;
|
|
1148
|
+
bytea: () => ByteaColumn;
|
|
1149
|
+
date: () => DateColumn;
|
|
1150
|
+
timestamp: <Precision_2 extends number | undefined = undefined>(precision?: Precision_2 | undefined) => TimestampColumn<Precision_2>;
|
|
1151
|
+
timestampWithTimeZone: <Precision_3 extends number | undefined = undefined>(precision?: Precision_3 | undefined) => TimestampWithTimeZoneColumn<Precision_3>;
|
|
1152
|
+
time: <Precision_4 extends number | undefined = undefined>(precision?: Precision_4 | undefined) => TimeColumn<Precision_4>;
|
|
1153
|
+
timeWithTimeZone: <Precision_5 extends number | undefined = undefined>(precision?: Precision_5 | undefined) => TimeWithTimeZoneColumn<Precision_5>;
|
|
1154
|
+
interval: <Fields extends string | undefined = undefined, Precision_6 extends number | undefined = undefined>(fields?: Fields | undefined, precision?: Precision_6 | undefined) => IntervalColumn<Fields, Precision_6>;
|
|
1155
|
+
boolean: () => BooleanColumn;
|
|
1156
|
+
enum: <U extends string, T extends [U, ...U[]]>(dataType: string, type: T) => EnumColumn<U, T>;
|
|
1157
|
+
point: () => PointColumn;
|
|
1158
|
+
line: () => LineColumn;
|
|
1159
|
+
lseg: () => LsegColumn;
|
|
1160
|
+
box: () => BoxColumn;
|
|
1161
|
+
path: () => PathColumn;
|
|
1162
|
+
polygon: () => PolygonColumn;
|
|
1163
|
+
circle: () => CircleColumn;
|
|
1164
|
+
cidr: () => CidrColumn;
|
|
1165
|
+
inet: () => InetColumn;
|
|
1166
|
+
macaddr: () => MacAddrColumn;
|
|
1167
|
+
macaddr8: () => MacAddr8Column;
|
|
1168
|
+
bit: <Length extends number>(length: Length) => BitColumn<Length>;
|
|
1169
|
+
bitVarying: <Length_1 extends number | undefined = undefined>(length?: Length_1 | undefined) => BitVaryingColumn<Length_1 | undefined>;
|
|
1170
|
+
tsvector: () => TsVectorColumn;
|
|
1171
|
+
tsquery: () => TsQueryColumn;
|
|
1172
|
+
uuid: () => UUIDColumn;
|
|
1173
|
+
xml: () => XMLColumn;
|
|
1174
|
+
json: <Type extends JSONTypeAny>(schemaOrFn: Type | ((j: {
|
|
1175
|
+
set: <Value extends JSONTypeAny>(valueType: Value) => JSONSet<Value>;
|
|
1176
|
+
tuple: <T_1 extends [] | JSONTupleItems, Rest extends JSONTypeAny | null = null>(items: T_1, rest?: Rest) => JSONTuple<T_1, Rest>;
|
|
1177
|
+
union: <T_2 extends [JSONTypeAny, JSONTypeAny, ...JSONTypeAny[]]>(types: T_2) => JSONUnion<T_2>;
|
|
1178
|
+
any: () => JSONAny;
|
|
1179
|
+
bigint: () => JSONBigInt;
|
|
1180
|
+
boolean: () => JSONBoolean;
|
|
1181
|
+
date: () => JSONDate;
|
|
1182
|
+
nan: () => JSONNaN;
|
|
1183
|
+
never: () => JSONNever;
|
|
1184
|
+
null: () => JSONNull;
|
|
1185
|
+
number: () => JSONNumber;
|
|
1186
|
+
string: () => JSONString;
|
|
1187
|
+
undefined: () => JSONUndefined;
|
|
1188
|
+
unknown: () => JSONUnknown;
|
|
1189
|
+
void: () => JSONVoid;
|
|
1190
|
+
array: <Type_1 extends JSONTypeAny>(element: Type_1) => JSONArray<Type_1, "many">;
|
|
1191
|
+
discriminatedUnion: <Discriminator extends string, DiscriminatorValue extends Primitive, Types extends [JSONDiscriminatedObject<Discriminator, DiscriminatorValue>, JSONDiscriminatedObject<Discriminator, DiscriminatorValue>, ...JSONDiscriminatedObject<Discriminator, DiscriminatorValue>[]]>(discriminator: Discriminator, options: Types) => JSONDiscriminatedUnion<Discriminator, DiscriminatorValue, Types[number]>;
|
|
1192
|
+
enum: <U_1 extends string, T_3 extends [U_1, ...U_1[]]>(options: T_3) => JSONEnum<U_1, T_3>;
|
|
1193
|
+
instanceOf: <T_4 extends new (...args: any[]) => any>(cls: T_4) => JSONInstanceOf<T_4>;
|
|
1194
|
+
intersection: <Left extends JSONTypeAny, Right extends JSONTypeAny>(left: Left, right: Right) => JSONIntersection<Left, Right>;
|
|
1195
|
+
lazy: <T_5 extends JSONTypeAny>(fn: () => T_5) => JSONLazy<T_5>;
|
|
1196
|
+
literal: <T_6 extends Primitive>(value: T_6) => JSONLiteral<T_6>;
|
|
1197
|
+
map: <Key extends JSONTypeAny, Value_1 extends JSONTypeAny>(keyType: Key, valueType: Value_1) => JSONMap<Key, Value_1>;
|
|
1198
|
+
nativeEnum: <T_7 extends EnumLike>(givenEnum: T_7) => JSONNativeEnum<T_7>;
|
|
1199
|
+
nullable: <T_8 extends JSONTypeAny>(type: T_8) => JSONNullable<T_8>;
|
|
1200
|
+
nullish: <T_9 extends JSONTypeAny>(type: T_9) => JSONNullish<T_9>;
|
|
1201
|
+
object: <T_10 extends JSONObjectShape, UnknownKeys extends UnknownKeysParam = "strip", Catchall extends JSONTypeAny = JSONTypeAny>(shape: T_10) => JSONObject<T_10, UnknownKeys, Catchall, JSONTypeAny extends Catchall ? addQuestionMarks<{ [k_1 in keyof T_10]: T_10[k_1]["type"]; }> extends infer T_11 ? { [k in keyof T_11]: addQuestionMarks<{ [k_1 in keyof T_10]: T_10[k_1]["type"]; }>[k]; } : never : (addQuestionMarks<{ [k_1 in keyof T_10]: T_10[k_1]["type"]; }> extends infer T_11 ? { [k in keyof T_11]: addQuestionMarks<{ [k_1 in keyof T_10]: T_10[k_1]["type"]; }>[k]; } : never) & {
|
|
1202
|
+
[k: string]: Catchall["type"];
|
|
1203
|
+
} extends infer T_12 ? { [k_2 in keyof T_12]: ((addQuestionMarks<{ [k_1 in keyof T_10]: T_10[k_1]["type"]; }> extends infer T_11 ? { [k in keyof T_11]: addQuestionMarks<{ [k_1 in keyof T_10]: T_10[k_1]["type"]; }>[k]; } : never) & {
|
|
1204
|
+
[k: string]: Catchall["type"];
|
|
1205
|
+
})[k_2]; } : never>;
|
|
1206
|
+
optional: <T_13 extends JSONTypeAny>(type: T_13) => JSONOptional<T_13>;
|
|
1207
|
+
record: typeof record;
|
|
1208
|
+
}) => Type)) => JSONColumn<Type>;
|
|
1209
|
+
jsonText: () => JSONTextColumn;
|
|
1210
|
+
array: <Item extends ColumnType<unknown, Operators, unknown>>(item: Item) => ArrayColumn<Item>;
|
|
1211
|
+
timestamps: () => {
|
|
1212
|
+
createdAt: TimestampColumn<undefined>;
|
|
1213
|
+
updatedAt: TimestampColumn<undefined>;
|
|
1214
|
+
};
|
|
1215
|
+
primaryKey(columns: string[], options?: {
|
|
1216
|
+
name?: string | undefined;
|
|
1217
|
+
} | undefined): {};
|
|
1218
|
+
index(columns: MaybeArray<string | IndexColumnOptions>, options?: IndexOptions): {};
|
|
1219
|
+
unique(columns: MaybeArray<string | IndexColumnOptions>, options?: IndexOptions): {};
|
|
1220
|
+
foreignKey: {
|
|
1221
|
+
<Model extends ForeignKeyModelWithColumns, Columns extends [Exclude<keyof InstanceType<Model>["columns"]["shape"], number | symbol>, ...Exclude<keyof InstanceType<Model>["columns"]["shape"], number | symbol>[]]>(columns: string[], fn: () => Model, foreignColumns: Columns, options?: ForeignKeyOptions | undefined): {};
|
|
1222
|
+
<Table extends string, Columns_1 extends [string, ...string[]]>(columns: string[], table: Table, foreignColumns: Columns_1, options?: ForeignKeyOptions | undefined): {};
|
|
1223
|
+
};
|
|
1224
|
+
}>({ log, logger, columnTypes: ct, ...options }: DbOptions<CT>) => DbResult<CT>;
|
|
1133
1225
|
|
|
1134
1226
|
declare type WithArgsOptions = Omit<WithOptions, 'columns'> & {
|
|
1135
1227
|
columns?: boolean | string[];
|
|
@@ -1735,10 +1827,12 @@ declare type JSONOptional<T extends JSONTypeAny> = Omit<T, 'type' | 'data'> & {
|
|
|
1735
1827
|
optional: true;
|
|
1736
1828
|
};
|
|
1737
1829
|
};
|
|
1830
|
+
declare const optional: <T extends JSONTypeAny>(type: T) => JSONOptional<T>;
|
|
1738
1831
|
declare type JSONRequired<T extends JSONTypeAny> = Omit<T, 'type' | 'data'> & {
|
|
1739
1832
|
type: Exclude<T['type'], undefined>;
|
|
1740
1833
|
data: Omit<T['data'], 'optional'>;
|
|
1741
1834
|
};
|
|
1835
|
+
declare const required: <T extends JSONTypeAny>(type: T) => JSONRequired<T>;
|
|
1742
1836
|
|
|
1743
1837
|
declare type JSONNullable<T extends JSONTypeAny> = Omit<T, 'type' | 'data'> & {
|
|
1744
1838
|
type: T['type'] | null;
|
|
@@ -1746,10 +1840,12 @@ declare type JSONNullable<T extends JSONTypeAny> = Omit<T, 'type' | 'data'> & {
|
|
|
1746
1840
|
nullable: true;
|
|
1747
1841
|
};
|
|
1748
1842
|
};
|
|
1843
|
+
declare const nullable: <T extends JSONTypeAny>(type: T) => JSONNullable<T>;
|
|
1749
1844
|
declare type JSONNotNullable<T extends JSONTypeAny> = Omit<T, 'type' | 'data'> & {
|
|
1750
1845
|
type: Exclude<T['type'], null>;
|
|
1751
1846
|
data: Omit<T['data'], 'nullable'>;
|
|
1752
1847
|
};
|
|
1848
|
+
declare const notNullable: <T extends JSONTypeAny>(type: T) => JSONNotNullable<T>;
|
|
1753
1849
|
|
|
1754
1850
|
declare type JSONNullish<T extends JSONTypeAny> = Omit<T, 'type' | 'data'> & {
|
|
1755
1851
|
type: T['type'] | undefined | null;
|
|
@@ -1758,15 +1854,18 @@ declare type JSONNullish<T extends JSONTypeAny> = Omit<T, 'type' | 'data'> & {
|
|
|
1758
1854
|
optional: true;
|
|
1759
1855
|
};
|
|
1760
1856
|
};
|
|
1857
|
+
declare const nullish: <T extends JSONTypeAny>(type: T) => JSONNullish<T>;
|
|
1761
1858
|
declare type JSONNotNullish<T extends JSONTypeAny> = Omit<T, 'type' | 'data'> & {
|
|
1762
1859
|
type: Exclude<T['type'], undefined | null>;
|
|
1763
1860
|
data: Omit<T['data'], 'nullable'>;
|
|
1764
1861
|
};
|
|
1862
|
+
declare const notNullish: <T extends JSONTypeAny>(type: T) => JSONNotNullish<T>;
|
|
1765
1863
|
|
|
1766
1864
|
declare type JSONIntersection<Left extends JSONTypeAny, Right extends JSONTypeAny> = JSONType<Left['type'] & Right['type'], 'intersection'> & {
|
|
1767
1865
|
left: Left;
|
|
1768
1866
|
right: Right;
|
|
1769
1867
|
};
|
|
1868
|
+
declare const intersection: <Left extends JSONTypeAny, Right extends JSONTypeAny>(left: Left, right: Right) => JSONIntersection<Left, Right>;
|
|
1770
1869
|
|
|
1771
1870
|
declare function min<T extends {
|
|
1772
1871
|
data: {
|
|
@@ -1983,6 +2082,7 @@ interface JSONArray<Type extends JSONTypeAny, Cardinality extends ArrayCardinali
|
|
|
1983
2082
|
};
|
|
1984
2083
|
};
|
|
1985
2084
|
}
|
|
2085
|
+
declare const array: <Type extends JSONTypeAny>(element: Type) => JSONArray<Type, "many">;
|
|
1986
2086
|
|
|
1987
2087
|
declare type JSONTypeAny = JSONType<any, string>;
|
|
1988
2088
|
declare type DeepPartial<T extends JSONTypeAny> = ReturnType<JSONTypeAny['deepPartial']> extends ReturnType<T['deepPartial']> ? T : ReturnType<T['deepPartial']>;
|
|
@@ -2016,6 +2116,11 @@ declare type JSONType<Type, DataType extends string = string> = {
|
|
|
2016
2116
|
default<T extends JSONTypeAny>(this: T, value: T['type'] | (() => T['type'])): JSONNotNullish<T>;
|
|
2017
2117
|
array<T extends JSONTypeAny>(this: T): JSONArray<T>;
|
|
2018
2118
|
};
|
|
2119
|
+
declare type BaseTypeProps<T extends JSONTypeAny> = Omit<JSONType<T['type'], string>, 'dataType'>;
|
|
2120
|
+
declare type OwnTypeProps<T extends JSONTypeAny> = Omit<T, keyof BaseTypeProps<T>> & {
|
|
2121
|
+
[k in keyof BaseTypeProps<T>]?: BaseTypeProps<T>[k];
|
|
2122
|
+
};
|
|
2123
|
+
declare const constructType: <T extends JSONTypeAny>(type: OwnTypeProps<T>) => T;
|
|
2019
2124
|
|
|
2020
2125
|
declare type ColumnsShape = Record<string, ColumnType>;
|
|
2021
2126
|
declare type ColumnShapeOutput<Shape extends ColumnsShape> = {
|
|
@@ -3431,6 +3536,7 @@ interface JSONObject<T extends JSONObjectShape, UnknownKeys extends UnknownKeysP
|
|
|
3431
3536
|
strip(): JSONObject<T, 'strip', Catchall>;
|
|
3432
3537
|
catchAll<C extends JSONTypeAny>(type: C): JSONObject<T, UnknownKeys, C>;
|
|
3433
3538
|
}
|
|
3539
|
+
declare const object: <T extends JSONObjectShape, UnknownKeys extends UnknownKeysParam = "strip", Catchall extends JSONTypeAny = JSONTypeAny>(shape: T) => JSONObject<T, UnknownKeys, Catchall, objectOutputType<T, Catchall>>;
|
|
3434
3540
|
|
|
3435
3541
|
interface JSONNativeEnum<T extends EnumLike> extends JSONType<T[keyof T], 'nativeEnum'> {
|
|
3436
3542
|
dataType: 'nativeEnum';
|
|
@@ -3441,27 +3547,33 @@ declare type EnumLike = {
|
|
|
3441
3547
|
[k: string]: string | number;
|
|
3442
3548
|
[nu: number]: string;
|
|
3443
3549
|
};
|
|
3550
|
+
declare const getValidEnumValues: (obj: EnumLike) => (string | number)[];
|
|
3551
|
+
declare const nativeEnum: <T extends EnumLike>(givenEnum: T) => JSONNativeEnum<T>;
|
|
3444
3552
|
|
|
3445
3553
|
interface JSONMap<Key extends JSONTypeAny, Value extends JSONTypeAny> extends JSONType<Map<Key['type'], Value['type']>, 'map'> {
|
|
3446
3554
|
keyType: Key;
|
|
3447
3555
|
valueType: Value;
|
|
3448
3556
|
deepPartial(): JSONMap<ReturnType<Key['deepPartial']>, ReturnType<Value['deepPartial']>>;
|
|
3449
3557
|
}
|
|
3558
|
+
declare const map: <Key extends JSONTypeAny, Value extends JSONTypeAny>(keyType: Key, valueType: Value) => JSONMap<Key, Value>;
|
|
3450
3559
|
|
|
3451
3560
|
interface JSONLiteral<T extends Primitive> extends JSONType<T, 'literal'> {
|
|
3452
3561
|
value: Primitive;
|
|
3453
3562
|
}
|
|
3563
|
+
declare const literal: <T extends Primitive>(value: T) => JSONLiteral<T>;
|
|
3454
3564
|
|
|
3455
3565
|
interface JSONLazy<T extends JSONTypeAny> extends JSONType<T['type'], 'lazy'> {
|
|
3456
3566
|
typeCache?: T;
|
|
3457
3567
|
getter(): T;
|
|
3458
3568
|
deepPartial(): JSONLazy<ReturnType<T['deepPartial']>>;
|
|
3459
3569
|
}
|
|
3570
|
+
declare const lazy: <T extends JSONTypeAny>(fn: () => T) => JSONLazy<T>;
|
|
3460
3571
|
|
|
3461
3572
|
interface JSONInstanceOf<T extends Class> extends JSONType<T, 'instanceOf'> {
|
|
3462
3573
|
class: T;
|
|
3463
3574
|
}
|
|
3464
3575
|
declare type Class = new (...args: any[]) => any;
|
|
3576
|
+
declare const instanceOf: <T extends Class>(cls: T) => JSONInstanceOf<T>;
|
|
3465
3577
|
|
|
3466
3578
|
interface JSONEnum<U extends string = string, T extends [U, ...U[]] = [U]> extends JSONType<T[number], 'enum'> {
|
|
3467
3579
|
enum: {
|
|
@@ -3469,6 +3581,8 @@ interface JSONEnum<U extends string = string, T extends [U, ...U[]] = [U]> exten
|
|
|
3469
3581
|
};
|
|
3470
3582
|
options: T;
|
|
3471
3583
|
}
|
|
3584
|
+
declare const arrayToEnum: <U extends string, T extends [U, ...U[]]>(items: T) => { [k in T[number]]: k; };
|
|
3585
|
+
declare const enumType: <U extends string, T extends [U, ...U[]]>(options: T) => JSONEnum<U, T>;
|
|
3472
3586
|
|
|
3473
3587
|
interface JSONDiscriminatedUnion<Discriminator extends string, DiscriminatorValue extends Primitive, Option extends JSONDiscriminatedObject<Discriminator, DiscriminatorValue>> extends JSONType<Option['type'], 'discriminatedUnion'> {
|
|
3474
3588
|
discriminator: Discriminator;
|
|
@@ -3479,6 +3593,7 @@ interface JSONDiscriminatedUnion<Discriminator extends string, DiscriminatorValu
|
|
|
3479
3593
|
declare type JSONDiscriminatedObject<Discriminator extends string, DiscriminatorValue extends Primitive> = JSONObject<{
|
|
3480
3594
|
[K in Discriminator]: JSONLiteral<DiscriminatorValue>;
|
|
3481
3595
|
} & JSONObjectShape, any>;
|
|
3596
|
+
declare const discriminatedUnion: <Discriminator extends string, DiscriminatorValue extends Primitive, Types extends [JSONDiscriminatedObject<Discriminator, DiscriminatorValue>, JSONDiscriminatedObject<Discriminator, DiscriminatorValue>, ...JSONDiscriminatedObject<Discriminator, DiscriminatorValue>[]]>(discriminator: Discriminator, options: Types) => JSONDiscriminatedUnion<Discriminator, DiscriminatorValue, Types[number]>;
|
|
3482
3597
|
|
|
3483
3598
|
declare type JSONAny = JSONTypeAny & {
|
|
3484
3599
|
dataType: 'any';
|
|
@@ -3853,10 +3968,25 @@ declare const stringMethods: {
|
|
|
3853
3968
|
declare type JSONUndefined = JSONType<undefined, 'undefined'>;
|
|
3854
3969
|
declare type JSONUnknown = JSONType<unknown, 'unknown'>;
|
|
3855
3970
|
declare type JSONVoid = JSONType<void, 'void'>;
|
|
3971
|
+
declare const scalarTypes: {
|
|
3972
|
+
any: () => JSONAny;
|
|
3973
|
+
bigint: () => JSONBigInt;
|
|
3974
|
+
boolean: () => JSONBoolean;
|
|
3975
|
+
date: () => JSONDate;
|
|
3976
|
+
nan: () => JSONNaN;
|
|
3977
|
+
never: () => JSONNever;
|
|
3978
|
+
null: () => JSONNull;
|
|
3979
|
+
number: () => JSONNumber;
|
|
3980
|
+
string: () => JSONString;
|
|
3981
|
+
undefined: () => JSONUndefined;
|
|
3982
|
+
unknown: () => JSONUnknown;
|
|
3983
|
+
void: () => JSONVoid;
|
|
3984
|
+
};
|
|
3856
3985
|
|
|
3857
3986
|
interface JSONUnion<T extends [JSONTypeAny, JSONTypeAny, ...JSONTypeAny[]]> extends JSONType<T[number]['type'], 'union'> {
|
|
3858
3987
|
types: T;
|
|
3859
3988
|
}
|
|
3989
|
+
declare const union: <T extends [JSONTypeAny, JSONTypeAny, ...JSONTypeAny[]]>(types: T) => JSONUnion<T>;
|
|
3860
3990
|
|
|
3861
3991
|
interface JSONTuple<T extends JSONTupleItems | [] = JSONTupleItems, Rest extends JSONTypeAny | null = null> extends JSONType<OutputTypeOfTupleWithRest<T, Rest>, 'tuple'> {
|
|
3862
3992
|
items: T;
|
|
@@ -3872,6 +4002,7 @@ declare type OutputTypeOfTuple<T extends JSONTupleItems | []> = AssertArray<{
|
|
|
3872
4002
|
[k in keyof T]: T[k] extends JSONTypeAny ? T[k]['type'] : never;
|
|
3873
4003
|
}>;
|
|
3874
4004
|
declare type OutputTypeOfTupleWithRest<T extends JSONTupleItems | [], Rest extends JSONTypeAny | null = null> = Rest extends JSONTypeAny ? [...OutputTypeOfTuple<T>, ...Rest['type'][]] : OutputTypeOfTuple<T>;
|
|
4005
|
+
declare const tuple: <T extends [] | JSONTupleItems, Rest extends JSONTypeAny | null = null>(items: T, rest?: Rest) => JSONTuple<T, Rest>;
|
|
3875
4006
|
|
|
3876
4007
|
interface JSONSet<Value extends JSONTypeAny> extends JSONType<Set<Value['type']>, 'set'>, SetMethods {
|
|
3877
4008
|
data: JSONTypeData & {
|
|
@@ -3887,6 +4018,7 @@ interface JSONSet<Value extends JSONTypeAny> extends JSONType<Set<Value['type']>
|
|
|
3887
4018
|
};
|
|
3888
4019
|
};
|
|
3889
4020
|
}
|
|
4021
|
+
declare const set: <Value extends JSONTypeAny>(valueType: Value) => JSONSet<Value>;
|
|
3890
4022
|
|
|
3891
4023
|
interface JSONRecord<Key extends JSONRecordKeyType, Value extends JSONTypeAny> extends JSONType<Record<Key['type'], Value['type']>, 'record'> {
|
|
3892
4024
|
keyType: Key;
|
|
@@ -4151,4 +4283,4 @@ declare class NotFoundError extends Error {
|
|
|
4151
4283
|
declare class MoreThanOneRowError extends Error {
|
|
4152
4284
|
}
|
|
4153
4285
|
|
|
4154
|
-
export { Adapter, AdapterOptions, AddQueryJoinedTable, AddQuerySelect, AddQueryWith, AfterCallback, Aggregate, Aggregate1ArgumentTypes, AggregateArg, AggregateItem, AggregateItemArg, AggregateItemOptions, AggregateOptions, AliasOrTable, AnyColumnType, AnyColumnTypeCreator, ArrayColumn, ArrayData, ArrayOfColumnsObjects, BaseNumberData, BaseRelation, BaseStringData, BeforeCallback, BelongsToNestedInsert, BelongsToNestedUpdate, BelongsToRelation, BigIntColumn, BigSerialColumn, BitColumn, BitVaryingColumn, BooleanColumn, BooleanExpression, BoxColumn, ByteaColumn, CharColumn, CidrColumn, CircleColumn, Clear, ClearStatement, CoalesceString, ColumnData, ColumnInfo, ColumnInfoMethods, ColumnInfoQueryData, ColumnInput, ColumnNameOfModel, ColumnOperators, ColumnOutput, ColumnParser, ColumnShapeInput, ColumnShapeOutput, ColumnType, ColumnTypes, ColumnTypesBase, ColumnsObject, ColumnsParsers, ColumnsShape, CommonQueryData, DateBaseColumn, DateColumn, DateColumnData, DateTimeBaseClass, DateTimeColumnData, DateTimeWithTimeZoneBaseClass, Db, DbOptions, DbTableOptions, DecimalBaseColumn, DecimalColumn, DecimalColumnData, DefaultSelectColumns, Delete, DeleteQueryData, DoublePrecisionColumn, DropMode, EMPTY_OBJECT, EmptyObject, EnumColumn, Expression, ExpressionOfType, ExpressionOutput, FilterTuple, For, ForeignKey, ForeignKeyModel, ForeignKeyModelWithColumns, ForeignKeyOptions, From, GetArg, GetTypeOrRaw, GetTypesOrRaw, HasAndBelongsToManyRelation, HasManyNestedInsert, HasManyNestedUpdate, HasManyRelation, HasOneNestedInsert, HasOneNestedUpdate, HasOneRelation, Having, HavingArg, HavingItem, IndexColumnOptions, IndexOptions, InetColumn, Insert, InsertData, InsertQueryData, IntegerBaseColumn, IntegerColumn, IntervalColumn, JSONColumn, JSONTextColumn, JSONTypes, Join, JoinArgs, JoinCallback, JoinCallbackArg, JoinItem, JoinedTablesBase, Json, JsonItem, LimitedTextBaseColumn, LineColumn, LsegColumn, MacAddr8Column, MacAddrColumn, MaybeArray, MoneyColumn, MoreThanOneRowError, NestedInsertItem, NestedInsertManyItems, NestedInsertOneItem, NestedUpdateItem, NestedUpdateManyItems, NestedUpdateOneItem, NotFoundError, NullableColumn, NumberAsStringBaseColumn, NumberBaseColumn, NumberColumn, NumberColumnData, NumberExpression, OnConflictItem, OnConflictMergeUpdate, OnConflictQueryBuilder, OnQueryBuilder, Operator, Operators, OptionalKeys, OrderArg, OrderItem, PathColumn, PointColumn, PolygonColumn, PropertyKeyUnionToArray, Query, QueryArraysResult, QueryBase, QueryCallbacks, QueryData, QueryGet, QueryInput, QueryLog, QueryLogObject, QueryLogOptions, QueryLogger, QueryMethods, QueryResult, QueryResultRow, QueryReturnType, QuerySelectAll, QueryUpsert, QueryWithTable, RawExpression, RealColumn, Relation, RelationQuery, RelationQueryBase, RelationsBase, Select, SelectAgg, SelectArg, SelectFunctionItem, SelectItem, SelectQueryData, Selectable, SelectableBase, SerialColumn, SetOptional, SetQueryJoinedTables, SetQueryReturns, SetQueryReturnsAll, SetQueryReturnsColumnInfo, SetQueryReturnsOne, SetQueryReturnsOneOptional, SetQueryReturnsPluck, SetQueryReturnsRowCount, SetQueryReturnsRows, SetQueryReturnsValue, SetQueryReturnsValueOptional, SetQueryReturnsVoid, SetQueryTableAlias, SetQueryWindows, SetQueryWith, SimpleSpread, SingleColumnIndexOptions, SmallIntColumn, SmallSerialColumn, SortDir, Spread, Sql, StringColumn, StringExpression, StringKey, TableData, TableSchema, TextBaseColumn, TextColumn, TextColumnData, Then, ThenResult, TimeColumn, TimeInterval, TimeWithTimeZoneColumn, TimestampColumn, TimestampWithTimeZoneColumn, Transaction, TransactionAdapter, TruncateQueryData, TsQueryColumn, TsVectorColumn, TypeParsers, UUIDColumn, Union, UnionArg, UnionItem, UnionToArray, UnionToIntersection, UnionToOvlds, Update, UpdateData, UpdateQueryData, UpsertData, UpsertResult, UpsertThis, ValidationContext, VarCharColumn, Where, WhereArg, WhereInArg, WhereInColumn, WhereInItem, WhereInValues, WhereItem, WhereJsonPathEqualsItem, WhereOnItem, WhereQueryBuilder, WhereResult, WindowArg, WindowArgDeclaration, WindowDeclaration, WindowFunctionOptions, WindowItem, With, WithDataBase, WithDataItem, WithItem, WithOptions, XMLColumn, addOr, addOrNot, addParserForRawExpression, addParserForSelectItem, addParserToQuery, addQueryOn, addQueryOrOn, addWhere, addWhereIn, addWhereNot, aggregate1FunctionNames, applyMixins, columnTypes, utils as columnUtils, createDb, createOperator, defaultsKey, emptyObject, getClonedQueryData, getColumnTypes, getQueryAs, getQueryParsers, getRaw, getTableData, getValueKey, handleResult, isRaw, isRequiredRelationKey, joinTruthy, jsonTypes, logColors, logParamToLogObject, newTableData, noop, parseRecord, parseResult, processSelectArg, pushQueryArray, pushQueryOn, pushQueryOrOn, pushQueryValue, queryKeysOfNotSimpleQuery, queryMethodByReturnType, quote, raw, relationQueryKey, removeFromQuery, resetTableData, setQueryObjectValue, toArray, toSql };
|
|
4286
|
+
export { Adapter, AdapterOptions, AddQueryJoinedTable, AddQuerySelect, AddQueryWith, AfterCallback, Aggregate, Aggregate1ArgumentTypes, AggregateArg, AggregateItem, AggregateItemArg, AggregateItemOptions, AggregateOptions, AliasOrTable, AnyColumnType, AnyColumnTypeCreator, ArrayCardinality, ArrayColumn, ArrayData, ArrayOfColumnsObjects, AssertArray, BaseNumberData, BaseRelation, BaseStringData, BeforeCallback, BelongsToNestedInsert, BelongsToNestedUpdate, BelongsToRelation, BigIntColumn, BigSerialColumn, BitColumn, BitVaryingColumn, BooleanColumn, BooleanExpression, BoxColumn, ByteaColumn, CharColumn, CidrColumn, CircleColumn, Clear, ClearStatement, CoalesceString, ColumnData, ColumnInfo, ColumnInfoMethods, ColumnInfoQueryData, ColumnInput, ColumnNameOfModel, ColumnOperators, ColumnOutput, ColumnParser, ColumnShapeInput, ColumnShapeOutput, ColumnType, ColumnTypes, ColumnTypesBase, ColumnsObject, ColumnsParsers, ColumnsShape, CommonQueryData, DateBaseColumn, DateColumn, DateColumnData, DateTimeBaseClass, DateTimeColumnData, DateTimeWithTimeZoneBaseClass, Db, DbOptions, DbTableOptions, DecimalBaseColumn, DecimalColumn, DecimalColumnData, DeepPartial, DefaultSelectColumns, Delete, DeleteQueryData, DoublePrecisionColumn, DropMode, EMPTY_OBJECT, EmptyObject, EnumColumn, EnumLike, Except, Expression, ExpressionOfType, ExpressionOutput, FilterTuple, For, ForeignKey, ForeignKeyModel, ForeignKeyModelWithColumns, ForeignKeyOptions, From, GetArg, GetTypeOrRaw, GetTypesOrRaw, HasAndBelongsToManyRelation, HasManyNestedInsert, HasManyNestedUpdate, HasManyRelation, HasOneNestedInsert, HasOneNestedUpdate, HasOneRelation, Having, HavingArg, HavingItem, IndexColumnOptions, IndexOptions, InetColumn, Insert, InsertData, InsertQueryData, IntegerBaseColumn, IntegerColumn, IntervalColumn, IsEqual, JSONAny, JSONArray, JSONBigInt, JSONBoolean, JSONColumn, JSONDate, JSONDiscriminatedObject, JSONDiscriminatedUnion, JSONEnum, JSONInstanceOf, JSONIntersection, JSONLazy, JSONLiteral, JSONMap, JSONNaN, JSONNativeEnum, JSONNever, JSONNotNullable, JSONNotNullish, JSONNull, JSONNullable, JSONNullish, JSONNumber, JSONObject, JSONObjectShape, JSONOptional, JSONRecord, JSONRecordKeyType, JSONRequired, JSONSet, JSONString, JSONTextColumn, JSONTuple, JSONTupleItems, JSONType, JSONTypeAny, JSONTypeData, JSONTypes, JSONUndefined, JSONUnion, JSONUnknown, JSONVoid, Join, JoinArgs, JoinCallback, JoinCallbackArg, JoinItem, JoinedTablesBase, Json, JsonItem, LimitedTextBaseColumn, LineColumn, LsegColumn, MacAddr8Column, MacAddrColumn, MaybeArray, Merge, MoneyColumn, MoreThanOneRowError, NestedInsertItem, NestedInsertManyItems, NestedInsertOneItem, NestedUpdateItem, NestedUpdateManyItems, NestedUpdateOneItem, NotFoundError, NullableColumn, NumberAsStringBaseColumn, NumberBaseColumn, NumberColumn, NumberColumnData, NumberExpression, OnConflictItem, OnConflictMergeUpdate, OnConflictQueryBuilder, OnQueryBuilder, Operator, Operators, OptionalKeys, OrderArg, OrderItem, OutputTypeOfTuple, OutputTypeOfTupleWithRest, OwnTypeProps, PathColumn, PointColumn, PolygonColumn, Primitive, PropertyKeyUnionToArray, Query, QueryArraysResult, QueryBase, QueryCallbacks, QueryData, QueryGet, QueryInput, QueryLog, QueryLogObject, QueryLogOptions, QueryLogger, QueryMethods, QueryResult, QueryResultRow, QueryReturnType, QuerySelectAll, QueryUpsert, QueryWithTable, RawExpression, RealColumn, Relation, RelationQuery, RelationQueryBase, RelationsBase, Select, SelectAgg, SelectArg, SelectFunctionItem, SelectItem, SelectQueryData, Selectable, SelectableBase, SerialColumn, SetOptional, SetQueryJoinedTables, SetQueryReturns, SetQueryReturnsAll, SetQueryReturnsColumnInfo, SetQueryReturnsOne, SetQueryReturnsOneOptional, SetQueryReturnsPluck, SetQueryReturnsRowCount, SetQueryReturnsRows, SetQueryReturnsValue, SetQueryReturnsValueOptional, SetQueryReturnsVoid, SetQueryTableAlias, SetQueryWindows, SetQueryWith, SimpleSpread, SingleColumnIndexOptions, SmallIntColumn, SmallSerialColumn, SortDir, Spread, Sql, StringColumn, StringExpression, StringKey, TableData, TableSchema, TextBaseColumn, TextColumn, TextColumnData, Then, ThenResult, TimeColumn, TimeInterval, TimeWithTimeZoneColumn, TimestampColumn, TimestampWithTimeZoneColumn, Transaction, TransactionAdapter, TruncateQueryData, TsQueryColumn, TsVectorColumn, TypeParsers, UUIDColumn, Union, UnionArg, UnionItem, UnionToArray, UnionToIntersection, UnionToOvlds, UnknownKeysParam, Update, UpdateData, UpdateQueryData, UpsertData, UpsertResult, UpsertThis, ValidationContext, VarCharColumn, Where, WhereArg, WhereInArg, WhereInColumn, WhereInItem, WhereInValues, WhereItem, WhereJsonPathEqualsItem, WhereOnItem, WhereQueryBuilder, WhereResult, WindowArg, WindowArgDeclaration, WindowDeclaration, WindowFunctionOptions, WindowItem, With, WithDataBase, WithDataItem, WithItem, WithOptions, XMLColumn, addOr, addOrNot, addParserForRawExpression, addParserForSelectItem, addParserToQuery, addQueryOn, addQueryOrOn, addQuestionMarks, addWhere, addWhereIn, addWhereNot, aggregate1FunctionNames, applyMixins, array, arrayToEnum, baseObjectOutputType, columnTypes, utils as columnUtils, constructType, createDb, createOperator, defaultsKey, discriminatedUnion, emptyObject, enumType, flatten, getClonedQueryData, getColumnTypes, getQueryAs, getQueryParsers, getRaw, getTableData, getValidEnumValues, getValueKey, handleResult, identity, instanceOf, intersection, isRaw, isRequiredRelationKey, joinTruthy, jsonTypes, lazy, literal, logColors, logParamToLogObject, map, nativeEnum, newTableData, noop, notNullable, notNullish, nullable, nullish, object, optional, parseRecord, parseResult, processSelectArg, pushQueryArray, pushQueryOn, pushQueryOrOn, pushQueryValue, queryKeysOfNotSimpleQuery, queryMethodByReturnType, quote, raw, record, relationQueryKey, removeFromQuery, required, resetTableData, scalarTypes, set, setQueryObjectValue, toArray, toSql, tuple, union };
|