pqb 0.68.0 → 0.69.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1776,6 +1776,8 @@ declare class BooleanColumn<Schema extends ColumnSchemaConfig> extends Column {
1776
1776
  querySchema: ReturnType<Schema['boolean']>;
1777
1777
  private static _instance;
1778
1778
  static get instance(): BooleanColumn<DefaultSchemaConfig>;
1779
+ private static _instanceSkipValueToArray;
1780
+ static get instanceSkipValueToArray(): BooleanColumn<DefaultSchemaConfig>;
1779
1781
  constructor(schema: Schema);
1780
1782
  toCode(ctx: ColumnToCodeCtx, key: string): Code;
1781
1783
  }
@@ -1959,21 +1961,23 @@ interface JoinItem {
1959
1961
  type: string;
1960
1962
  args: JoinItemArgs;
1961
1963
  }
1962
- type getValueKey = typeof getValueKey;
1963
- declare const getValueKey: unique symbol;
1964
1964
  interface PickQueryDataParsers {
1965
1965
  defaultParsers?: ColumnsParsers;
1966
1966
  parsers?: ColumnsParsers;
1967
1967
  batchParsers?: BatchParsers;
1968
1968
  }
1969
1969
  type ColumnParser = FnUnknownToUnknown;
1970
+ interface BatchParserPathEntry {
1971
+ key: string;
1972
+ returnType: QueryReturnType;
1973
+ }
1970
1974
  interface BatchParser {
1971
- path: string[];
1972
- fn: (path: string[], queryResult: {
1975
+ path: BatchParserPathEntry[];
1976
+ fn: (path: BatchParserPathEntry[], queryResult: {
1973
1977
  rows: unknown[];
1974
1978
  }) => MaybePromise<void>;
1975
1979
  }
1976
- type ColumnsParsers = { [K in string | getValueKey]?: ColumnParser };
1980
+ type ColumnsParsers = { [K in string]?: ColumnParser };
1977
1981
  type BatchParsers = BatchParser[];
1978
1982
  interface QueryThen<T> {
1979
1983
  <TResult1 = T, TResult2 = never>(onfulfilled?: (value: T) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>;
@@ -5835,6 +5839,8 @@ interface Base$1<Value> {
5835
5839
  __hasSelect: true;
5836
5840
  equals: Operator<Value | IsQuery | Expression, BooleanQueryColumn>;
5837
5841
  not: Operator<Value | IsQuery | Expression, BooleanQueryColumn>;
5842
+ isDistinctFrom: Operator<Value | IsQuery | Expression, BooleanQueryColumn>;
5843
+ isNotDistinctFrom: Operator<Value | IsQuery | Expression, BooleanQueryColumn>;
5838
5844
  in: Operator<Value[] | IsQuery | Expression, BooleanQueryColumn>;
5839
5845
  notIn: Operator<Value[] | IsQuery | Expression, BooleanQueryColumn>;
5840
5846
  }
@@ -6069,6 +6075,7 @@ interface ExpressionData extends HasBeforeAndBeforeSet {
6069
6075
  expr?: Expression;
6070
6076
  before?: QueryBeforeHook[];
6071
6077
  dynamicBefore?: boolean;
6078
+ getColumn?: Column;
6072
6079
  }
6073
6080
  declare abstract class Expression<T extends Column.Pick.QueryColumn = Column.Pick.QueryColumn> {
6074
6081
  abstract result: {
@@ -6613,16 +6620,18 @@ declare namespace Column {
6613
6620
  unique: Name;
6614
6621
  };
6615
6622
  };
6616
- 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] };
6623
+ 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' | 'isDistinctFrom' | 'isNotDistinctFrom' ? Operator<T['__queryType'] | null, T> : T['operators'][K] } : T[K] };
6617
6624
  export type QueryColumnToNullable<C> = { [K in keyof C]: K extends '__outputType' | '__queryType' ? C[K] | null : C[K] };
6618
6625
  export type QueryColumnToOptional<C> = { [K in keyof C]: K extends '__outputType' ? C[K] | undefined : C[K] };
6619
6626
  interface DataNullable {
6620
6627
  isNullable: true;
6621
6628
  optional: true;
6622
6629
  }
6623
- export interface OperatorsNullable<T> {
6624
- equals: Operator<T | null>;
6625
- not: Operator<T | null>;
6630
+ export interface OperatorsNullable<Column extends Column.Pick.QueryColumn> {
6631
+ equals: Operator<Column['__queryType'] | null, Column>;
6632
+ not: Operator<Column['__queryType'] | null, Column>;
6633
+ isDistinctFrom: Operator<Column['__queryType'] | null, Column>;
6634
+ isNotDistinctFrom: Operator<Column['__queryType'] | null, Column>;
6626
6635
  }
6627
6636
  export type Encode<T, InputSchema, Input> = { [K in keyof T]: K extends '__inputType' ? Input : K extends 'inputSchema' ? InputSchema : T[K] };
6628
6637
  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] };
@@ -6815,6 +6824,8 @@ declare namespace Column {
6815
6824
  identity?: TableData.Identity;
6816
6825
  generated?: Data.Generated;
6817
6826
  readonly?: boolean;
6827
+ valueToArray?: boolean;
6828
+ skipValueToArray?: boolean;
6818
6829
  }
6819
6830
  export namespace Data {
6820
6831
  interface Check {
@@ -8963,7 +8974,7 @@ type SelectAllColumn = string | SelectAllColumnExpression;
8963
8974
  interface QueryData extends QueryDataAliases, PickQueryDataParsers, HasHookSelect, MutativeQueriesSelectRelationsQueryData {
8964
8975
  type: QueryType;
8965
8976
  adapter: Adapter;
8966
- shape: ColumnsShape;
8977
+ selectShape: ColumnsShape;
8967
8978
  handleResult: HandleResult;
8968
8979
  catch?: boolean;
8969
8980
  returnType: QueryReturnType;