pqb 0.36.6 → 0.36.8
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 +50 -49
- package/dist/index.js +178 -138
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +179 -139
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PoolConfig, Pool, PoolClient } from 'pg';
|
|
2
2
|
import * as orchid_core from 'orchid-core';
|
|
3
|
-
import { QueryResultRow, AdapterConfigBase, AdapterBase, QueryInput, SingleSqlItem, Sql, RecordUnknown, RecordKeyTrue, EmptyObject, QueryBaseCommon, QueryColumns, QueryMetaBase, QueryReturnType, QueryThen, Expression, MaybeArray, TemplateLiteralArgs, QueryColumn, MaybePromise, FnUnknownToUnknown, RecordString, ColumnsShapeBase, ColumnsParsers, PickQueryTable, BatchParsers, HookSelect, QueryLogObject, QueryLogger, QueryDataTransform, ExpressionChain, getValueKey, PickQueryShape, PickQueryTableMetaResult, EmptyTuple, PickQueryMeta, PickQueryMetaResultReturnType, QueryColumnToNullable, SelectableBase, PickQueryMetaShape, PickQueryTableMetaResultShape, PickQueryMetaResultWindows, PickOutputTypeAndOperators, PickQueryResult, ExpressionData, ValExpression, PickOutputType, SQLQueryArgs, ColumnSchemaConfig, DateColumnData, Code, TimeInterval, ColumnTypeSchemaArg, ColumnDataBase, ArrayMethodsData, RawSQLBase, RawSQLValues, ExpressionTypeMethod, DynamicSQLArg, StaticSQLArgs, ForeignKeyTable, ColumnNameOfTable, BaseNumberData, PickColumnBaseData, ColumnWithDefault, StringTypeData, PrimaryKeyColumn, ParseColumn, EncodeColumn, QueryColumnsInit, QueryLogOptions, DefaultSelectColumns, DbBase, QueryCatch, TransactionState, ColumnTypeBase, PickQueryUniqueProperties, PickQueryMetaResult, IsQuery, PickQueryTableMetaResultInputType, MergeObjects, PickQueryResultUniqueColumns, QueryInternalBase, PickQueryReturnType, PickType, ColumnShapeOutput, OperatorsNullable, PickQueryMetaReturnType, UniqueColumn, TimestampHelpers, Codes, ColumnDataCheckBase } from 'orchid-core';
|
|
3
|
+
import { QueryResultRow, AdapterConfigBase, AdapterBase, QueryInput, SingleSqlItem, Sql, RecordUnknown, RecordKeyTrue, EmptyObject, QueryBaseCommon, QueryColumns, QueryMetaBase, QueryReturnType, QueryThen, Expression, MaybeArray, TemplateLiteralArgs, QueryColumn, MaybePromise, FnUnknownToUnknown, RecordString, ColumnsShapeBase, ColumnsParsers, PickQueryTable, BatchParsers, HookSelect, QueryLogObject, QueryLogger, QueryDataTransform, ExpressionChain, getValueKey, PickQueryShape, PickQueryTableMetaResult, EmptyTuple, PickQueryMeta, PickQueryMetaResultReturnType, QueryColumnToNullable, SelectableBase, PickQueryMetaShape, PickQueryTableMetaResultShape, PickQueryMetaResultWindows, PickOutputTypeAndOperators, PickQueryResult, ExpressionData, ValExpression, PickOutputType, SQLQueryArgs, ColumnSchemaConfig, DateColumnData, ColumnToCodeCtx, Code, TimeInterval, ColumnTypeSchemaArg, ColumnDataBase, ArrayMethodsData, RawSQLBase, RawSQLValues, ExpressionTypeMethod, DynamicSQLArg, StaticSQLArgs, ForeignKeyTable, ColumnNameOfTable, BaseNumberData, PickColumnBaseData, ColumnWithDefault, StringTypeData, PrimaryKeyColumn, ParseColumn, EncodeColumn, QueryColumnsInit, QueryLogOptions, DefaultSelectColumns, DbBase, QueryCatch, TransactionState, ColumnTypeBase, PickQueryUniqueProperties, PickQueryMetaResult, IsQuery, PickQueryTableMetaResultInputType, MergeObjects, PickQueryResultUniqueColumns, QueryInternalBase, PickQueryReturnType, PickType, ColumnShapeOutput, OperatorsNullable, PickQueryMetaReturnType, UniqueColumn, TimestampHelpers, Codes, ColumnDataCheckBase } from 'orchid-core';
|
|
4
4
|
import { inspect } from 'node:util';
|
|
5
5
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
6
6
|
|
|
@@ -2566,7 +2566,7 @@ declare abstract class DateBaseColumn<Schema extends ColumnSchemaConfig> extends
|
|
|
2566
2566
|
}
|
|
2567
2567
|
declare class DateColumn<Schema extends ColumnSchemaConfig> extends DateBaseColumn<Schema> {
|
|
2568
2568
|
dataType: "date";
|
|
2569
|
-
toCode(
|
|
2569
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2570
2570
|
}
|
|
2571
2571
|
declare abstract class DateTimeBaseClass<Schema extends ColumnSchemaConfig> extends DateBaseColumn<Schema> {
|
|
2572
2572
|
data: DateColumnData & {
|
|
@@ -2581,12 +2581,12 @@ declare abstract class DateTimeTzBaseClass<Schema extends ColumnSchemaConfig> ex
|
|
|
2581
2581
|
}
|
|
2582
2582
|
declare class TimestampColumn<Schema extends ColumnSchemaConfig> extends DateTimeBaseClass<Schema> {
|
|
2583
2583
|
dataType: "timestamp";
|
|
2584
|
-
toCode(
|
|
2584
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2585
2585
|
}
|
|
2586
2586
|
declare class TimestampTZColumn<Schema extends ColumnSchemaConfig> extends DateTimeTzBaseClass<Schema> {
|
|
2587
2587
|
dataType: "timestamptz";
|
|
2588
2588
|
baseDataType: "timestamp";
|
|
2589
|
-
toCode(
|
|
2589
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2590
2590
|
}
|
|
2591
2591
|
declare class TimeColumn<Schema extends ColumnSchemaConfig> extends ColumnType<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsTime> {
|
|
2592
2592
|
data: DateColumnData & {
|
|
@@ -2595,7 +2595,7 @@ declare class TimeColumn<Schema extends ColumnSchemaConfig> extends ColumnType<S
|
|
|
2595
2595
|
dataType: "time";
|
|
2596
2596
|
operators: OperatorsTime;
|
|
2597
2597
|
constructor(schema: Schema, dateTimePrecision?: number);
|
|
2598
|
-
toCode(
|
|
2598
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2599
2599
|
}
|
|
2600
2600
|
declare class IntervalColumn<Schema extends ColumnSchemaConfig> extends ColumnType<Schema, TimeInterval, ReturnType<Schema['timeInterval']>, OperatorsDate> {
|
|
2601
2601
|
data: ColumnData & {
|
|
@@ -2605,7 +2605,7 @@ declare class IntervalColumn<Schema extends ColumnSchemaConfig> extends ColumnTy
|
|
|
2605
2605
|
dataType: "interval";
|
|
2606
2606
|
operators: OperatorsDate;
|
|
2607
2607
|
constructor(schema: Schema, fields?: string, precision?: number);
|
|
2608
|
-
toCode(
|
|
2608
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2609
2609
|
toSQL(): string;
|
|
2610
2610
|
}
|
|
2611
2611
|
|
|
@@ -2615,7 +2615,7 @@ declare class EnumColumn<Schema extends ColumnTypeSchemaArg, SchemaType extends
|
|
|
2615
2615
|
operators: OperatorsAny;
|
|
2616
2616
|
dataType: string;
|
|
2617
2617
|
constructor(schema: Schema, enumName: string, options: T, schemaType: SchemaType);
|
|
2618
|
-
toCode(
|
|
2618
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2619
2619
|
toSQL(): string;
|
|
2620
2620
|
}
|
|
2621
2621
|
|
|
@@ -2628,12 +2628,13 @@ interface ArrayColumnValue {
|
|
|
2628
2628
|
queryType: unknown;
|
|
2629
2629
|
querySchema: any;
|
|
2630
2630
|
toSQL(): string;
|
|
2631
|
-
toCode(
|
|
2631
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2632
2632
|
parseItem?(input: string): unknown;
|
|
2633
2633
|
data: ColumnDataBase;
|
|
2634
2634
|
}
|
|
2635
2635
|
interface ArrayData<Item extends ArrayColumnValue> extends ColumnData, ArrayMethodsData {
|
|
2636
2636
|
item: Item;
|
|
2637
|
+
arrayDims: number;
|
|
2637
2638
|
}
|
|
2638
2639
|
declare class ArrayColumn<Schema extends ColumnTypeSchemaArg, Item extends ArrayColumnValue, InputType, OutputType, QueryType> extends ColumnType<Schema, Item['type'][], InputType, OperatorsArray, Item['inputType'][], Item['outputType'][], OutputType, Item['queryType'][], QueryType> {
|
|
2639
2640
|
dataType: "array";
|
|
@@ -2641,7 +2642,7 @@ declare class ArrayColumn<Schema extends ColumnTypeSchemaArg, Item extends Array
|
|
|
2641
2642
|
data: ArrayData<Item>;
|
|
2642
2643
|
constructor(schema: Schema, item: Item, inputType: InputType, outputType?: OutputType, queryType?: QueryType);
|
|
2643
2644
|
toSQL(): string;
|
|
2644
|
-
toCode(this: ArrayColumn<ColumnSchemaConfig, ArrayColumnValue, unknown, unknown, unknown>,
|
|
2645
|
+
toCode(this: ArrayColumn<ColumnSchemaConfig, ArrayColumnValue, unknown, unknown, unknown>, ctx: ColumnToCodeCtx, key: string): Code;
|
|
2645
2646
|
parseFn: ((input: unknown) => unknown[]) & {
|
|
2646
2647
|
hideFromCode: boolean;
|
|
2647
2648
|
};
|
|
@@ -2650,13 +2651,13 @@ declare class ArrayColumn<Schema extends ColumnTypeSchemaArg, Item extends Array
|
|
|
2650
2651
|
declare class JSONColumn<T, Schema extends ColumnTypeSchemaArg> extends ColumnType<Schema, T, Schema['type'], OperatorsJson> {
|
|
2651
2652
|
dataType: "jsonb";
|
|
2652
2653
|
operators: OperatorsJson;
|
|
2653
|
-
toCode(
|
|
2654
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2654
2655
|
}
|
|
2655
2656
|
declare class JSONTextColumn<Schema extends ColumnSchemaConfig> extends ColumnType<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
|
|
2656
2657
|
dataType: "json";
|
|
2657
2658
|
operators: OperatorsText;
|
|
2658
2659
|
constructor(schema: Schema);
|
|
2659
|
-
toCode(
|
|
2660
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2660
2661
|
}
|
|
2661
2662
|
|
|
2662
2663
|
declare const templateLiteralToSQL: (template: TemplateLiteralArgs, ctx: ToSQLCtx, quotedAs?: string) => string;
|
|
@@ -2887,7 +2888,7 @@ declare class DecimalColumn<Schema extends ColumnSchemaConfig> extends ColumnTyp
|
|
|
2887
2888
|
operators: OperatorsNumber;
|
|
2888
2889
|
dataType: "numeric";
|
|
2889
2890
|
constructor(schema: Schema, numericPrecision?: number, numericScale?: number);
|
|
2890
|
-
toCode(
|
|
2891
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2891
2892
|
toSQL(): string;
|
|
2892
2893
|
}
|
|
2893
2894
|
type IdentityColumn<T extends PickColumnBaseData> = ColumnWithDefault<T, Expression>;
|
|
@@ -2895,32 +2896,32 @@ declare class SmallIntColumn<Schema extends ColumnSchemaConfig> extends IntegerB
|
|
|
2895
2896
|
dataType: "int2";
|
|
2896
2897
|
constructor(schema: Schema);
|
|
2897
2898
|
parseItem: typeof parseInt;
|
|
2898
|
-
toCode(
|
|
2899
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2899
2900
|
identity<T extends ColumnType>(this: T, options?: TableData.Identity): IdentityColumn<T>;
|
|
2900
2901
|
}
|
|
2901
2902
|
declare class IntegerColumn<Schema extends ColumnSchemaConfig> extends IntegerBaseColumn<Schema> {
|
|
2902
2903
|
dataType: "int4";
|
|
2903
2904
|
constructor(schema: Schema);
|
|
2904
2905
|
parseItem: typeof parseInt;
|
|
2905
|
-
toCode(
|
|
2906
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2906
2907
|
identity<T extends ColumnType>(this: T, options?: TableData.Identity): IdentityColumn<T>;
|
|
2907
2908
|
}
|
|
2908
2909
|
declare class BigIntColumn<Schema extends ColumnSchemaConfig> extends NumberAsStringBaseColumn<Schema> {
|
|
2909
2910
|
dataType: "int8";
|
|
2910
2911
|
constructor(schema: Schema);
|
|
2911
|
-
toCode(
|
|
2912
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2912
2913
|
identity<T extends ColumnType>(this: T, options?: TableData.Identity): IdentityColumn<T>;
|
|
2913
2914
|
}
|
|
2914
2915
|
declare class RealColumn<Schema extends ColumnSchemaConfig> extends NumberBaseColumn<Schema, ReturnType<Schema['number']>> {
|
|
2915
2916
|
dataType: "float4";
|
|
2916
2917
|
parseItem: typeof parseFloat;
|
|
2917
2918
|
constructor(schema: Schema);
|
|
2918
|
-
toCode(
|
|
2919
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2919
2920
|
}
|
|
2920
2921
|
declare class DoublePrecisionColumn<Schema extends ColumnSchemaConfig> extends NumberAsStringBaseColumn<Schema> {
|
|
2921
2922
|
dataType: "float8";
|
|
2922
2923
|
constructor(schema: Schema);
|
|
2923
|
-
toCode(
|
|
2924
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2924
2925
|
}
|
|
2925
2926
|
declare class SmallSerialColumn<Schema extends ColumnSchemaConfig> extends IntegerBaseColumn<Schema> {
|
|
2926
2927
|
dataType: "int2";
|
|
@@ -2928,7 +2929,7 @@ declare class SmallSerialColumn<Schema extends ColumnSchemaConfig> extends Integ
|
|
|
2928
2929
|
data: SerialColumnData;
|
|
2929
2930
|
constructor(schema: Schema);
|
|
2930
2931
|
toSQL(): string;
|
|
2931
|
-
toCode(
|
|
2932
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2932
2933
|
}
|
|
2933
2934
|
declare class SerialColumn<Schema extends ColumnSchemaConfig> extends IntegerBaseColumn<Schema> {
|
|
2934
2935
|
dataType: "int4";
|
|
@@ -2936,14 +2937,14 @@ declare class SerialColumn<Schema extends ColumnSchemaConfig> extends IntegerBas
|
|
|
2936
2937
|
data: SerialColumnData;
|
|
2937
2938
|
constructor(schema: Schema);
|
|
2938
2939
|
toSQL(): string;
|
|
2939
|
-
toCode(
|
|
2940
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2940
2941
|
}
|
|
2941
2942
|
declare class BigSerialColumn<Schema extends ColumnSchemaConfig> extends NumberAsStringBaseColumn<Schema> {
|
|
2942
2943
|
dataType: "int8";
|
|
2943
2944
|
data: SerialColumnData;
|
|
2944
2945
|
constructor(schema: Schema);
|
|
2945
2946
|
toSQL(): string;
|
|
2946
|
-
toCode(
|
|
2947
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2947
2948
|
}
|
|
2948
2949
|
|
|
2949
2950
|
type TextColumnData = StringTypeData;
|
|
@@ -2961,11 +2962,11 @@ declare abstract class LimitedTextBaseColumn<Schema extends ColumnSchemaConfig>
|
|
|
2961
2962
|
}
|
|
2962
2963
|
declare class VarCharColumn<Schema extends ColumnSchemaConfig> extends LimitedTextBaseColumn<Schema> {
|
|
2963
2964
|
dataType: "varchar";
|
|
2964
|
-
toCode(
|
|
2965
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2965
2966
|
}
|
|
2966
2967
|
declare class StringColumn$1<Schema extends ColumnSchemaConfig> extends VarCharColumn<Schema> {
|
|
2967
2968
|
constructor(schema: Schema, limit?: number);
|
|
2968
|
-
toCode(
|
|
2969
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2969
2970
|
}
|
|
2970
2971
|
declare class TextColumn<Schema extends ColumnSchemaConfig> extends TextBaseColumn<Schema> {
|
|
2971
2972
|
dataType: "text";
|
|
@@ -2974,60 +2975,60 @@ declare class TextColumn<Schema extends ColumnSchemaConfig> extends TextBaseColu
|
|
|
2974
2975
|
maxArg?: number;
|
|
2975
2976
|
};
|
|
2976
2977
|
constructor(schema: Schema);
|
|
2977
|
-
toCode(
|
|
2978
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2978
2979
|
}
|
|
2979
2980
|
declare class ByteaColumn<Schema extends ColumnSchemaConfig> extends ColumnType<Schema, Buffer, ReturnType<Schema['buffer']>, OperatorsText> {
|
|
2980
2981
|
dataType: "bytea";
|
|
2981
2982
|
operators: OperatorsText;
|
|
2982
2983
|
constructor(schema: Schema);
|
|
2983
|
-
toCode(
|
|
2984
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2984
2985
|
}
|
|
2985
2986
|
declare class PointColumn<Schema extends ColumnSchemaConfig> extends ColumnType<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
|
|
2986
2987
|
dataType: "point";
|
|
2987
2988
|
operators: OperatorsText;
|
|
2988
2989
|
constructor(schema: Schema);
|
|
2989
|
-
toCode(
|
|
2990
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2990
2991
|
}
|
|
2991
2992
|
declare class LineColumn<Schema extends ColumnSchemaConfig> extends ColumnType<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
|
|
2992
2993
|
dataType: "line";
|
|
2993
2994
|
operators: OperatorsText;
|
|
2994
2995
|
constructor(schema: Schema);
|
|
2995
|
-
toCode(
|
|
2996
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
2996
2997
|
}
|
|
2997
2998
|
declare class LsegColumn<Schema extends ColumnSchemaConfig> extends ColumnType<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
|
|
2998
2999
|
dataType: "lseg";
|
|
2999
3000
|
operators: OperatorsText;
|
|
3000
3001
|
constructor(schema: Schema);
|
|
3001
|
-
toCode(
|
|
3002
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
3002
3003
|
}
|
|
3003
3004
|
declare class BoxColumn<Schema extends ColumnSchemaConfig> extends ColumnType<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
|
|
3004
3005
|
dataType: "box";
|
|
3005
3006
|
operators: OperatorsText;
|
|
3006
3007
|
constructor(schema: Schema);
|
|
3007
|
-
toCode(
|
|
3008
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
3008
3009
|
}
|
|
3009
3010
|
declare class PathColumn<Schema extends ColumnSchemaConfig> extends ColumnType<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
|
|
3010
3011
|
dataType: "path";
|
|
3011
3012
|
operators: OperatorsText;
|
|
3012
3013
|
constructor(schema: Schema);
|
|
3013
|
-
toCode(
|
|
3014
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
3014
3015
|
}
|
|
3015
3016
|
declare class PolygonColumn<Schema extends ColumnSchemaConfig> extends ColumnType<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
|
|
3016
3017
|
dataType: "polygon";
|
|
3017
3018
|
operators: OperatorsText;
|
|
3018
3019
|
constructor(schema: Schema);
|
|
3019
|
-
toCode(
|
|
3020
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
3020
3021
|
}
|
|
3021
3022
|
declare class CircleColumn<Schema extends ColumnSchemaConfig> extends ColumnType<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
|
|
3022
3023
|
dataType: "circle";
|
|
3023
3024
|
operators: OperatorsText;
|
|
3024
3025
|
constructor(schema: Schema);
|
|
3025
|
-
toCode(
|
|
3026
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
3026
3027
|
}
|
|
3027
3028
|
declare class MoneyColumn<Schema extends ColumnSchemaConfig> extends NumberBaseColumn<Schema, ReturnType<Schema['stringSchema']>> {
|
|
3028
3029
|
dataType: "money";
|
|
3029
3030
|
constructor(schema: Schema);
|
|
3030
|
-
toCode(
|
|
3031
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
3031
3032
|
parseFn: ((input: unknown) => number) & {
|
|
3032
3033
|
hideFromCode: boolean;
|
|
3033
3034
|
};
|
|
@@ -3036,25 +3037,25 @@ declare class CidrColumn<Schema extends ColumnSchemaConfig> extends ColumnType<S
|
|
|
3036
3037
|
dataType: "cidr";
|
|
3037
3038
|
operators: OperatorsText;
|
|
3038
3039
|
constructor(schema: Schema);
|
|
3039
|
-
toCode(
|
|
3040
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
3040
3041
|
}
|
|
3041
3042
|
declare class InetColumn<Schema extends ColumnSchemaConfig> extends ColumnType<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
|
|
3042
3043
|
dataType: "inet";
|
|
3043
3044
|
operators: OperatorsText;
|
|
3044
3045
|
constructor(schema: Schema);
|
|
3045
|
-
toCode(
|
|
3046
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
3046
3047
|
}
|
|
3047
3048
|
declare class MacAddrColumn<Schema extends ColumnSchemaConfig> extends ColumnType<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
|
|
3048
3049
|
dataType: "macaddr";
|
|
3049
3050
|
operators: OperatorsText;
|
|
3050
3051
|
constructor(schema: Schema);
|
|
3051
|
-
toCode(
|
|
3052
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
3052
3053
|
}
|
|
3053
3054
|
declare class MacAddr8Column<Schema extends ColumnSchemaConfig> extends ColumnType<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
|
|
3054
3055
|
dataType: "macaddr8";
|
|
3055
3056
|
operators: OperatorsText;
|
|
3056
3057
|
constructor(schema: Schema);
|
|
3057
|
-
toCode(
|
|
3058
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
3058
3059
|
}
|
|
3059
3060
|
declare class BitColumn<Schema extends ColumnSchemaConfig> extends ColumnType<Schema, string, ReturnType<Schema['bit']>, OperatorsText> {
|
|
3060
3061
|
dataType: "bit";
|
|
@@ -3063,7 +3064,7 @@ declare class BitColumn<Schema extends ColumnSchemaConfig> extends ColumnType<Sc
|
|
|
3063
3064
|
length: number;
|
|
3064
3065
|
};
|
|
3065
3066
|
constructor(schema: Schema, length: number);
|
|
3066
|
-
toCode(
|
|
3067
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
3067
3068
|
toSQL(): string;
|
|
3068
3069
|
}
|
|
3069
3070
|
declare class BitVaryingColumn<Schema extends ColumnSchemaConfig> extends ColumnType<Schema, string, ReturnType<Schema['bit']>, OperatorsText> {
|
|
@@ -3073,7 +3074,7 @@ declare class BitVaryingColumn<Schema extends ColumnSchemaConfig> extends Column
|
|
|
3073
3074
|
length?: number;
|
|
3074
3075
|
};
|
|
3075
3076
|
constructor(schema: Schema, length?: number);
|
|
3076
|
-
toCode(
|
|
3077
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
3077
3078
|
toSQL(): string;
|
|
3078
3079
|
}
|
|
3079
3080
|
type TsVectorGeneratedColumns = string[] | SearchWeightRecord;
|
|
@@ -3082,7 +3083,7 @@ declare class TsVectorColumn<Schema extends ColumnSchemaConfig> extends ColumnTy
|
|
|
3082
3083
|
dataType: "tsvector";
|
|
3083
3084
|
operators: OperatorsText;
|
|
3084
3085
|
constructor(schema: Schema, defaultLanguage?: string);
|
|
3085
|
-
toCode(
|
|
3086
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
3086
3087
|
/**
|
|
3087
3088
|
* For `tsvector` column type, it can also accept language (optional) and columns:
|
|
3088
3089
|
*
|
|
@@ -3113,7 +3114,7 @@ declare class TsQueryColumn<Schema extends ColumnSchemaConfig> extends ColumnTyp
|
|
|
3113
3114
|
dataType: "tsquery";
|
|
3114
3115
|
operators: OperatorsText;
|
|
3115
3116
|
constructor(schema: Schema);
|
|
3116
|
-
toCode(
|
|
3117
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
3117
3118
|
}
|
|
3118
3119
|
declare class UUIDColumn<Schema extends ColumnSchemaConfig> extends ColumnType<Schema, string, ReturnType<Schema['uuid']>, OperatorsText> {
|
|
3119
3120
|
dataType: "uuid";
|
|
@@ -3128,13 +3129,13 @@ declare class UUIDColumn<Schema extends ColumnSchemaConfig> extends ColumnType<S
|
|
|
3128
3129
|
default: RawSQLBase;
|
|
3129
3130
|
};
|
|
3130
3131
|
};
|
|
3131
|
-
toCode(
|
|
3132
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
3132
3133
|
}
|
|
3133
3134
|
declare class XMLColumn<Schema extends ColumnSchemaConfig> extends ColumnType<Schema, string, ReturnType<Schema['stringSchema']>, OperatorsText> {
|
|
3134
3135
|
dataType: "xml";
|
|
3135
3136
|
operators: OperatorsText;
|
|
3136
3137
|
constructor(schema: Schema);
|
|
3137
|
-
toCode(
|
|
3138
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
3138
3139
|
}
|
|
3139
3140
|
declare class CitextColumn<Schema extends ColumnSchemaConfig> extends TextBaseColumn<Schema> {
|
|
3140
3141
|
dataType: "citext";
|
|
@@ -3143,7 +3144,7 @@ declare class CitextColumn<Schema extends ColumnSchemaConfig> extends TextBaseCo
|
|
|
3143
3144
|
maxArg?: number;
|
|
3144
3145
|
};
|
|
3145
3146
|
constructor(schema: Schema);
|
|
3146
|
-
toCode(
|
|
3147
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
3147
3148
|
}
|
|
3148
3149
|
|
|
3149
3150
|
interface DefaultSchemaConfig extends ColumnSchemaConfig<ColumnType> {
|
|
@@ -7691,7 +7692,7 @@ declare class BooleanColumn<Schema extends ColumnSchemaConfig> extends ColumnTyp
|
|
|
7691
7692
|
dataType: "bool";
|
|
7692
7693
|
operators: OperatorsBoolean;
|
|
7693
7694
|
constructor(schema: Schema);
|
|
7694
|
-
toCode(
|
|
7695
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
7695
7696
|
parseItem: (input: string) => boolean;
|
|
7696
7697
|
}
|
|
7697
7698
|
|
|
@@ -7699,7 +7700,7 @@ declare class CustomTypeColumn<Schema extends ColumnSchemaConfig> extends Column
|
|
|
7699
7700
|
dataType: string;
|
|
7700
7701
|
operators: OperatorsAny;
|
|
7701
7702
|
constructor(schema: Schema, dataType: string);
|
|
7702
|
-
toCode(
|
|
7703
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
7703
7704
|
as<T extends {
|
|
7704
7705
|
inputType: unknown;
|
|
7705
7706
|
outputType: unknown;
|
|
@@ -7710,7 +7711,7 @@ declare class CustomTypeColumn<Schema extends ColumnSchemaConfig> extends Column
|
|
|
7710
7711
|
}>(this: T, column: C): C;
|
|
7711
7712
|
}
|
|
7712
7713
|
declare class DomainColumn<Schema extends ColumnSchemaConfig> extends CustomTypeColumn<Schema> {
|
|
7713
|
-
toCode(
|
|
7714
|
+
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
|
7714
7715
|
}
|
|
7715
7716
|
|
|
7716
7717
|
declare const getColumnTypes: <ColumnTypes, Shape extends QueryColumnsInit>(types: ColumnTypes, fn: (t: ColumnTypes) => Shape, nowSQL: string | undefined, language: string | undefined) => Shape;
|
|
@@ -7826,7 +7827,7 @@ declare class UnknownColumn<Schema extends ColumnSchemaConfig> extends VirtualCo
|
|
|
7826
7827
|
}
|
|
7827
7828
|
|
|
7828
7829
|
declare const isDefaultTimeStamp: (item: ColumnTypeBase) => boolean;
|
|
7829
|
-
declare const columnsShapeToCode: (
|
|
7830
|
+
declare const columnsShapeToCode: (ctx: ColumnToCodeCtx, shape: ColumnsShapeBase) => Codes;
|
|
7830
7831
|
declare const pushTableDataCode: (code: Codes, ast: TableData) => Codes;
|
|
7831
7832
|
declare const primaryKeyInnerToCode: (primaryKey: TableData.PrimaryKey, t: string) => string;
|
|
7832
7833
|
declare const indexToCode: (index: TableData.Index, t: string, prefix?: string) => Codes;
|
|
@@ -7837,9 +7838,9 @@ declare const referencesArgsToCode: ({ columns, fnOrTable, foreignColumns, optio
|
|
|
7837
7838
|
declare const columnForeignKeysToCode: (foreignKeys: TableData.ColumnReferences[], migration: boolean | undefined) => Codes;
|
|
7838
7839
|
declare const foreignKeyArgumentToCode: ({ fnOrTable, foreignColumns, options, }: TableData.ColumnReferences, migration: boolean | undefined) => Codes;
|
|
7839
7840
|
declare const columnIndexesToCode: (indexes: Exclude<ColumnData['indexes'], undefined>) => Codes;
|
|
7840
|
-
declare const columnCheckToCode: (
|
|
7841
|
+
declare const columnCheckToCode: (ctx: ColumnToCodeCtx, { sql, name }: ColumnDataCheckBase, columnName: string) => string;
|
|
7841
7842
|
declare const identityToCode: (identity: TableData.Identity, dataType?: string) => Codes;
|
|
7842
|
-
declare const columnCode: (type: ColumnType,
|
|
7843
|
+
declare const columnCode: (type: ColumnType, ctx: ColumnToCodeCtx, key: string, code: Code, data?: ColumnData, skip?: {
|
|
7843
7844
|
encodeFn: unknown;
|
|
7844
7845
|
}) => Code;
|
|
7845
7846
|
|