New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ts-sql-query

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-sql-query - npm Package Compare versions

Comparing version 1.45.0 to 1.46.0

6

Connection.d.ts
import type { AbstractConnection } from "./connections/AbstractConnection";
import type { AnyDB, TypeSafeDB, TypeUnsafeDB } from "./databases";
export declare type TyeSafeConnection<DB extends AnyDB & TypeSafeDB> = Connection<DB>;
export declare type TyeUnsafeConnection<DB extends AnyDB & TypeUnsafeDB> = Connection<DB>;
export declare type Connection<DB extends AnyDB> = AbstractConnection<DB>;
export type TyeSafeConnection<DB extends AnyDB & TypeSafeDB> = Connection<DB>;
export type TyeUnsafeConnection<DB extends AnyDB & TypeUnsafeDB> = Connection<DB>;
export type Connection<DB extends AnyDB> = AbstractConnection<DB>;

@@ -28,3 +28,3 @@ "use strict";

case 'string':
return placeholder; // No cast needed
return placeholder + '::text';
case 'uuid':

@@ -31,0 +31,0 @@ return placeholder + '::uuid';

@@ -1,2 +0,2 @@

export declare type SqliteDateTimeFormat = 'localdate as text' | 'localdate as text using T separator' | 'UTC as text' | 'UTC as text using T separator' | 'UTC as text using Z timezone' | 'UTC as text using T separator and Z timezone' | 'Julian day as real number' | 'Unix time seconds as integer' | 'Unix time milliseconds as integer';
export declare type SqliteDateTimeFormatType = 'date' | 'time' | 'dateTime';
export type SqliteDateTimeFormat = 'localdate as text' | 'localdate as text using T separator' | 'UTC as text' | 'UTC as text using T separator' | 'UTC as text using Z timezone' | 'UTC as text using T separator and Z timezone' | 'Julian day as real number' | 'Unix time seconds as integer' | 'Unix time milliseconds as integer';
export type SqliteDateTimeFormatType = 'date' | 'time' | 'dateTime';

@@ -8,3 +8,3 @@ import type { anyDBType, mariaDBType, mySqlType, nextMethodNotSupportedByThisConnection, noopDBType, oracleType, postgreSqlType, sqliteType, sqlServerType, typeSafeDBType, typeUnsafeDBType } from "./utils/symbols";

}
export declare type TypeWhenSafeDB<DB extends AnyDB, when, els> = DB extends TypeSafeDB ? when : els;
export type TypeWhenSafeDB<DB extends AnyDB, when, els> = DB extends TypeSafeDB ? when : els;
export interface TypeUnsafeDB extends AnyDB {

@@ -11,0 +11,0 @@ [typeUnsafeDBType]: 'TypeUnsafe';

import { AnyValueSource } from './expressions/values';
import { MandatoryPropertiesOf } from './utils/resultUtils';
export type { DynamicCondition, TypeSafeDynamicCondition } from './expressions/dynamicConditionUsingFilters';
export declare type Pickable = {
export type Pickable = {
[key in string]?: AnyValueSource | Pickable;
};
export declare type DynamicPick<TYPE extends Pickable, MANDATORY extends MandatoryPaths<TYPE, ''> = never> = InternalDynamicPick<TYPE, MANDATORY, ''>;
declare type InternalDynamicPick<TYPE, MANDATORY extends string, PREFIX extends string> = Omit<{
export type DynamicPick<TYPE extends Pickable, MANDATORY extends MandatoryPaths<TYPE, ''> = never> = InternalDynamicPick<TYPE, MANDATORY, ''>;
type InternalDynamicPick<TYPE, MANDATORY extends string, PREFIX extends string> = Omit<{
[P in (keyof TYPE) & string]?: TYPE[P] extends AnyValueSource | undefined ? boolean : InternalDynamicPick<TYPE[P], MANDATORY, `${PREFIX}.${P}`> | boolean;
}, MadatoriesInType<TYPE, MANDATORY, PREFIX>>;
declare type PickWithMandatories<TYPE, MANDATORY extends string, PREFIX extends string> = Expand<{
type PickWithMandatories<TYPE, MANDATORY extends string, PREFIX extends string> = Expand<{
[P in OptionalValueSourcesInType<TYPE, MANDATORY, PREFIX>]?: TYPE[P];

@@ -18,12 +18,12 @@ } & {

}>;
declare type MadatoriesInType<TYPE, MANDATORY extends string, PREFIX extends string> = {
type MadatoriesInType<TYPE, MANDATORY extends string, PREFIX extends string> = {
[P in (keyof TYPE) & string]-?: `${PREFIX}${P}` extends MANDATORY ? P : never;
}[(keyof TYPE) & string];
declare type OptionalValueSourcesInType<TYPE, MANDATORY extends string, PREFIX extends string> = {
type OptionalValueSourcesInType<TYPE, MANDATORY extends string, PREFIX extends string> = {
[P in (keyof TYPE) & string]-?: TYPE[P] extends AnyValueSource | undefined ? (`${PREFIX}${P}` extends MANDATORY ? never : P) : never;
}[(keyof TYPE) & string];
declare type NonValueSourcesInType<TYPE, MANDATORY extends string, PREFIX extends string> = {
type NonValueSourcesInType<TYPE, MANDATORY extends string, PREFIX extends string> = {
[P in (keyof TYPE) & string]-?: TYPE[P] extends AnyValueSource | undefined ? never : `${PREFIX}${P}` extends MANDATORY ? never : P;
}[(keyof TYPE) & string];
declare type MandatoryPaths<TYPE, PREFIX extends string> = undefined extends TYPE ? never : TYPE extends AnyValueSource ? `${PREFIX}` : PREFIX extends '' ? {
type MandatoryPaths<TYPE, PREFIX extends string> = undefined extends TYPE ? never : TYPE extends AnyValueSource ? `${PREFIX}` : PREFIX extends '' ? {
[KEY in MandatoryPropertiesOf<TYPE> & string]: MandatoryPaths<TYPE[KEY], `${KEY}`>;

@@ -33,5 +33,5 @@ }[MandatoryPropertiesOf<TYPE> & string] : {

}[MandatoryPropertiesOf<TYPE> & string] | `${PREFIX}`;
declare type Expand<T> = T extends infer O ? {
type Expand<T> = T extends infer O ? {
[K in keyof O]: O[K];
} : never;
export declare function dynamicPick<TYPE extends Pickable, MANDATORY extends MandatoryPaths<TYPE, ''> = never>(obj: TYPE, pick: DynamicPick<TYPE>, mandatory?: MANDATORY[]): PickWithMandatories<TYPE, MANDATORY, ''>;

@@ -81,5 +81,5 @@ import type { AnyValueSource, IBooleanValueSource, IExecutableDeleteQuery, IIfValueSource, ValueSourceOf, ValueSourceValueTypeForResult } from "./values";

}
declare type UsingFnType<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>>(table: TABLE_OR_VIEW2) => DeleteUsingExpression<TABLE, USING | TABLE_OR_VIEW2> : never;
declare type OnExpressionFnType<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>>(table: TABLE_OR_VIEW2) => OnExpression<TABLE, USING | TABLE_OR_VIEW2> : never;
declare type OuterJoinOnExpressionFnType<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>, ALIAS>(source: OuterJoinSource<TABLE_OR_VIEW2, ALIAS>) => OnExpression<TABLE, USING | OuterJoinTableOrView<TABLE_OR_VIEW2, ALIAS>> : never;
type UsingFnType<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>>(table: TABLE_OR_VIEW2) => DeleteUsingExpression<TABLE, USING | TABLE_OR_VIEW2> : never;
type OnExpressionFnType<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>>(table: TABLE_OR_VIEW2) => OnExpression<TABLE, USING | TABLE_OR_VIEW2> : never;
type OuterJoinOnExpressionFnType<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>, ALIAS>(source: OuterJoinSource<TABLE_OR_VIEW2, ALIAS>) => OnExpression<TABLE, USING | OuterJoinTableOrView<TABLE_OR_VIEW2, ALIAS>> : never;
export interface DeleteWhereJoinExpressionAllowingNoWhere<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> extends DeleteWhereExpressionAllowingNoWhere<TABLE, USING> {

@@ -108,5 +108,5 @@ join<TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>>(table: TABLE_OR_VIEW2): OnExpressionAllowingNoWhere<TABLE, USING | TABLE_OR_VIEW2>;

}
declare type UsingFnTypeAllowingNoWhere<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>>(table: TABLE_OR_VIEW2) => DeleteUsingExpressionAllowingNoWhere<TABLE, USING | TABLE_OR_VIEW2> : never;
declare type OnExpressionFnTypeAllowingNoWhere<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>>(table: TABLE_OR_VIEW2) => OnExpressionAllowingNoWhere<TABLE, USING | TABLE_OR_VIEW2> : never;
declare type OuterJoinOnExpressionFnTypeAllowingNoWhere<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>, ALIAS>(source: OuterJoinSource<TABLE_OR_VIEW2, ALIAS>) => OnExpressionAllowingNoWhere<TABLE, USING | OuterJoinTableOrView<TABLE_OR_VIEW2, ALIAS>> : never;
type UsingFnTypeAllowingNoWhere<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>>(table: TABLE_OR_VIEW2) => DeleteUsingExpressionAllowingNoWhere<TABLE, USING | TABLE_OR_VIEW2> : never;
type OnExpressionFnTypeAllowingNoWhere<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>>(table: TABLE_OR_VIEW2) => OnExpressionAllowingNoWhere<TABLE, USING | TABLE_OR_VIEW2> : never;
type OuterJoinOnExpressionFnTypeAllowingNoWhere<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>, ALIAS>(source: OuterJoinSource<TABLE_OR_VIEW2, ALIAS>) => OnExpressionAllowingNoWhere<TABLE, USING | OuterJoinTableOrView<TABLE_OR_VIEW2, ALIAS>> : never;
export interface ReturnableExecutableDelete<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> extends CustomizableExecutableDelete<TABLE> {

@@ -304,5 +304,5 @@ returning: ReturningFnType<TABLE, USING>;

}
declare type ReturningFnType<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB | Oracle) ? <COLUMNS extends DeleteColumns<TABLE, USING>>(columns: COLUMNS) => ComposableCustomizableExecutableDelete<TABLE, COLUMNS, ResultObjectValues<COLUMNS>> : never;
declare type ReturningOneColumnFnType<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB | Oracle) ? <COLUMN extends ValueSourceOf<USING[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>>>(column: COLUMN) => ComposableCustomizableExecutableDelete<TABLE, COLUMN, ValueSourceValueTypeForResult<COLUMN>> : never;
export declare type DeleteColumns<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = {
type ReturningFnType<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB | Oracle) ? <COLUMNS extends DeleteColumns<TABLE, USING>>(columns: COLUMNS) => ComposableCustomizableExecutableDelete<TABLE, COLUMNS, ResultObjectValues<COLUMNS>> : never;
type ReturningOneColumnFnType<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB | Oracle) ? <COLUMN extends ValueSourceOf<USING[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>>>(column: COLUMN) => ComposableCustomizableExecutableDelete<TABLE, COLUMN, ValueSourceValueTypeForResult<COLUMN>> : never;
export type DeleteColumns<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = {
[P: string]: ValueSourceOf<USING[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>> | DeleteColumns<TABLE, USING>;

@@ -309,0 +309,0 @@ [P: number | symbol]: never;

@@ -151,9 +151,9 @@ import { double, int, LocalDate, LocalDateTime, LocalTime, stringDouble, stringInt, uuid } from "ts-extended-types";

}
export declare type FilterTypeOf<TYPE> = TYPE extends 'boolean' ? BooleanFilter : TYPE extends 'stringInt' ? StringNumberFilter : TYPE extends 'int' ? NumberFilter : TYPE extends 'bigint' ? BigintFilter : TYPE extends 'stringDouble' ? StringNumberFilter : TYPE extends 'double' ? NumberFilter : TYPE extends 'string' ? StringFilter : TYPE extends 'uuid' ? StringFilter : TYPE extends 'localDate' ? DateFilter : TYPE extends 'localTime' ? TimeFilter : TYPE extends 'localDateTime' ? DateTimeFilter : TYPE extends ['enum', infer T] ? EqualableFilter<T> : TYPE extends ['custom', infer T] ? EqualableFilter<T> : TYPE extends ['customComparable', infer T] ? ComparableFilter<T> : never;
export declare type TypeSafeFilterTypeOf<TYPE> = TYPE extends 'boolean' ? BooleanFilter : TYPE extends 'stringInt' ? StringIntFilter : TYPE extends 'int' ? IntFilter : TYPE extends 'bigint' ? BigintFilter : TYPE extends 'stringDouble' ? StringDoubleFilter : TYPE extends 'double' ? DoubleFilter : TYPE extends 'string' ? StringFilter : TYPE extends 'uuid' ? UuidFilter : TYPE extends 'localDate' ? LocalDateFilter : TYPE extends 'localTime' ? LocalTimeFilter : TYPE extends 'localDateTime' ? LocalDateTimeFilter : TYPE extends ['enum', infer T] ? EqualableFilter<T> : TYPE extends ['custom', infer T] ? EqualableFilter<T> : TYPE extends ['customComparable', infer T] ? ComparableFilter<T> : never;
export declare type DynamicColumnType<T> = 'boolean' | 'stringInt' | 'int' | 'bigint' | 'stringDouble' | 'double' | 'string' | 'uuid' | 'localDate' | 'localTime' | 'localDateTime' | ['enum', T] | ['custom', T] | ['customComparable', T];
export declare type DynamicDefinition = {
export type FilterTypeOf<TYPE> = TYPE extends 'boolean' ? BooleanFilter : TYPE extends 'stringInt' ? StringNumberFilter : TYPE extends 'int' ? NumberFilter : TYPE extends 'bigint' ? BigintFilter : TYPE extends 'stringDouble' ? StringNumberFilter : TYPE extends 'double' ? NumberFilter : TYPE extends 'string' ? StringFilter : TYPE extends 'uuid' ? StringFilter : TYPE extends 'localDate' ? DateFilter : TYPE extends 'localTime' ? TimeFilter : TYPE extends 'localDateTime' ? DateTimeFilter : TYPE extends ['enum', infer T] ? EqualableFilter<T> : TYPE extends ['custom', infer T] ? EqualableFilter<T> : TYPE extends ['customComparable', infer T] ? ComparableFilter<T> : never;
export type TypeSafeFilterTypeOf<TYPE> = TYPE extends 'boolean' ? BooleanFilter : TYPE extends 'stringInt' ? StringIntFilter : TYPE extends 'int' ? IntFilter : TYPE extends 'bigint' ? BigintFilter : TYPE extends 'stringDouble' ? StringDoubleFilter : TYPE extends 'double' ? DoubleFilter : TYPE extends 'string' ? StringFilter : TYPE extends 'uuid' ? UuidFilter : TYPE extends 'localDate' ? LocalDateFilter : TYPE extends 'localTime' ? LocalTimeFilter : TYPE extends 'localDateTime' ? LocalDateTimeFilter : TYPE extends ['enum', infer T] ? EqualableFilter<T> : TYPE extends ['custom', infer T] ? EqualableFilter<T> : TYPE extends ['customComparable', infer T] ? ComparableFilter<T> : never;
export type DynamicColumnType<T> = 'boolean' | 'stringInt' | 'int' | 'bigint' | 'stringDouble' | 'double' | 'string' | 'uuid' | 'localDate' | 'localTime' | 'localDateTime' | ['enum', T] | ['custom', T] | ['customComparable', T];
export type DynamicDefinition = {
[key: string]: DynamicColumnType<any> | DynamicDefinition;
};
export declare type DynamicCondition<DEFINITION extends DynamicDefinition> = {
export type DynamicCondition<DEFINITION extends DynamicDefinition> = {
not?: DynamicCondition<DEFINITION>;

@@ -165,3 +165,3 @@ and?: Array<DynamicCondition<DEFINITION> | undefined>;

};
export declare type TypeSafeDynamicCondition<DEFINITION extends DynamicDefinition> = {
export type TypeSafeDynamicCondition<DEFINITION extends DynamicDefinition> = {
not?: TypeSafeDynamicCondition<DEFINITION>;

@@ -173,7 +173,7 @@ and?: Array<TypeSafeDynamicCondition<DEFINITION> | undefined>;

};
export declare type MapValueSourceToFilter<TYPE> = TYPE extends IValueSource<any, infer T, any, any> ? (TYPE extends IBooleanValueSource<any, any> ? BooleanFilter : TYPE extends IStringIntValueSource<any, any> ? StringIntFilter : TYPE extends IIntValueSource<any, any> ? IntFilter : TYPE extends IStringDoubleValueSource<any, any> ? StringDoubleFilter : TYPE extends IDoubleValueSource<any, any> ? DoubleFilter : TYPE extends ITypeSafeBigintValueSource<any, any> ? BigintFilter : TYPE extends IBigintValueSource<any, any> ? BigintFilter : TYPE extends IStringNumberValueSource<any, any> ? StringNumberFilter : TYPE extends INumberValueSource<any, any> ? NumberFilter : TYPE extends ITypeSafeStringValueSource<any, any> ? StringFilter : TYPE extends IStringValueSource<any, any> ? StringFilter : TYPE extends ITypeSafeUuidValueSource<any, any> ? UuidFilter : TYPE extends IUuidValueSource<any, any> ? StringFilter : TYPE extends ILocalDateTimeValueSource<any, any> ? LocalDateTimeFilter : TYPE extends IDateTimeValueSource<any, any> ? DateTimeFilter : TYPE extends ILocalDateValueSource<any, any> ? LocalDateFilter : TYPE extends IDateValueSource<any, any> ? DateFilter : TYPE extends ILocalTimeValueSource<any, any> ? LocalTimeFilter : TYPE extends ITimeValueSource<any, any> ? TimeFilter : TYPE extends IComparableValueSource<any, any, any, any> ? ComparableFilter<T> : TYPE extends IEqualableValueSource<any, any, any, any> ? EqualableFilter<T> : TYPE extends INullableValueSource<any, any, any, any> ? NullableFilter : TYPE extends IAggregatedArrayValueSource<any, any, any> ? Filter | Array<Filter> : Filter) : never;
export declare type Filterable = {
export type MapValueSourceToFilter<TYPE> = TYPE extends IValueSource<any, infer T, any, any> ? (TYPE extends IBooleanValueSource<any, any> ? BooleanFilter : TYPE extends IStringIntValueSource<any, any> ? StringIntFilter : TYPE extends IIntValueSource<any, any> ? IntFilter : TYPE extends IStringDoubleValueSource<any, any> ? StringDoubleFilter : TYPE extends IDoubleValueSource<any, any> ? DoubleFilter : TYPE extends ITypeSafeBigintValueSource<any, any> ? BigintFilter : TYPE extends IBigintValueSource<any, any> ? BigintFilter : TYPE extends IStringNumberValueSource<any, any> ? StringNumberFilter : TYPE extends INumberValueSource<any, any> ? NumberFilter : TYPE extends ITypeSafeStringValueSource<any, any> ? StringFilter : TYPE extends IStringValueSource<any, any> ? StringFilter : TYPE extends ITypeSafeUuidValueSource<any, any> ? UuidFilter : TYPE extends IUuidValueSource<any, any> ? StringFilter : TYPE extends ILocalDateTimeValueSource<any, any> ? LocalDateTimeFilter : TYPE extends IDateTimeValueSource<any, any> ? DateTimeFilter : TYPE extends ILocalDateValueSource<any, any> ? LocalDateFilter : TYPE extends IDateValueSource<any, any> ? DateFilter : TYPE extends ILocalTimeValueSource<any, any> ? LocalTimeFilter : TYPE extends ITimeValueSource<any, any> ? TimeFilter : TYPE extends IComparableValueSource<any, any, any, any> ? ComparableFilter<T> : TYPE extends IEqualableValueSource<any, any, any, any> ? EqualableFilter<T> : TYPE extends INullableValueSource<any, any, any, any> ? NullableFilter : TYPE extends IAggregatedArrayValueSource<any, any, any> ? Filter | Array<Filter> : Filter) : never;
export type Filterable = {
[key: string]: AnyValueSource | Filterable;
};
export declare type DynamicFilter<DEFINITION extends Filterable> = {
export type DynamicFilter<DEFINITION extends Filterable> = {
not?: DynamicFilter<DEFINITION>;

@@ -188,9 +188,9 @@ and?: Array<DynamicFilter<DEFINITION> | undefined>;

}
export declare type TableOfValueSource<TYPE> = TYPE extends ValueSourceOf<infer T> ? T : never;
export declare type OptionalTypeOfValueSource<TYPE> = TYPE extends IValueSource<any, any, any, infer T> ? T : never;
export declare type BooleanOptionalTypeOfCondition<DEFINITION extends Filterable> = MergeOptionalUnion<({
export type TableOfValueSource<TYPE> = TYPE extends ValueSourceOf<infer T> ? T : never;
export type OptionalTypeOfValueSource<TYPE> = TYPE extends IValueSource<any, any, any, infer T> ? T : never;
export type BooleanOptionalTypeOfCondition<DEFINITION extends Filterable> = MergeOptionalUnion<({
[KEY in keyof DEFINITION]: OptionalTypeOfValueSource<DEFINITION[KEY]>;
})[keyof DEFINITION]>;
export declare type TableOfCondition<DEFINITION extends Filterable> = ({
export type TableOfCondition<DEFINITION extends Filterable> = ({
[KEY in keyof DEFINITION]: TableOfValueSource<DEFINITION[KEY]>;
})[keyof DEFINITION];

@@ -533,17 +533,17 @@ import type { IExecutableSelectQuery, RemapIValueSourceType, ValueSourceValueType, AnyValueSource, ValueSourceOf, ValueSourceValueTypeForResult, RemapIValueSourceTypeWithOptionalType, IExecutableInsertQuery, IIfValueSource, IBooleanValueSource, IStringValueSource, ITypeSafeStringValueSource } from "./values";

}
declare type ReturningFnType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB | Oracle) ? <COLUMNS extends InsertColumns<TABLE>>(columns: COLUMNS) => ComposableCustomizableExecutableInsert<TABLE, COLUMNS, ResultObjectValues<COLUMNS>> : never;
declare type ReturningOneColumnFnType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB | Oracle) ? <COLUMN extends ValueSourceOf<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>>>(column: COLUMN) => ComposableCustomizableExecutableInsert<TABLE, COLUMN, ValueSourceValueTypeForResult<COLUMN>> : never;
declare type ReturningFromSelectFnType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB) ? <COLUMNS extends InsertColumns<TABLE>>(columns: COLUMNS) => ComposableCustomizableExecutableInsert<TABLE, COLUMNS, ResultObjectValues<COLUMNS>> : never;
declare type ReturningOneColumnFromSelectFnType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB) ? <COLUMN extends ValueSourceOf<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>>>(column: COLUMN) => ComposableCustomizableExecutableInsert<TABLE, COLUMN, ValueSourceValueTypeForResult<COLUMN>> : never;
declare type ReturningMultipleLastInsertedIdType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Oracle | Sqlite | MariaDB) ? AutogeneratedPrimaryKeyColumnsTypesOf<TABLE> extends never ? never : () => CustomizableExecutableInsertReturningLastInsertedId<TABLE, AutogeneratedPrimaryKeyColumnsTypesOf<TABLE>[]> : never;
declare type ReturningLastInsertedIdType<TABLE extends ITableOrView<any>> = AutogeneratedPrimaryKeyColumnsTypesOf<TABLE> extends never ? never : () => CustomizableExecutableInsertReturningLastInsertedId<TABLE, AutogeneratedPrimaryKeyColumnsTypesOf<TABLE>>;
declare type OnConflictReturningLastInsertedIdType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | Sqlite | MariaDB) ? AutogeneratedPrimaryKeyColumnsTypesOf<TABLE> extends never ? never : () => CustomizableExecutableInsertReturningLastInsertedId<TABLE, AutogeneratedPrimaryKeyColumnsTypesOf<TABLE>> : never;
declare type ReturningLastInsertedIdFromSelectType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB) ? AutogeneratedPrimaryKeyColumnsTypesOf<TABLE> extends never ? never : () => CustomizableExecutableInsertReturningLastInsertedId<TABLE, AutogeneratedPrimaryKeyColumnsTypesOf<TABLE>[]> : never;
declare type ReturningOptionalFnType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB | Oracle) ? <COLUMNS extends InsertColumns<TABLE>>(columns: COLUMNS) => ComposableCustomizableExecutableInsertOptional<TABLE, COLUMNS, ResultObjectValues<COLUMNS>> : never;
declare type ReturningOneColumnOptionalFnType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB | Oracle) ? <COLUMN extends ValueSourceOf<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>>>(column: COLUMN) => ComposableCustomizableExecutableInsertOptional<TABLE, COLUMN, ValueSourceValueTypeForResult<COLUMN> | null> : never;
declare type ReturningFromSelectOptionalFnType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB) ? <COLUMNS extends InsertColumns<TABLE>>(columns: COLUMNS) => ComposableCustomizableExecutableInsertOptional<TABLE, COLUMNS, ResultObjectValues<COLUMNS> | null> : never;
declare type ReturningOneColumnFromSelectOptionalFnType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB) ? <COLUMN extends ValueSourceOf<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>>>(column: COLUMN) => ComposableCustomizableExecutableInsertOptional<TABLE, COLUMN, ValueSourceValueTypeForResult<COLUMN> | null> : never;
declare type ReturningMultipleLastInsertedIdOptionalType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Oracle | Sqlite | MariaDB) ? AutogeneratedPrimaryKeyColumnsTypesOf<TABLE> extends never ? never : () => CustomizableExecutableInsertReturningLastInsertedId<TABLE, AutogeneratedPrimaryKeyColumnsTypesOf<TABLE>[]> : never;
declare type OnConflictReturningLastInsertedIdOptionalType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | Sqlite | MariaDB) ? AutogeneratedPrimaryKeyColumnsTypesOf<TABLE> extends never ? never : () => CustomizableExecutableInsertReturningLastInsertedId<TABLE, AutogeneratedPrimaryKeyColumnsTypesOf<TABLE> | null> : never;
declare type ReturningLastInsertedIdFromSelectOptionalType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB) ? AutogeneratedPrimaryKeyColumnsTypesOf<TABLE> extends never ? never : () => CustomizableExecutableInsertReturningLastInsertedId<TABLE, AutogeneratedPrimaryKeyColumnsTypesOf<TABLE>[]> : never;
type ReturningFnType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB | Oracle) ? <COLUMNS extends InsertColumns<TABLE>>(columns: COLUMNS) => ComposableCustomizableExecutableInsert<TABLE, COLUMNS, ResultObjectValues<COLUMNS>> : never;
type ReturningOneColumnFnType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB | Oracle) ? <COLUMN extends ValueSourceOf<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>>>(column: COLUMN) => ComposableCustomizableExecutableInsert<TABLE, COLUMN, ValueSourceValueTypeForResult<COLUMN>> : never;
type ReturningFromSelectFnType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB) ? <COLUMNS extends InsertColumns<TABLE>>(columns: COLUMNS) => ComposableCustomizableExecutableInsert<TABLE, COLUMNS, ResultObjectValues<COLUMNS>> : never;
type ReturningOneColumnFromSelectFnType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB) ? <COLUMN extends ValueSourceOf<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>>>(column: COLUMN) => ComposableCustomizableExecutableInsert<TABLE, COLUMN, ValueSourceValueTypeForResult<COLUMN>> : never;
type ReturningMultipleLastInsertedIdType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Oracle | Sqlite | MariaDB) ? AutogeneratedPrimaryKeyColumnsTypesOf<TABLE> extends never ? never : () => CustomizableExecutableInsertReturningLastInsertedId<TABLE, AutogeneratedPrimaryKeyColumnsTypesOf<TABLE>[]> : never;
type ReturningLastInsertedIdType<TABLE extends ITableOrView<any>> = AutogeneratedPrimaryKeyColumnsTypesOf<TABLE> extends never ? never : () => CustomizableExecutableInsertReturningLastInsertedId<TABLE, AutogeneratedPrimaryKeyColumnsTypesOf<TABLE>>;
type OnConflictReturningLastInsertedIdType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | Sqlite | MariaDB) ? AutogeneratedPrimaryKeyColumnsTypesOf<TABLE> extends never ? never : () => CustomizableExecutableInsertReturningLastInsertedId<TABLE, AutogeneratedPrimaryKeyColumnsTypesOf<TABLE>> : never;
type ReturningLastInsertedIdFromSelectType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB) ? AutogeneratedPrimaryKeyColumnsTypesOf<TABLE> extends never ? never : () => CustomizableExecutableInsertReturningLastInsertedId<TABLE, AutogeneratedPrimaryKeyColumnsTypesOf<TABLE>[]> : never;
type ReturningOptionalFnType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB | Oracle) ? <COLUMNS extends InsertColumns<TABLE>>(columns: COLUMNS) => ComposableCustomizableExecutableInsertOptional<TABLE, COLUMNS, ResultObjectValues<COLUMNS>> : never;
type ReturningOneColumnOptionalFnType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB | Oracle) ? <COLUMN extends ValueSourceOf<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>>>(column: COLUMN) => ComposableCustomizableExecutableInsertOptional<TABLE, COLUMN, ValueSourceValueTypeForResult<COLUMN> | null> : never;
type ReturningFromSelectOptionalFnType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB) ? <COLUMNS extends InsertColumns<TABLE>>(columns: COLUMNS) => ComposableCustomizableExecutableInsertOptional<TABLE, COLUMNS, ResultObjectValues<COLUMNS> | null> : never;
type ReturningOneColumnFromSelectOptionalFnType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB) ? <COLUMN extends ValueSourceOf<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>>>(column: COLUMN) => ComposableCustomizableExecutableInsertOptional<TABLE, COLUMN, ValueSourceValueTypeForResult<COLUMN> | null> : never;
type ReturningMultipleLastInsertedIdOptionalType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Oracle | Sqlite | MariaDB) ? AutogeneratedPrimaryKeyColumnsTypesOf<TABLE> extends never ? never : () => CustomizableExecutableInsertReturningLastInsertedId<TABLE, AutogeneratedPrimaryKeyColumnsTypesOf<TABLE>[]> : never;
type OnConflictReturningLastInsertedIdOptionalType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | Sqlite | MariaDB) ? AutogeneratedPrimaryKeyColumnsTypesOf<TABLE> extends never ? never : () => CustomizableExecutableInsertReturningLastInsertedId<TABLE, AutogeneratedPrimaryKeyColumnsTypesOf<TABLE> | null> : never;
type ReturningLastInsertedIdFromSelectOptionalType<TABLE extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB) ? AutogeneratedPrimaryKeyColumnsTypesOf<TABLE> extends never ? never : () => CustomizableExecutableInsertReturningLastInsertedId<TABLE, AutogeneratedPrimaryKeyColumnsTypesOf<TABLE>[]> : never;
export interface InsertOnConflictSetsExpression<TABLE extends ITableOrView<any>, NEXT, NEXT_WHERE> {

@@ -578,7 +578,7 @@ set(columns: OnConflictUpdateSets<TABLE>): InsertOnConflictSetsExpression<TABLE, NEXT, NEXT_WHERE> & NEXT;

}
declare type OnConflictDoNothingFnType<TABLE extends ITableOrView<any>, NEXT> = TABLE[typeof database] extends (NoopDB | PostgreSql | Sqlite | MariaDB | MySql) ? () => NEXT : never;
declare type OnConflictDoUpdateDynamicSetFnType<TABLE extends ITableOrView<any>, NEXT, NEXT_WHERE> = TABLE[typeof database] extends (NoopDB | PostgreSql | Sqlite | MariaDB | MySql) ? () => InsertOnConflictSetsExpression<TABLE, NEXT, NEXT_WHERE> & NEXT : never;
declare type OnConflictDoUpdateSetFnType<TABLE extends ITableOrView<any>, NEXT, NEXT_WHERE> = TABLE[typeof database] extends (NoopDB | PostgreSql | Sqlite | MariaDB | MySql) ? (columns: OnConflictUpdateSets<TABLE>) => InsertOnConflictSetsExpression<TABLE, NEXT, NEXT_WHERE> & NEXT : never;
declare type OnConflictDoUpdateDynamicWhereFnType<TABLE extends ITableOrView<any>, NEXT> = TABLE[typeof database] extends (NoopDB | PostgreSql | Sqlite) ? () => DynamicOnConflictWhereExpression<TABLE, NEXT> & NEXT : never;
declare type OnConflictDoUpdateWhereFnType<TABLE extends ITableOrView<any>, NEXT> = TABLE[typeof database] extends (NoopDB | PostgreSql | Sqlite) ? OnConflictDoUpdateWhereFnTypeInterface<TABLE, NEXT> : never;
type OnConflictDoNothingFnType<TABLE extends ITableOrView<any>, NEXT> = TABLE[typeof database] extends (NoopDB | PostgreSql | Sqlite | MariaDB | MySql) ? () => NEXT : never;
type OnConflictDoUpdateDynamicSetFnType<TABLE extends ITableOrView<any>, NEXT, NEXT_WHERE> = TABLE[typeof database] extends (NoopDB | PostgreSql | Sqlite | MariaDB | MySql) ? () => InsertOnConflictSetsExpression<TABLE, NEXT, NEXT_WHERE> & NEXT : never;
type OnConflictDoUpdateSetFnType<TABLE extends ITableOrView<any>, NEXT, NEXT_WHERE> = TABLE[typeof database] extends (NoopDB | PostgreSql | Sqlite | MariaDB | MySql) ? (columns: OnConflictUpdateSets<TABLE>) => InsertOnConflictSetsExpression<TABLE, NEXT, NEXT_WHERE> & NEXT : never;
type OnConflictDoUpdateDynamicWhereFnType<TABLE extends ITableOrView<any>, NEXT> = TABLE[typeof database] extends (NoopDB | PostgreSql | Sqlite) ? () => DynamicOnConflictWhereExpression<TABLE, NEXT> & NEXT : never;
type OnConflictDoUpdateWhereFnType<TABLE extends ITableOrView<any>, NEXT> = TABLE[typeof database] extends (NoopDB | PostgreSql | Sqlite) ? OnConflictDoUpdateWhereFnTypeInterface<TABLE, NEXT> : never;
interface OnConflictDoUpdateWhereFnTypeInterface<TABLE extends ITableOrView<any>, NEXT> {

@@ -588,4 +588,4 @@ (condition: IIfValueSource<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, any>): DynamicOnConflictWhereExpression<TABLE, NEXT> & NEXT;

}
declare type OnConflictOnColumnFnType<TABLE extends ITableOrView<any>, NEXT> = TABLE[typeof database] extends (NoopDB | PostgreSql | Sqlite) ? (column: ValueSourceOf<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>>, ...columns: ValueSourceOf<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>>[]) => NEXT & OnConflictOnColumnWhere<TABLE, NEXT> : never;
declare type OnConflictOnConstraintFnType<TABLE extends ITableOrView<any>, NEXT> = TABLE[typeof database] extends (NoopDB | PostgreSql) ? OnConflictOnConstraintFnTypeInterface<TABLE, NEXT> : never;
type OnConflictOnColumnFnType<TABLE extends ITableOrView<any>, NEXT> = TABLE[typeof database] extends (NoopDB | PostgreSql | Sqlite) ? (column: ValueSourceOf<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>>, ...columns: ValueSourceOf<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>>[]) => NEXT & OnConflictOnColumnWhere<TABLE, NEXT> : never;
type OnConflictOnConstraintFnType<TABLE extends ITableOrView<any>, NEXT> = TABLE[typeof database] extends (NoopDB | PostgreSql) ? OnConflictOnConstraintFnTypeInterface<TABLE, NEXT> : never;
interface OnConflictOnConstraintFnTypeInterface<TABLE extends ITableOrView<any>, NEXT> {

@@ -596,9 +596,9 @@ (constraint: string): NEXT;

}
export declare type InsertColumns<TABLE extends ITableOrView<any>> = {
export type InsertColumns<TABLE extends ITableOrView<any>> = {
[P: string]: ValueSourceOf<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>> | InsertColumns<TABLE>;
[P: number | symbol]: never;
};
declare type DefaultValueType<TABLE extends ITableOrView<any>> = unknown extends TABLE ? () => CustomizableExecutableSimpleInsertOnConflict<TABLE> : RequiredColumnsForSetOf<TABLE> extends never ? () => CustomizableExecutableSimpleInsertOnConflict<TABLE> : never;
declare type MaybeExecutableInsertExpression<TABLE extends ITableOrView<any>, MISSING_KEYS> = MISSING_KEYS extends never ? ExecutableInsertExpression<TABLE> : MissingKeysInsertExpression<TABLE, MISSING_KEYS>;
declare type SelectForInsertResultType<TABLE extends ITableOrView<any>> = {
type DefaultValueType<TABLE extends ITableOrView<any>> = unknown extends TABLE ? () => CustomizableExecutableSimpleInsertOnConflict<TABLE> : RequiredColumnsForSetOf<TABLE> extends never ? () => CustomizableExecutableSimpleInsertOnConflict<TABLE> : never;
type MaybeExecutableInsertExpression<TABLE extends ITableOrView<any>, MISSING_KEYS> = MISSING_KEYS extends never ? ExecutableInsertExpression<TABLE> : MissingKeysInsertExpression<TABLE, MISSING_KEYS>;
type SelectForInsertResultType<TABLE extends ITableOrView<any>> = {
[P in RequiredColumnsForSetOf<TABLE>]: ValueSourceValueType<TABLE[P]>;

@@ -608,3 +608,3 @@ } & {

};
declare type SelectForInsertColumns<TABLE extends ITableOrView<any>> = {
type SelectForInsertColumns<TABLE extends ITableOrView<any>> = {
[P in RequiredColumnsForSetOf<TABLE>]: RemapIValueSourceType<any, TABLE[P]>;

@@ -614,3 +614,3 @@ } & {

};
export declare type InsertSets<TABLE extends ITableOrView<any>> = {
export type InsertSets<TABLE extends ITableOrView<any>> = {
[P in RequiredColumnsForSetOf<TABLE>]?: InputTypeOfColumn<TABLE, P>;

@@ -620,3 +620,3 @@ } & {

};
export declare type OptionalInsertSets<TABLE extends ITableOrView<any>> = {
export type OptionalInsertSets<TABLE extends ITableOrView<any>> = {
[P in RequiredColumnsForSetOf<TABLE>]?: InputTypeOfColumn<TABLE, P> | null | undefined;

@@ -626,3 +626,3 @@ } & {

};
export declare type MandatoryInsertSets<TABLE extends ITableOrView<any>> = {
export type MandatoryInsertSets<TABLE extends ITableOrView<any>> = {
[P in RequiredColumnsForSetOf<TABLE>]: InputTypeOfColumn<TABLE, P>;

@@ -632,3 +632,3 @@ } & {

};
export declare type MandatoryInsertValues<TABLE extends ITableOrView<any>> = {
export type MandatoryInsertValues<TABLE extends ITableOrView<any>> = {
[P in RequiredColumnsForSetOf<TABLE>]: ValueSourceValueType<TABLE[P]>;

@@ -638,3 +638,3 @@ } & {

};
declare type MandatoryOptionalInsertSets<TABLE extends ITableOrView<any>> = {
type MandatoryOptionalInsertSets<TABLE extends ITableOrView<any>> = {
[P in RequiredColumnsForSetOf<TABLE>]: InputTypeOfColumn<TABLE, P>;

@@ -644,5 +644,5 @@ } & {

};
declare type InputTypeOfColumn<TABLE extends ITableOrView<any>, K extends ColumnsOf<TABLE>> = TABLE[K] extends ValueSourceOf<TABLE[typeof tableOrViewRef]> ? (TABLE[K] extends ColumnWithDefaultValue ? (ValueSourceValueType<TABLE[K]> | RemapIValueSourceType<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, TABLE[K]> | Default) : (ValueSourceValueType<TABLE[K]> | RemapIValueSourceType<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, TABLE[K]>)) : never;
declare type InputTypeOfOptionalColumn<TABLE extends ITableOrView<any>, K extends ColumnsOf<TABLE>> = TABLE[K] extends ValueSourceOf<TABLE[typeof tableOrViewRef]> ? (TABLE[K] extends ColumnWithDefaultValue ? (ValueSourceValueType<TABLE[K]> | RemapIValueSourceTypeWithOptionalType<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, TABLE[K], any> | Default) : (ValueSourceValueType<TABLE[K]> | RemapIValueSourceTypeWithOptionalType<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, TABLE[K], any>)) : never;
declare type OnConflictUpdateSets<TABLE extends ITableOrView<any>> = {
type InputTypeOfColumn<TABLE extends ITableOrView<any>, K extends ColumnsOf<TABLE>> = TABLE[K] extends ValueSourceOf<TABLE[typeof tableOrViewRef]> ? (TABLE[K] extends ColumnWithDefaultValue ? (ValueSourceValueType<TABLE[K]> | RemapIValueSourceType<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, TABLE[K]> | Default) : (ValueSourceValueType<TABLE[K]> | RemapIValueSourceType<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, TABLE[K]>)) : never;
type InputTypeOfOptionalColumn<TABLE extends ITableOrView<any>, K extends ColumnsOf<TABLE>> = TABLE[K] extends ValueSourceOf<TABLE[typeof tableOrViewRef]> ? (TABLE[K] extends ColumnWithDefaultValue ? (ValueSourceValueType<TABLE[K]> | RemapIValueSourceTypeWithOptionalType<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, TABLE[K], any> | Default) : (ValueSourceValueType<TABLE[K]> | RemapIValueSourceTypeWithOptionalType<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, TABLE[K], any>)) : never;
type OnConflictUpdateSets<TABLE extends ITableOrView<any>> = {
[P in RequiredColumnsForSetOf<TABLE>]?: OnConflictInputTypeOfColumn<TABLE, P>;

@@ -652,3 +652,3 @@ } & {

};
declare type OnConflictOptionalUpdateSets<TABLE extends ITableOrView<any>> = {
type OnConflictOptionalUpdateSets<TABLE extends ITableOrView<any>> = {
[P in RequiredColumnsForSetOf<TABLE>]?: OnConflictInputTypeOfColumn<TABLE, P> | null | undefined;

@@ -658,4 +658,4 @@ } & {

};
declare type OnConflictInputTypeOfColumn<TABLE extends ITableOrView<any>, K extends ColumnsOf<TABLE>> = TABLE[K] extends ValueSourceOf<TABLE[typeof tableOrViewRef]> ? (TABLE[K] extends ColumnWithDefaultValue ? (ValueSourceValueType<TABLE[K]> | RemapIValueSourceType<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]> | VALUES_FOR_INSERT<TABLE[typeof tableOrViewRef]>, TABLE[K]> | Default) : (ValueSourceValueType<TABLE[K]> | RemapIValueSourceType<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]> | VALUES_FOR_INSERT<TABLE[typeof tableOrViewRef]>, TABLE[K]>)) : never;
declare type OnConflictInputTypeOfOptionalColumn<TABLE extends ITableOrView<any>, K extends ColumnsOf<TABLE>> = TABLE[K] extends ValueSourceOf<TABLE[typeof tableOrViewRef]> ? (TABLE[K] extends ColumnWithDefaultValue ? (ValueSourceValueType<TABLE[K]> | RemapIValueSourceTypeWithOptionalType<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]> | VALUES_FOR_INSERT<TABLE[typeof tableOrViewRef]>, TABLE[K], any> | Default) : (ValueSourceValueType<TABLE[K]> | RemapIValueSourceTypeWithOptionalType<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]> | VALUES_FOR_INSERT<TABLE[typeof tableOrViewRef]>, TABLE[K], any>)) : never;
type OnConflictInputTypeOfColumn<TABLE extends ITableOrView<any>, K extends ColumnsOf<TABLE>> = TABLE[K] extends ValueSourceOf<TABLE[typeof tableOrViewRef]> ? (TABLE[K] extends ColumnWithDefaultValue ? (ValueSourceValueType<TABLE[K]> | RemapIValueSourceType<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]> | VALUES_FOR_INSERT<TABLE[typeof tableOrViewRef]>, TABLE[K]> | Default) : (ValueSourceValueType<TABLE[K]> | RemapIValueSourceType<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]> | VALUES_FOR_INSERT<TABLE[typeof tableOrViewRef]>, TABLE[K]>)) : never;
type OnConflictInputTypeOfOptionalColumn<TABLE extends ITableOrView<any>, K extends ColumnsOf<TABLE>> = TABLE[K] extends ValueSourceOf<TABLE[typeof tableOrViewRef]> ? (TABLE[K] extends ColumnWithDefaultValue ? (ValueSourceValueType<TABLE[K]> | RemapIValueSourceTypeWithOptionalType<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]> | VALUES_FOR_INSERT<TABLE[typeof tableOrViewRef]>, TABLE[K], any> | Default) : (ValueSourceValueType<TABLE[K]> | RemapIValueSourceTypeWithOptionalType<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]> | VALUES_FOR_INSERT<TABLE[typeof tableOrViewRef]>, TABLE[K], any>)) : never;
export {};

@@ -98,3 +98,3 @@ import type { AnyValueSource, IBooleanValueSource, IExecutableUpdateQuery, IIfValueSource, RemapIValueSourceType, RemapIValueSourceTypeWithOptionalType, ValueSourceOf, ValueSourceValueType, ValueSourceValueTypeForResult } from "./values";

}
export declare type UpdateSets<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = {
export type UpdateSets<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = {
[P in RequiredColumnsForSetOf<TABLE>]?: InputTypeOfColumnAllowing<TABLE, P, USING>;

@@ -104,3 +104,3 @@ } & {

};
export declare type UpdateValues<TABLE extends ITableOrView<any>> = {
export type UpdateValues<TABLE extends ITableOrView<any>> = {
[P in RequiredColumnsForSetOf<TABLE>]?: ValueSourceValueType<TABLE[P]>;

@@ -110,3 +110,3 @@ } & {

};
export declare type OptionalUpdateSets<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = {
export type OptionalUpdateSets<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = {
[P in RequiredColumnsForSetOf<TABLE>]?: InputTypeOfColumnAllowing<TABLE, P, USING> | null | undefined;

@@ -116,4 +116,4 @@ } & {

};
declare type InputTypeOfColumnAllowing<TABLE extends ITableOrView<any>, K extends ColumnsOf<TABLE>, ALLOWING extends ITableOrView<any>> = TABLE[K] extends ValueSourceOf<TABLE[typeof tableOrViewRef]> ? (TABLE[K] extends ColumnWithDefaultValue ? (ValueSourceValueType<TABLE[K]> | RemapIValueSourceType<ALLOWING[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, TABLE[K]> | Default) : (ValueSourceValueType<TABLE[K]> | RemapIValueSourceType<ALLOWING[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, TABLE[K]>)) : never;
declare type InputTypeOfOptionalColumnAllowing<TABLE extends ITableOrView<any>, K extends ColumnsOf<TABLE>, ALLOWING extends ITableOrView<any>> = TABLE[K] extends ValueSourceOf<TABLE[typeof tableOrViewRef]> ? (TABLE[K] extends ColumnWithDefaultValue ? (ValueSourceValueType<TABLE[K]> | RemapIValueSourceTypeWithOptionalType<ALLOWING[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, TABLE[K], any> | Default) : (ValueSourceValueType<TABLE[K]> | RemapIValueSourceTypeWithOptionalType<ALLOWING[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, TABLE[K], any>)) : never;
type InputTypeOfColumnAllowing<TABLE extends ITableOrView<any>, K extends ColumnsOf<TABLE>, ALLOWING extends ITableOrView<any>> = TABLE[K] extends ValueSourceOf<TABLE[typeof tableOrViewRef]> ? (TABLE[K] extends ColumnWithDefaultValue ? (ValueSourceValueType<TABLE[K]> | RemapIValueSourceType<ALLOWING[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, TABLE[K]> | Default) : (ValueSourceValueType<TABLE[K]> | RemapIValueSourceType<ALLOWING[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, TABLE[K]>)) : never;
type InputTypeOfOptionalColumnAllowing<TABLE extends ITableOrView<any>, K extends ColumnsOf<TABLE>, ALLOWING extends ITableOrView<any>> = TABLE[K] extends ValueSourceOf<TABLE[typeof tableOrViewRef]> ? (TABLE[K] extends ColumnWithDefaultValue ? (ValueSourceValueType<TABLE[K]> | RemapIValueSourceTypeWithOptionalType<ALLOWING[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, TABLE[K], any> | Default) : (ValueSourceValueType<TABLE[K]> | RemapIValueSourceTypeWithOptionalType<ALLOWING[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, TABLE[K], any>)) : never;
export interface UpdateSetJoinExpression<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> extends UpdateSetExpression<TABLE, USING> {

@@ -142,5 +142,5 @@ join<TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>>(table: TABLE_OR_VIEW2): OnExpression<TABLE, USING | TABLE_OR_VIEW2>;

}
declare type FromFnType<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>>(table: TABLE_OR_VIEW2) => UpdateFromExpression<TABLE, USING | TABLE_OR_VIEW2> : never;
declare type OnExpressionFnType<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>>(table: TABLE_OR_VIEW2) => OnExpression<TABLE, USING | TABLE_OR_VIEW2> : never;
declare type OuterJoinOnExpressionFnType<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>, ALIAS>(source: OuterJoinSource<TABLE_OR_VIEW2, ALIAS>) => OnExpression<TABLE, USING | OuterJoinTableOrView<TABLE_OR_VIEW2, ALIAS>> : never;
type FromFnType<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>>(table: TABLE_OR_VIEW2) => UpdateFromExpression<TABLE, USING | TABLE_OR_VIEW2> : never;
type OnExpressionFnType<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>>(table: TABLE_OR_VIEW2) => OnExpression<TABLE, USING | TABLE_OR_VIEW2> : never;
type OuterJoinOnExpressionFnType<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>, ALIAS>(source: OuterJoinSource<TABLE_OR_VIEW2, ALIAS>) => OnExpression<TABLE, USING | OuterJoinTableOrView<TABLE_OR_VIEW2, ALIAS>> : never;
export interface UpdateSetJoinExpressionAllowingNoWhere<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> extends UpdateSetExpressionAllowingNoWhere<TABLE, USING> {

@@ -169,5 +169,5 @@ join<TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>>(table: TABLE_OR_VIEW2): OnExpressionAllowingNoWhere<TABLE, USING | TABLE_OR_VIEW2>;

}
declare type FromFnTypeAllowingNoWhere<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>>(table: TABLE_OR_VIEW2) => UpdateFromExpressionAllowingNoWhere<TABLE, USING | TABLE_OR_VIEW2> : never;
declare type OnExpressionFnTypeAllowingNoWhere<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>>(table: TABLE_OR_VIEW2) => OnExpressionAllowingNoWhere<TABLE, USING | TABLE_OR_VIEW2> : never;
declare type OuterJoinOnExpressionFnTypeAllowingNoWhere<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>, ALIAS>(source: OuterJoinSource<TABLE_OR_VIEW2, ALIAS>) => OnExpressionAllowingNoWhere<TABLE, USING | OuterJoinTableOrView<TABLE_OR_VIEW2, ALIAS>> : never;
type FromFnTypeAllowingNoWhere<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Sqlite | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>>(table: TABLE_OR_VIEW2) => UpdateFromExpressionAllowingNoWhere<TABLE, USING | TABLE_OR_VIEW2> : never;
type OnExpressionFnTypeAllowingNoWhere<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>>(table: TABLE_OR_VIEW2) => OnExpressionAllowingNoWhere<TABLE, USING | TABLE_OR_VIEW2> : never;
type OuterJoinOnExpressionFnTypeAllowingNoWhere<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | MariaDB | MySql) ? <TABLE_OR_VIEW2 extends ITableOrViewOf<TABLE[typeof database], any>, ALIAS>(source: OuterJoinSource<TABLE_OR_VIEW2, ALIAS>) => OnExpressionAllowingNoWhere<TABLE, USING | OuterJoinTableOrView<TABLE_OR_VIEW2, ALIAS>> : never;
export interface ReturnableExecutableUpdate<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> extends CustomizableExecutableUpdate<TABLE> {

@@ -365,5 +365,5 @@ returning: ReturningFnType<TABLE, USING>;

}
declare type ReturningFnType<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Oracle) ? <COLUMNS extends UpdateColumns<TABLE, USING>>(columns: COLUMNS) => ComposableCustomizableExecutableUpdate<TABLE, COLUMNS, ResultObjectValues<COLUMNS>> : (TABLE[typeof database] extends Sqlite ? <COLUMNS extends UpdateColumns<TABLE, TABLE>>(columns: COLUMNS) => ComposableCustomizableExecutableUpdate<TABLE, COLUMNS, ResultObjectValues<COLUMNS>> : never);
declare type ReturningOneColumnFnType<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Oracle) ? <COLUMN extends ValueSourceOf<USING[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]> | OLD<TABLE[typeof tableOrViewRef]>>>(column: COLUMN) => ComposableCustomizableExecutableUpdate<TABLE, COLUMN, ValueSourceValueTypeForResult<COLUMN>> : (TABLE[typeof database] extends Sqlite ? <COLUMN extends ValueSourceOf<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]> | OLD<TABLE[typeof tableOrViewRef]>>>(column: COLUMN) => ComposableCustomizableExecutableUpdate<TABLE, COLUMN, ValueSourceValueTypeForResult<COLUMN>> : never);
export declare type UpdateColumns<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = {
type ReturningFnType<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Oracle) ? <COLUMNS extends UpdateColumns<TABLE, USING>>(columns: COLUMNS) => ComposableCustomizableExecutableUpdate<TABLE, COLUMNS, ResultObjectValues<COLUMNS>> : (TABLE[typeof database] extends Sqlite ? <COLUMNS extends UpdateColumns<TABLE, TABLE>>(columns: COLUMNS) => ComposableCustomizableExecutableUpdate<TABLE, COLUMNS, ResultObjectValues<COLUMNS>> : never);
type ReturningOneColumnFnType<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = TABLE[typeof database] extends (NoopDB | PostgreSql | SqlServer | Oracle) ? <COLUMN extends ValueSourceOf<USING[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]> | OLD<TABLE[typeof tableOrViewRef]>>>(column: COLUMN) => ComposableCustomizableExecutableUpdate<TABLE, COLUMN, ValueSourceValueTypeForResult<COLUMN>> : (TABLE[typeof database] extends Sqlite ? <COLUMN extends ValueSourceOf<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]> | OLD<TABLE[typeof tableOrViewRef]>>>(column: COLUMN) => ComposableCustomizableExecutableUpdate<TABLE, COLUMN, ValueSourceValueTypeForResult<COLUMN>> : never);
export type UpdateColumns<TABLE extends ITableOrView<any>, USING extends ITableOrView<any>> = {
[P: string]: ValueSourceOf<USING[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]> | OLD<TABLE[typeof tableOrViewRef]>> | UpdateColumns<TABLE, USING>;

@@ -370,0 +370,0 @@ [P: number | symbol]: never;

@@ -9,23 +9,23 @@ import type { MandatoryInsertSets, MandatoryInsertValues } from "../expressions/insert";

import type { outerJoinAlias, tableOrViewRef } from "../utils/symbols";
export declare type SelectedRow<TABLE> = ResultObjectValues<{
export type SelectedRow<TABLE> = ResultObjectValues<{
[K in ColumnKeys<TABLE> & keyof TABLE]: TABLE[K];
}>;
export declare type SelectedValues<TABLE> = ResultObjectValues<{
export type SelectedValues<TABLE> = ResultObjectValues<{
[K in ColumnKeys<TABLE>]: TABLE[K];
}>;
export declare type InsertableRow<TABLE> = TABLE extends ITable<any> ? MakeTypeVisible<MandatoryInsertSets<TABLE>> : MakeTypeVisible<MandatoryInsertSets<TABLE & ITable<any>>>;
export declare type InsertableValues<TABLE> = TABLE extends ITable<any> ? MakeTypeVisible<MandatoryInsertValues<TABLE>> : MakeTypeVisible<MandatoryInsertValues<TABLE & ITable<any>>>;
export declare type UpdatableRow<TABLE> = TABLE extends ITable<any> ? MakeTypeVisible<UpdateSets<TABLE, TABLE>> : MakeTypeVisible<UpdateSets<TABLE & ITable<any>, TABLE & ITable<any>>>;
export declare type UpdatableValues<TABLE> = TABLE extends ITable<any> ? MakeTypeVisible<UpdateValues<TABLE>> : MakeTypeVisible<UpdateValues<TABLE & ITable<any>>>;
declare type MakeTypeVisible<T> = {
export type InsertableRow<TABLE> = TABLE extends ITable<any> ? MakeTypeVisible<MandatoryInsertSets<TABLE>> : MakeTypeVisible<MandatoryInsertSets<TABLE & ITable<any>>>;
export type InsertableValues<TABLE> = TABLE extends ITable<any> ? MakeTypeVisible<MandatoryInsertValues<TABLE>> : MakeTypeVisible<MandatoryInsertValues<TABLE & ITable<any>>>;
export type UpdatableRow<TABLE> = TABLE extends ITable<any> ? MakeTypeVisible<UpdateSets<TABLE, TABLE>> : MakeTypeVisible<UpdateSets<TABLE & ITable<any>, TABLE & ITable<any>>>;
export type UpdatableValues<TABLE> = TABLE extends ITable<any> ? MakeTypeVisible<UpdateValues<TABLE>> : MakeTypeVisible<UpdateValues<TABLE & ITable<any>>>;
type MakeTypeVisible<T> = {
[P in keyof T]: T[P];
};
export declare type ColumnKeys<O> = {
export type ColumnKeys<O> = {
[K in keyof O]-?: K extends string ? (O[K] extends AnyValueSource ? K : never) : never;
}[keyof O];
export declare type WritableColumnKeys<O> = {
export type WritableColumnKeys<O> = {
[K in keyof O]-?: K extends string ? (O[K] extends Column ? (O[K] extends ComputedColumn ? never : K) : never) : never;
}[keyof O];
export declare type TableOrViewOf<TABLE_OR_VIEW extends ITableOrView<any>, ALIAS extends string = ''> = ALIAS extends false ? ITableOrView<TABLE_OR_VIEW[typeof tableOrViewRef] | TABLE_OR_VIEW_ALIAS<TABLE_OR_VIEW[typeof tableOrViewRef], ALIAS>> : ALIAS extends '' ? ITableOrView<TABLE_OR_VIEW[typeof tableOrViewRef]> : ITableOrView<TABLE_OR_VIEW_ALIAS<TABLE_OR_VIEW[typeof tableOrViewRef], ALIAS>>;
export declare type TableOrViewLeftJoinOf<TABLE_OR_VIEW extends ITableOrView<any>, ALIAS extends string = ''> = OuterJoinSource<TABLE_OR_VIEW, ALIAS>;
export type TableOrViewOf<TABLE_OR_VIEW extends ITableOrView<any>, ALIAS extends string = ''> = ALIAS extends false ? ITableOrView<TABLE_OR_VIEW[typeof tableOrViewRef] | TABLE_OR_VIEW_ALIAS<TABLE_OR_VIEW[typeof tableOrViewRef], ALIAS>> : ALIAS extends '' ? ITableOrView<TABLE_OR_VIEW[typeof tableOrViewRef]> : ITableOrView<TABLE_OR_VIEW_ALIAS<TABLE_OR_VIEW[typeof tableOrViewRef], ALIAS>>;
export type TableOrViewLeftJoinOf<TABLE_OR_VIEW extends ITableOrView<any>, ALIAS extends string = ''> = OuterJoinSource<TABLE_OR_VIEW, ALIAS>;
export declare function fromRef<TABLE_OR_VIEW extends ITableOrView<any>, REF extends TableOrViewOf<TABLE_OR_VIEW[typeof tableOrViewRef], any>>(tableOrView: TABLE_OR_VIEW, ref: REF): TableOrViewWithRef<TABLE_OR_VIEW, REF[typeof tableOrViewRef]>;

@@ -32,0 +32,0 @@ export declare function fromRef<TABLE_OR_VIEW extends ITableOrView<any>, REF extends TableOrViewLeftJoinOf<TABLE_OR_VIEW, any>>(tableOrView: TABLE_OR_VIEW, ref: REF): OuterJoinSourceOf<TABLE_OR_VIEW, REF[typeof outerJoinAlias]>;

@@ -5,3 +5,3 @@ import type { ITableOrView } from "../utils/ITableOrView";

import type { ColumnKeys, WritableColumnKeys } from "./types";
declare type OnlyStringKey<KEY> = KEY extends string ? KEY : never;
type OnlyStringKey<KEY> = KEY extends string ? KEY : never;
export declare function prefixCapitalized<O extends object, PREFIX extends string>(obj: O, prefix: PREFIX): {

@@ -13,3 +13,3 @@ [K in OnlyStringKey<keyof O> as `${PREFIX}${Capitalize<K>}`]: O[K];

};
declare type CapitalizedGuided<PREFIX extends string, KEY extends string, REFERENCE extends object> = KEY extends keyof REFERENCE ? (REFERENCE[KEY] extends IValueSource<any, any, any, infer OPTIONAL_TYPE> ? (OPTIONAL_TYPE extends 'required' ? `${PREFIX}${Capitalize<KEY>}!` : `${PREFIX}${Capitalize<KEY>}`) : `${PREFIX}${Capitalize<KEY>}`) : `${PREFIX}${Capitalize<KEY>}`;
type CapitalizedGuided<PREFIX extends string, KEY extends string, REFERENCE extends object> = KEY extends keyof REFERENCE ? (REFERENCE[KEY] extends IValueSource<any, any, any, infer OPTIONAL_TYPE> ? (OPTIONAL_TYPE extends 'required' ? `${PREFIX}${Capitalize<KEY>}!` : `${PREFIX}${Capitalize<KEY>}`) : `${PREFIX}${Capitalize<KEY>}`) : `${PREFIX}${Capitalize<KEY>}`;
export declare function prefixMapForGuidedSplitCapitalized<O extends object, R extends ITableOrView<any> | {

@@ -20,3 +20,3 @@ [KEY in keyof O]?: AnyValueSource;

};
declare type NameGuided<KEY extends string, REFERENCE extends object> = KEY extends keyof REFERENCE ? (REFERENCE[KEY] extends IValueSource<any, any, any, infer OPTIONAL_TYPE> ? (OPTIONAL_TYPE extends 'required' ? `${KEY}!` : KEY) : KEY) : KEY;
type NameGuided<KEY extends string, REFERENCE extends object> = KEY extends keyof REFERENCE ? (REFERENCE[KEY] extends IValueSource<any, any, any, infer OPTIONAL_TYPE> ? (OPTIONAL_TYPE extends 'required' ? `${KEY}!` : KEY) : KEY) : KEY;
export declare function mapForGuidedSplit<O extends object, R extends ITableOrView<any> | {

@@ -33,3 +33,3 @@ [KEY in keyof O]?: AnyValueSource;

};
declare type DottedGuided<PREFIX extends string, KEY extends string, REFERENCE extends object> = KEY extends keyof REFERENCE ? (REFERENCE[KEY] extends IValueSource<any, any, any, infer OPTIONAL_TYPE> ? (OPTIONAL_TYPE extends 'required' ? `${PREFIX}.${KEY}!` : `${PREFIX}.${KEY}`) : `${PREFIX}.${KEY}`) : `${PREFIX}.${KEY}`;
type DottedGuided<PREFIX extends string, KEY extends string, REFERENCE extends object> = KEY extends keyof REFERENCE ? (REFERENCE[KEY] extends IValueSource<any, any, any, infer OPTIONAL_TYPE> ? (OPTIONAL_TYPE extends 'required' ? `${PREFIX}.${KEY}!` : `${PREFIX}.${KEY}`) : `${PREFIX}.${KEY}`) : `${PREFIX}.${KEY}`;
export declare function prefixMapForGuidedSplitDotted<O extends object, R extends ITableOrView<any> | {

@@ -48,3 +48,3 @@ [KEY in keyof O]?: AnyValueSource;

export declare function extractWritableColumnNamesFrom<O extends object, EXCLUDE extends ColumnKeys<O> = never>(obj: O, exclude?: EXCLUDE[]): Exclude<WritableColumnKeys<O>, EXCLUDE>[];
declare type HasIfValueSource<VALUE> = VALUE extends {
type HasIfValueSource<VALUE> = VALUE extends {
[ifValueSourceType]: 'IfValueSource';

@@ -51,0 +51,0 @@ } ? true : never;

@@ -76,2 +76,4 @@ import { SqlBuilder, SqlOperationStatic0, SqlOperationStatic1, SqlOperation1, SqlOperation2, ToSql, HasOperation, SqlSequenceOperation, SqlFragmentOperation, AggregateFunctions0, AggregateFunctions1, AggregateFunctions1or2, SqlFunction0, SqlComparator0, SelectData } from "../sqlBuilders/SqlBuilder";

asString(): any;
onlyWhenOrNull(when: boolean): any;
ignoreWhenAsNull(when: boolean): any;
equalsInsensitiveIfValue(value: any): any;

@@ -507,2 +509,8 @@ equalsInsensitive(value: any): any;

}
export declare class NullValueSource extends ValueSourceImpl implements HasOperation {
__operation: "_asNullValue";
constructor(valueType: string, optionalType: OptionalType, typeAdapter: TypeAdapter | undefined);
__toSql(sqlBuilder: SqlBuilder, params: any[]): string;
__isAllowed(_sqlBuilder: HasIsValue): boolean;
}
export declare class AggregateFunctions1ValueSource extends ValueSourceImpl implements HasOperation {

@@ -566,4 +574,5 @@ __operation: keyof AggregateFunctions1;

__toSql(sqlBuilder: SqlBuilder, params: any[]): string;
__isAllowed(sqlBuilder: HasIsValue): boolean;
}
export declare type InlineSelectData = SelectData & HasAddWiths;
export type InlineSelectData = SelectData & HasAddWiths;
export declare class InlineSelectValueSource extends ValueSourceImpl implements HasOperation {

@@ -614,2 +623,4 @@ __operation: "_inlineSelectAsValue";

asRequiredInOptionalObject(): any;
onlyWhenOrNull(when: boolean): any;
ignoreWhenAsNull(when: boolean): any;
}

@@ -621,3 +632,46 @@ export declare class AllowWhenAggregateSelectValueSource extends AggregateSelectValueSource {

__toSql(sqlBuilder: SqlBuilder, params: any[]): string;
__isAllowed(sqlBuilder: HasIsValue): boolean;
}
export declare class NullAggregateSelectValueSource implements ValueSource<any, any, any, any>, IAggregatedArrayValueSource<any, any, any>, AggregatedArrayValueSource<any, any, any>, __ValueSourcePrivate, ToSql {
[tableOrView]: any;
[valueType_]: any;
[optionalType_]: any;
[optionalType]: any;
[valueSourceType]: "ValueSource";
[database]: any;
[valueSourceTypeName]: any;
[aggregatedArrayValueSourceType]: 'AggregatedArrayValueSource';
[isValueSourceObject]: true;
__valueType: string;
__optionalType: OptionalType;
__operation: "_inlineSelectAsValue";
__selectData: InlineSelectData;
__aggregatedArrayColumns: __AggregatedArrayColumns | AnyValueSource;
__aggregatedArrayMode: __AggregatedArrayMode;
constructor(selectData: InlineSelectData, aggregatedArrayColumns: __AggregatedArrayColumns | AnyValueSource, aggregatedArrayMode: __AggregatedArrayMode, _optionalType: OptionalType);
isConstValue(): boolean;
getConstValue(): any;
allowWhen(when: boolean, error: string | Error): any;
disallowWhen(when: boolean, error: string | Error): any;
__toSql(sqlBuilder: SqlBuilder, params: any[]): string;
__toSqlForCondition(sqlBuilder: SqlBuilder, params: any[]): string;
__addWiths(_sqlBuilder: HasIsValue, _withs: IWithView<any>[]): void;
__registerTableOrView(_sqlBuilder: HasIsValue, _requiredTablesOrViews: Set<ITableOrView<any>>): void;
__registerRequiredColumn(_sqlBuilder: HasIsValue, _requiredColumns: Set<Column>, _onlyForTablesOrViews: Set<ITableOrView<any>>): void;
__getOldValues(_sqlBuilder: HasIsValue): ITableOrView<any> | undefined;
__getValuesForInsert(_sqlBuilder: HasIsValue): ITableOrView<any> | undefined;
__isAllowed(_sqlBuilder: HasIsValue): boolean;
useEmptyArrayForNoValue(): any;
asOptionalNonEmptyArray(): any;
asRequiredInOptionalObject(): any;
onlyWhenOrNull(when: boolean): any;
ignoreWhenAsNull(when: boolean): any;
}
export declare class NullAllowWhenAggregateSelectValueSource extends NullAggregateSelectValueSource {
__allowed: boolean;
__error: Error;
constructor(selectData: InlineSelectData, allowed: boolean, error: Error, aggregatedArrayColumns: __AggregatedArrayColumns | AnyValueSource, aggregatedArrayMode: __AggregatedArrayMode, _optionalType: OptionalType);
__toSql(sqlBuilder: SqlBuilder, params: any[]): string;
__isAllowed(sqlBuilder: HasIsValue): boolean;
}
export declare class AggregateValueAsArrayValueSource implements ValueSource<any, any, any, any>, IAggregatedArrayValueSource<any, any, any>, AggregatedArrayValueSource<any, any, any>, __ValueSourcePrivate, ToSql {

@@ -660,2 +714,4 @@ [tableOrView]: any;

asRequiredInOptionalObject(): any;
onlyWhenOrNull(when: boolean): any;
ignoreWhenAsNull(when: boolean): any;
}

@@ -667,2 +723,44 @@ export declare class AllowWhenAggregateValueAsArrayValueSource extends AggregateValueAsArrayValueSource {

__toSql(sqlBuilder: SqlBuilder, params: any[]): string;
__isAllowed(sqlBuilder: HasIsValue): boolean;
}
export declare class NullAggregateValueAsArrayValueSource implements ValueSource<any, any, any, any>, IAggregatedArrayValueSource<any, any, any>, AggregatedArrayValueSource<any, any, any>, __ValueSourcePrivate, ToSql {
[tableOrView]: any;
[valueType_]: any;
[optionalType_]: any;
[optionalType]: any;
[valueSourceType]: "ValueSource";
[database]: any;
[valueSourceTypeName]: any;
[aggregatedArrayValueSourceType]: 'AggregatedArrayValueSource';
[isValueSourceObject]: true;
__valueType: string;
__optionalType: OptionalType;
__operation: '_aggregateValueAsArray';
__aggregatedArrayColumns: __AggregatedArrayColumns | AnyValueSource;
__aggregatedArrayMode: __AggregatedArrayMode;
constructor(aggregatedArrayColumns: __AggregatedArrayColumns | AnyValueSource, aggregatedArrayMode: __AggregatedArrayMode, _optionalType: OptionalType);
isConstValue(): boolean;
getConstValue(): any;
allowWhen(when: boolean, error: string | Error): any;
disallowWhen(when: boolean, error: string | Error): any;
__addWiths(_sqlBuilder: HasIsValue, _withs: IWithView<any>[]): void;
__registerTableOrView(_sqlBuilder: HasIsValue, _requiredTablesOrViews: Set<ITableOrView<any>>): void;
__registerRequiredColumn(_sqlBuilder: HasIsValue, _requiredColumns: Set<Column>, _onlyForTablesOrViews: Set<ITableOrView<any>>): void;
__getOldValues(_sqlBuilder: HasIsValue): ITableOrView<any> | undefined;
__getValuesForInsert(_sqlBuilder: HasIsValue): ITableOrView<any> | undefined;
__isAllowed(_sqlBuilder: HasIsValue): boolean;
__toSql(sqlBuilder: SqlBuilder, params: any[]): string;
__toSqlForCondition(sqlBuilder: SqlBuilder, params: any[]): string;
useEmptyArrayForNoValue(): any;
asOptionalNonEmptyArray(): any;
asRequiredInOptionalObject(): any;
onlyWhenOrNull(when: boolean): any;
ignoreWhenAsNull(when: boolean): any;
}
export declare class NullAllowWhenAggregateValueAsArrayValueSource extends NullAggregateValueAsArrayValueSource {
__allowed: boolean;
__error: Error;
constructor(allowed: boolean, error: Error, aggregatedArrayColumns: __AggregatedArrayColumns | AnyValueSource, aggregatedArrayMode: __AggregatedArrayMode, _optionalType: OptionalType);
__toSql(sqlBuilder: SqlBuilder, params: any[]): string;
__isAllowed(sqlBuilder: HasIsValue): boolean;
}
{
"name": "ts-sql-query",
"version": "1.45.0",
"version": "1.46.0",
"description": "Type-safe SQL query builder like QueryDSL or JOOQ in Java or Linq in .Net for TypeScript with MariaDB, MySql, Oracle, PostgreSql, Sqlite and SqlServer support.",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -33,3 +33,3 @@ import { AnyValueSource } from "../expressions/values";

}
declare type SplitCompose = Compose | Split | GuidedSplit;
type SplitCompose = Compose | Split | GuidedSplit;
export declare class ComposeSplitQueryBuilder {

@@ -59,3 +59,3 @@ __sqlBuilder: SqlBuilder;

__processCompositionResult(internalList: any[], dataList: any[], dataMap: any, composition: Compose): void;
__transformValueFromDB(valueSource: AnyValueSource, value: any, column?: string, index?: number, count?: boolean): unknown;
__transformValueFromDB(valueSource: AnyValueSource, value: any, column?: string, index?: number, count?: boolean): {} | null | undefined;
__transformRow(row: any, index?: number): any;

@@ -62,0 +62,0 @@ __transformRootObject(errorPrefix: string, columns: QueryColumns, row: any, index?: number): any;

@@ -5,8 +5,8 @@ "use strict";

class ChainedQueryRunner {
get database() {
return this.queryRunner.database;
}
constructor(queryRunner) {
this.queryRunner = queryRunner;
}
get database() {
return this.queryRunner.database;
}
useDatabase(database) {

@@ -13,0 +13,0 @@ return this.queryRunner.useDatabase(database);

import type { QueryRunner } from "./QueryRunner";
import { LoggingQueryRunner } from "./LoggingQueryRunner";
export declare type TimeGranularity = 'ms' | 'us' | 'ns';
export type TimeGranularity = 'ms' | 'us' | 'ns';
export interface ConsoleLogQueryRunnerOpts {

@@ -5,0 +5,0 @@ timeGranularity?: TimeGranularity;

import type { QueryRunner } from "./QueryRunner";
import { ChainedQueryRunner } from "./ChainedQueryRunner";
import type { UnwrapPromiseTuple } from "../utils/PromiseProvider";
export declare type QueryType = 'selectOneRow' | 'selectManyRows' | 'selectOneColumnOneRow' | 'selectOneColumnManyRows' | 'insert' | 'insertReturningLastInsertedId' | 'insertReturningMultipleLastInsertedId' | 'insertReturningOneRow' | 'insertReturningManyRows' | 'insertReturningOneColumnOneRow' | 'insertReturningOneColumnManyRows' | 'update' | 'updateReturningOneRow' | 'updateReturningManyRows' | 'updateReturningOneColumnOneRow' | 'updateReturningOneColumnManyRows' | 'delete' | 'deleteReturningOneRow' | 'deleteReturningManyRows' | 'deleteReturningOneColumnOneRow' | 'deleteReturningOneColumnManyRows' | 'executeProcedure' | 'executeFunction' | 'beginTransaction' | 'commit' | 'rollback' | 'executeDatabaseSchemaModification';
export type QueryType = 'selectOneRow' | 'selectManyRows' | 'selectOneColumnOneRow' | 'selectOneColumnManyRows' | 'insert' | 'insertReturningLastInsertedId' | 'insertReturningMultipleLastInsertedId' | 'insertReturningOneRow' | 'insertReturningManyRows' | 'insertReturningOneColumnOneRow' | 'insertReturningOneColumnManyRows' | 'update' | 'updateReturningOneRow' | 'updateReturningManyRows' | 'updateReturningOneColumnOneRow' | 'updateReturningOneColumnManyRows' | 'delete' | 'deleteReturningOneRow' | 'deleteReturningManyRows' | 'deleteReturningOneColumnOneRow' | 'deleteReturningOneColumnManyRows' | 'executeProcedure' | 'executeFunction' | 'beginTransaction' | 'commit' | 'rollback' | 'executeDatabaseSchemaModification';
export declare abstract class InterceptorQueryRunner<PLAYLOAD_TYPE, T extends QueryRunner = QueryRunner> extends ChainedQueryRunner<T> {

@@ -6,0 +6,0 @@ constructor(queryRunner: T);

import type { QueryRunner } from "./QueryRunner";
import { ChainedQueryRunner } from "./ChainedQueryRunner";
import type { UnwrapPromiseTuple } from "../utils/PromiseProvider";
export declare type QueryType = 'selectOneRow' | 'selectManyRows' | 'selectOneColumnOneRow' | 'selectOneColumnManyRows' | 'insert' | 'insertReturningLastInsertedId' | 'insertReturningMultipleLastInsertedId' | 'insertReturningOneRow' | 'insertReturningManyRows' | 'insertReturningOneColumnOneRow' | 'insertReturningOneColumnManyRows' | 'update' | 'updateReturningOneRow' | 'updateReturningManyRows' | 'updateReturningOneColumnOneRow' | 'updateReturningOneColumnManyRows' | 'delete' | 'deleteReturningOneRow' | 'deleteReturningManyRows' | 'deleteReturningOneColumnOneRow' | 'deleteReturningOneColumnManyRows' | 'executeProcedure' | 'executeFunction' | 'beginTransaction' | 'commit' | 'rollback' | 'executeDatabaseSchemaModification';
export type QueryType = 'selectOneRow' | 'selectManyRows' | 'selectOneColumnOneRow' | 'selectOneColumnManyRows' | 'insert' | 'insertReturningLastInsertedId' | 'insertReturningMultipleLastInsertedId' | 'insertReturningOneRow' | 'insertReturningManyRows' | 'insertReturningOneColumnOneRow' | 'insertReturningOneColumnManyRows' | 'update' | 'updateReturningOneRow' | 'updateReturningManyRows' | 'updateReturningOneColumnOneRow' | 'updateReturningOneColumnManyRows' | 'delete' | 'deleteReturningOneRow' | 'deleteReturningManyRows' | 'deleteReturningOneColumnOneRow' | 'deleteReturningOneColumnManyRows' | 'executeProcedure' | 'executeFunction' | 'beginTransaction' | 'commit' | 'rollback' | 'executeDatabaseSchemaModification';
export interface QueryLogger {

@@ -6,0 +6,0 @@ onQuery?: (queryType: QueryType, query: string, params: any[], timestamps: {

import type { PromiseProvider, UnwrapPromiseTuple } from "../utils/PromiseProvider";
import type { DatabaseType, QueryRunner } from "./QueryRunner";
export declare type QueryType = 'selectOneRow' | 'selectManyRows' | 'selectOneColumnOneRow' | 'selectOneColumnManyRows' | 'insert' | 'insertReturningLastInsertedId' | 'insertReturningMultipleLastInsertedId' | 'insertReturningOneRow' | 'insertReturningManyRows' | 'insertReturningOneColumnOneRow' | 'insertReturningOneColumnManyRows' | 'update' | 'updateReturningOneRow' | 'updateReturningManyRows' | 'updateReturningOneColumnOneRow' | 'updateReturningOneColumnManyRows' | 'delete' | 'deleteReturningOneRow' | 'deleteReturningManyRows' | 'deleteReturningOneColumnOneRow' | 'deleteReturningOneColumnManyRows' | 'executeProcedure' | 'executeFunction' | 'beginTransaction' | 'commit' | 'rollback' | 'executeDatabaseSchemaModification' | 'isTransactionActive';
export declare type QueryExecutor = (type: QueryType, query: string, params: any[], index: number) => any;
export type QueryType = 'selectOneRow' | 'selectManyRows' | 'selectOneColumnOneRow' | 'selectOneColumnManyRows' | 'insert' | 'insertReturningLastInsertedId' | 'insertReturningMultipleLastInsertedId' | 'insertReturningOneRow' | 'insertReturningManyRows' | 'insertReturningOneColumnOneRow' | 'insertReturningOneColumnManyRows' | 'update' | 'updateReturningOneRow' | 'updateReturningManyRows' | 'updateReturningOneColumnOneRow' | 'updateReturningOneColumnManyRows' | 'delete' | 'deleteReturningOneRow' | 'deleteReturningManyRows' | 'deleteReturningOneColumnOneRow' | 'deleteReturningOneColumnManyRows' | 'executeProcedure' | 'executeFunction' | 'beginTransaction' | 'commit' | 'rollback' | 'executeDatabaseSchemaModification' | 'isTransactionActive';
export type QueryExecutor = (type: QueryType, query: string, params: any[], index: number) => any;
export interface MockQueryRunnerConfig {

@@ -6,0 +6,0 @@ database?: DatabaseType;

@@ -14,3 +14,3 @@ import { UnwrapPromiseTuple } from "../utils/PromiseProvider";

}
declare type RawPrismaClient = RawPrismaClient2 | RawPrismaClient3;
type RawPrismaClient = RawPrismaClient2 | RawPrismaClient3;
export interface PrismaConfig {

@@ -17,0 +17,0 @@ interactiveTransactions: boolean;

@@ -46,2 +46,2 @@ import { UnwrapPromiseTuple } from "../utils/PromiseProvider";

}
export declare type DatabaseType = 'mariaDB' | 'mySql' | 'noopDB' | 'oracle' | 'postgreSql' | 'sqlite' | 'sqlServer';
export type DatabaseType = 'mariaDB' | 'mySql' | 'noopDB' | 'oracle' | 'postgreSql' | 'sqlite' | 'sqlServer';

@@ -135,3 +135,4 @@ # ts-sql-query <!-- omit in toc -->

- create a boolean expression that only applies if a certain condition is met, calling the `onlyWhen` method in the boolean expression. The `ignoreWhen` method do the opposite.
- create a boolean expression that only applies if a certain condition is met, calling the `onlyWhen` method in the boolean expression. The `ignoreWhen` method does the opposite.
- create an expression that only applies if a certain condition is met; otherwise, the value will be null, calling the `onlyWhenOrNull` method in the expression. The `ignoreWhenAsNull` method does the opposite.
- create a dynamic boolean expression that you can use in a where (by example), calling the `dynamicBooleanExpresionUsing` method in the connection object.

@@ -138,0 +139,0 @@ - create a custom boolean condition from criteria object that you can use in a where (by example), calling the `dynamicConditionFor` method in the connection object. This functionality is useful when creating a complex search & filtering functionality in the user interface, where the user can apply a different combination of constraints.

@@ -219,2 +219,3 @@ import { ToSql, SqlBuilder, DeleteData, InsertData, UpdateData, SelectData, SqlOperation, WithQueryData, CompoundOperator, JoinData, QueryColumns, WithSelectData, WithValuesData } from "./SqlBuilder";

_asString(params: any[], valueSource: ToSql): string;
_asNullValue(_params: any[], columnType: string, typeAdapter: TypeAdapter | undefined): string;
_valueWhenNull(params: any[], valueSource: ToSql, value: any, columnType: string, typeAdapter: TypeAdapter | undefined): string;

@@ -221,0 +222,0 @@ _nullIfValue(params: any[], valueSource: ToSql, value: any, columnType: string, typeAdapter: TypeAdapter | undefined): string;

@@ -13,2 +13,3 @@ import type { ToSql, SelectData, WithValuesData } from "./SqlBuilder";

_asString(params: any[], valueSource: ToSql): string;
_asNullValue(_params: any[], columnType: string, typeAdapter: TypeAdapter | undefined): string;
_divide(params: any[], valueSource: ToSql, value: any, columnType: string, typeAdapter: TypeAdapter | undefined): string;

@@ -15,0 +16,0 @@ _equalsInsensitive(params: any[], valueSource: ToSql, value: any, columnType: string, typeAdapter: TypeAdapter | undefined): string;

@@ -90,2 +90,10 @@ "use strict";

}
_asNullValue(_params, columnType, typeAdapter) {
if (typeAdapter && typeAdapter.transformPlaceholder) {
return typeAdapter.transformPlaceholder('null', columnType, true, null, this._defaultTypeAdapter);
}
else {
return this._defaultTypeAdapter.transformPlaceholder('null', columnType, true, null);
}
}
_divide(params, valueSource, value, columnType, typeAdapter) {

@@ -92,0 +100,0 @@ return this._appendSqlParenthesis(valueSource, params) + '::float / ' + this._appendValueParenthesis(value, params, this._getMathArgumentType(columnType, value), typeAdapter) + '::float';

@@ -14,6 +14,6 @@ import type { ITableOrView, ITable, IWithView, HasIsValue } from "../utils/ITableOrView";

import { RawFragment } from "../utils/RawFragment";
export declare type QueryColumns = {
export type QueryColumns = {
[property: string]: AnyValueSource | QueryColumns;
};
export declare type FlatQueryColumns = {
export type FlatQueryColumns = {
[property: string]: AnyValueSource;

@@ -38,3 +38,3 @@ };

}
export declare type WithData = WithSelectData | WithValuesData;
export type WithData = WithSelectData | WithValuesData;
export declare function hasWithData(value: any): value is WithData;

@@ -53,3 +53,3 @@ export declare function getWithData(withView: IWithView<any>): WithData;

}
export declare type SelectData = PlainSelectData | CompoundSelectData;
export type SelectData = PlainSelectData | CompoundSelectData;
export interface PlainSelectData extends WithQueryData {

@@ -74,3 +74,3 @@ [isSelectQueryObject]: true;

}
export declare type CompoundOperator = 'union' | 'unionAll' | 'intersect' | 'intersectAll' | 'except' | 'exceptAll' | 'minus' | 'minusAll';
export type CompoundOperator = 'union' | 'unionAll' | 'intersect' | 'intersectAll' | 'except' | 'exceptAll' | 'minus' | 'minusAll';
export interface CompoundSelectData extends WithQueryData {

@@ -328,2 +328,3 @@ [isSelectQueryObject]: true;

_inlineSelectAsValue(query: SelectData, params: any[]): string;
_asNullValue(params: any[], columnType: string, typeAdapter: TypeAdapter | undefined): string;
}

@@ -1,2 +0,2 @@

export declare type PromiseProvider = PromiseConstructorLike & {
export type PromiseProvider = PromiseConstructorLike & {
resolve: typeof Promise.resolve;

@@ -6,4 +6,4 @@ reject: typeof Promise.reject;

};
export declare type UnwrapPromise<P extends any> = P extends Promise<infer R> ? R : P;
export declare type UnwrapPromiseTuple<Tuple extends any[]> = {
export type UnwrapPromise<P extends any> = P extends Promise<infer R> ? R : P;
export type UnwrapPromiseTuple<Tuple extends any[]> = {
[K in keyof Tuple]: UnwrapPromise<Tuple[K]>;

@@ -10,0 +10,0 @@ };

@@ -5,14 +5,14 @@ import { AnyDB } from "../databases";

import { database } from "./symbols";
export declare type ResultObjectValues<COLUMNS> = FixOptionalProperties<{
export type ResultObjectValues<COLUMNS> = FixOptionalProperties<{
[P in keyof COLUMNS]: COLUMNS[P] extends AnyValueSource | undefined ? ValueSourceValueTypeForObjectResult<NonNullable<COLUMNS[P]>> : InnerResultObjectValues<NonNullable<COLUMNS[P]>>;
}>;
export declare type RequiredColumnNames<T> = T extends AnyValueSource ? 'result' : 'any' extends T ? never : RequiredInnerColumnNames<T, ''>;
declare type RequiredInnerColumnNames<T, PREFIX extends string> = {
export type RequiredColumnNames<T> = T extends AnyValueSource ? 'result' : 'any' extends T ? never : RequiredInnerColumnNames<T, ''>;
type RequiredInnerColumnNames<T, PREFIX extends string> = {
[K in keyof T]-?: K extends string ? T[K] extends AnyValueSource | undefined ? ({} extends Pick<T, K> ? never : `${PREFIX}${K}`) : RequiredInnerColumnNames<T[K], `${PREFIX}${K}.`> : never;
}[keyof T];
export declare type RequiredKeysOfPickingColumns<T> = T extends AnyValueSource ? never : {
export type RequiredKeysOfPickingColumns<T> = T extends AnyValueSource ? never : {
[K in keyof T]-?: {} extends Pick<T, K> ? never : K;
}[keyof T];
export declare type ColumnGuard<T> = T extends null | undefined ? never : T extends never ? never : T extends AnyValueSource ? never : unknown;
export declare type GuidedObj<T> = T & {
export type ColumnGuard<T> = T extends null | undefined ? never : T extends never ? never : T extends AnyValueSource ? never : unknown;
export type GuidedObj<T> = T & {
[K in keyof T as K extends string | number ? `${K}!` : never]-?: NonNullable<T[K]>;

@@ -22,8 +22,8 @@ } & {

};
export declare type GuidedPropName<T> = T extends `${infer Q}!` ? Q : T extends `${infer Q}?` ? Q : T;
export declare type ValueOf<T> = T[keyof T];
export declare type FixOptionalProperties<RESULT> = undefined extends string ? RESULT : {
[P in keyof RESULT]: true extends OptionalMap<RESULT> ? RESULT[P] : NonNullable<RESULT[P]>;
export type GuidedPropName<T> = T extends `${infer Q}!` ? Q : T extends `${infer Q}?` ? Q : T;
export type ValueOf<T> = T[keyof T];
export type FixOptionalProperties<RESULT> = undefined extends string ? RESULT : {
[P in keyof OptionalMap<RESULT>]: true extends OptionalMap<RESULT> ? RESULT[P] : NonNullable<RESULT[P]>;
};
declare type OptionalMap<TYPE> = {
type OptionalMap<TYPE> = {
[P in MandatoryPropertiesOf<TYPE>]-?: true;

@@ -33,14 +33,14 @@ } & {

};
export declare type MandatoryPropertiesOf<TYPE> = ({
export type MandatoryPropertiesOf<TYPE> = ({
[K in keyof TYPE]-?: null | undefined extends TYPE[K] ? never : (null extends TYPE[K] ? never : (undefined extends TYPE[K] ? never : K));
})[keyof TYPE];
export declare type OptionalPropertiesOf<TYPE> = ({
export type OptionalPropertiesOf<TYPE> = ({
[K in keyof TYPE]-?: null | undefined extends TYPE[K] ? K : (null extends TYPE[K] ? K : (undefined extends TYPE[K] ? K : never));
})[keyof TYPE];
export declare type ColumnsForCompound<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, COLUMNS> = COLUMNS extends AnyValueSource ? RemapIValueSourceTypeWithOptionalType<TABLE_OR_VIEW, COLUMNS, CompoundColumnOptionalType<COLUMNS>> : InnerColumnsForCompound<TABLE_OR_VIEW, COLUMNS>;
declare type InnerColumnsForCompound<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, COLUMNS> = {
export type ColumnsForCompound<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, COLUMNS> = COLUMNS extends AnyValueSource ? RemapIValueSourceTypeWithOptionalType<TABLE_OR_VIEW, COLUMNS, CompoundColumnOptionalType<COLUMNS>> : InnerColumnsForCompound<TABLE_OR_VIEW, COLUMNS>;
type InnerColumnsForCompound<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, COLUMNS> = {
[K in keyof COLUMNS]: COLUMNS[K] extends AnyValueSource | undefined ? RemapIValueSourceTypeWithOptionalType<TABLE_OR_VIEW, COLUMNS[K], CompoundColumnOptionalType<COLUMNS[K]>> : InnerColumnsForCompound<TABLE_OR_VIEW, COLUMNS>;
};
declare type CompoundColumnOptionalType<COLUMN> = COLUMN extends IValueSource<any, any, any, infer OPTIONAL_TYPE> ? OptionalTypeRequiredOrAny<OPTIONAL_TYPE> : never;
declare type InnerResultObjectValues<COLUMNS> = ContainsRequiredInOptionalObject<COLUMNS> extends true ? FixOptionalProperties<{
type CompoundColumnOptionalType<COLUMN> = COLUMN extends IValueSource<any, any, any, infer OPTIONAL_TYPE> ? OptionalTypeRequiredOrAny<OPTIONAL_TYPE> : never;
type InnerResultObjectValues<COLUMNS> = ContainsRequiredInOptionalObject<COLUMNS> extends true ? FixOptionalProperties<{
[P in keyof COLUMNS]: COLUMNS[P] extends AnyValueSource | undefined ? ValueSourceValueTypeForRequiredInOptionalObject<NonNullable<COLUMNS[P]>> : InnerResultObjectValues<NonNullable<COLUMNS[P]>>;

@@ -54,20 +54,20 @@ }> | undefined : AllFromSameLeftJoinWithOriginallyRequired<COLUMNS> extends true ? FixOptionalProperties<{

}> | undefined;
export declare type InnerResultObjectValuesForAggregatedArray<COLUMNS> = NonNullable<InnerResultObjectValues<COLUMNS>>;
declare type ContainsRequiredInOptionalObject<TYPE> = FalseWhenNever<({
export type InnerResultObjectValuesForAggregatedArray<COLUMNS> = NonNullable<InnerResultObjectValues<COLUMNS>>;
type ContainsRequiredInOptionalObject<TYPE> = FalseWhenNever<({
[K in keyof TYPE]-?: TYPE[K] extends IValueSource<any, any, any, infer OPTIONAL_TYPE> | undefined ? IsRequiredInOptionalObject<OPTIONAL_TYPE> : never;
})[keyof TYPE]>;
declare type ContainsRequired<TYPE> = FalseWhenNever<({
type ContainsRequired<TYPE> = FalseWhenNever<({
[K in keyof TYPE]-?: TYPE[K] extends IValueSource<any, any, any, infer OPTIONAL_TYPE> | undefined ? IsRequired<OPTIONAL_TYPE> : InnerObjectIsRequired<TYPE[K]> extends true ? true : never;
})[keyof TYPE]>;
declare type InnerObjectIsRequired<TYPE> = ContainsRequiredInOptionalObject<TYPE> extends true ? false : AllFromSameLeftJoinWithOriginallyRequired<TYPE> extends true ? false : ContainsRequired<TYPE>;
declare type AllFromSameLeftJoinWithOriginallyRequired<TYPE> = FalseWhenNever<({
type InnerObjectIsRequired<TYPE> = ContainsRequiredInOptionalObject<TYPE> extends true ? false : AllFromSameLeftJoinWithOriginallyRequired<TYPE> extends true ? false : ContainsRequired<TYPE>;
type AllFromSameLeftJoinWithOriginallyRequired<TYPE> = FalseWhenNever<({
[K in keyof TYPE]-?: TYPE[K] extends ValueSource<infer T, any, any, infer OPTIONAL_TYPE> | undefined ? OUTER_JOIN_SOURCE<any, any> extends T ? (InnerTables<TYPE> | NoTableOrViewRequired<T[typeof database]> extends T | NoTableOrViewRequired<T[typeof database]> ? IsOriginallyRequired<OPTIONAL_TYPE> : false) : T extends NoTableOrViewRequired<T[typeof database]> ? never : false : never;
})[keyof TYPE]>;
declare type InnerTables<TYPE> = ({
type InnerTables<TYPE> = ({
[K in keyof TYPE]-?: TYPE[K] extends ValueSourceOf<infer T> | undefined ? T : never;
})[keyof TYPE];
declare type IsRequiredInOptionalObject<OPTIONAL_TYPE extends OptionalType> = 'any' extends OPTIONAL_TYPE ? never : 'requiredInOptionalObject' extends OPTIONAL_TYPE ? true : never;
declare type IsOriginallyRequired<OPTIONAL_TYPE extends OptionalType> = 'any' extends OPTIONAL_TYPE ? never : 'originallyRequired' extends OPTIONAL_TYPE ? true : never;
declare type IsRequired<OPTIONAL_TYPE extends OptionalType> = 'any' extends OPTIONAL_TYPE ? never : 'required' extends OPTIONAL_TYPE ? true : never;
declare type FalseWhenNever<T> = [T] extends [never] ? false : T;
type IsRequiredInOptionalObject<OPTIONAL_TYPE extends OptionalType> = 'any' extends OPTIONAL_TYPE ? never : 'requiredInOptionalObject' extends OPTIONAL_TYPE ? true : never;
type IsOriginallyRequired<OPTIONAL_TYPE extends OptionalType> = 'any' extends OPTIONAL_TYPE ? never : 'originallyRequired' extends OPTIONAL_TYPE ? true : never;
type IsRequired<OPTIONAL_TYPE extends OptionalType> = 'any' extends OPTIONAL_TYPE ? never : 'required' extends OPTIONAL_TYPE ? true : never;
type FalseWhenNever<T> = [T] extends [never] ? false : T;
export {};

@@ -74,0 +74,0 @@ /**

@@ -6,31 +6,31 @@ import type { CUSTOMIZED_TABLE_OR_VIEW, ITable, ITableOrView, IView, IWithView, OuterJoinSource, TableOrViewAlias, TABLE_OR_VIEW_ALIAS, ITableOrViewRef, OLD, OldTableOrView, OUTER_JOIN_SOURCE, ITableOrViewOuterJoin, VALUES_FOR_INSERT, ValuesForInsertTableOrView, IValues } from "./ITableOrView";

import type { Column, ColumnWithDefaultValue, ComputedColumn, OptionalColumn, PrimaryKeyAutogeneratedColumn } from "./Column";
export declare type ColumnsOf<TABLE_OR_VIEW extends ITableOrView<any>> = ({
export type ColumnsOf<TABLE_OR_VIEW extends ITableOrView<any>> = ({
[K in keyof TABLE_OR_VIEW]-?: TABLE_OR_VIEW[K] extends ValueSourceOf<TABLE_OR_VIEW[typeof tableOrViewRef]> & Column ? K : never;
})[keyof TABLE_OR_VIEW];
declare type ValueSourcesOf<TABLE_OR_VIEW> = ({
type ValueSourcesOf<TABLE_OR_VIEW> = ({
[K in keyof TABLE_OR_VIEW]-?: TABLE_OR_VIEW[K] extends AnyValueSource ? K : never;
})[keyof TABLE_OR_VIEW];
export declare type OldValues<TABLE_OR_VIEW extends ITableOrView<any>> = {
export type OldValues<TABLE_OR_VIEW extends ITableOrView<any>> = {
[K in ValueSourcesOf<TABLE_OR_VIEW>]: RemapValueSourceType<OLD<TABLE_OR_VIEW[typeof tableOrViewRef]>, TABLE_OR_VIEW[K]>;
} & OldTableOrView<TABLE_OR_VIEW>;
export declare type ValuesForInsert<TABLE_OR_VIEW extends ITableOrView<any>> = {
export type ValuesForInsert<TABLE_OR_VIEW extends ITableOrView<any>> = {
[K in ValueSourcesOf<TABLE_OR_VIEW>]: RemapValueSourceType<VALUES_FOR_INSERT<TABLE_OR_VIEW[typeof tableOrViewRef]>, TABLE_OR_VIEW[K]>;
} & ValuesForInsertTableOrView<TABLE_OR_VIEW>;
export declare type AliasedTableOrView<TABLE_OR_VIEW extends ITableOrView<any>, ALIAS> = {
export type AliasedTableOrView<TABLE_OR_VIEW extends ITableOrView<any>, ALIAS> = {
[K in ValueSourcesOf<TABLE_OR_VIEW>]: RemapValueSourceType<TABLE_OR_VIEW_ALIAS<TABLE_OR_VIEW[typeof tableOrViewRef], ALIAS>, TABLE_OR_VIEW[K]>;
} & TableOrViewAlias<TABLE_OR_VIEW, ALIAS>;
export declare type TableOrViewWithRef<TABLE_OR_VIEW extends ITableOrView<any>, REF extends ITableOrViewRef<AnyDB>> = {
export type TableOrViewWithRef<TABLE_OR_VIEW extends ITableOrView<any>, REF extends ITableOrViewRef<AnyDB>> = {
[K in ValueSourcesOf<TABLE_OR_VIEW>]: RemapValueSourceType<REF, TABLE_OR_VIEW[K]>;
} & ITableOrView<REF>;
declare type WithViewColumns<TABLE_OR_VIEW extends ITableOrView<any>, COLUMNS> = {
type WithViewColumns<TABLE_OR_VIEW extends ITableOrView<any>, COLUMNS> = {
[K in ValueSourcesOf<COLUMNS>]: RemapValueSourceTypeWithOptionalType<TABLE_OR_VIEW[typeof tableOrViewRef], COLUMNS[K], WithOptionalTypeOf<COLUMNS[K]>>;
} & TABLE_OR_VIEW;
declare type WithOptionalTypeOf<TYPE> = TYPE extends IValueSource<any, any, any, infer OPTIONAL_TYPE> ? ('required' extends OPTIONAL_TYPE ? 'required' : 'optional') : never;
export declare type OuterJoinSourceOf<TABLE_OR_VIEW extends ITableOrView<any>, ALIAS> = {
type WithOptionalTypeOf<TYPE> = TYPE extends IValueSource<any, any, any, infer OPTIONAL_TYPE> ? ('required' extends OPTIONAL_TYPE ? 'required' : 'optional') : never;
export type OuterJoinSourceOf<TABLE_OR_VIEW extends ITableOrView<any>, ALIAS> = {
[K in ValueSourcesOf<TABLE_OR_VIEW>]: RemapValueSourceTypeWithOptionalType<OUTER_JOIN_SOURCE<TABLE_OR_VIEW[typeof tableOrViewRef], ALIAS>, TABLE_OR_VIEW[K], OuterOptionalTypeOf<TABLE_OR_VIEW[K]>>;
} & OuterJoinSource<TABLE_OR_VIEW, ALIAS>;
export declare type OuterJoinTableOrView<TABLE_OR_VIEW extends ITableOrView<any>, ALIAS> = {
export type OuterJoinTableOrView<TABLE_OR_VIEW extends ITableOrView<any>, ALIAS> = {
[K in ValueSourcesOf<TABLE_OR_VIEW>]: RemapValueSourceTypeWithOptionalType<OUTER_JOIN_SOURCE<TABLE_OR_VIEW[typeof tableOrViewRef], ALIAS>, TABLE_OR_VIEW[K], OuterOptionalTypeOf<TABLE_OR_VIEW[K]>>;
} & ITableOrViewOuterJoin<TABLE_OR_VIEW, ALIAS>;
declare type OuterOptionalTypeOf<TYPE> = TYPE extends IValueSource<any, any, any, infer OPTIONAL_TYPE> ? ('required' extends OPTIONAL_TYPE ? 'originallyRequired' : OPTIONAL_TYPE) : never;
type OuterOptionalTypeOf<TYPE> = TYPE extends IValueSource<any, any, any, infer OPTIONAL_TYPE> ? ('required' extends OPTIONAL_TYPE ? 'originallyRequired' : OPTIONAL_TYPE) : never;
export interface WITH_VIEW<DB extends AnyDB, NAME extends string> extends ITableOrViewRef<DB> {

@@ -40,3 +40,3 @@ [viewName]: NAME;

}
declare type AddAliasMethods<T extends ITableOrView<any>> = T & {
type AddAliasMethods<T extends ITableOrView<any>> = T & {
as<ALIAS extends string>(as: ALIAS): AliasedTableOrView<T, ALIAS>;

@@ -46,24 +46,24 @@ forUseInLeftJoin(): OuterJoinSourceOf<T, ''>;

};
export declare type WithView<REF extends WITH_VIEW<AnyDB, any>, COLUMNS> = AddAliasMethods<WithViewColumns<IWithView<REF>, COLUMNS>>;
declare type CustomizedTableOrViewType<TABLE_OR_VIEW extends ITableOrView<any>, REF extends ITableOrViewRef<AnyDB>> = TABLE_OR_VIEW extends TableOrViewAlias<infer T, infer ALIAS> ? (T extends ITable<any> ? TableOrViewAlias<ITable<REF>, ALIAS> : T extends IView<any> ? TableOrViewAlias<IView<REF>, ALIAS> : T extends IWithView<any> ? TableOrViewAlias<IWithView<REF>, ALIAS> : T extends IValues<any> ? TableOrViewAlias<IValues<REF>, ALIAS> : never) : TABLE_OR_VIEW extends ITable<any> ? ITable<REF> : TABLE_OR_VIEW extends IView<any> ? IView<REF> : TABLE_OR_VIEW extends IWithView<any> ? IWithView<REF> : TABLE_OR_VIEW extends IValues<any> ? IValues<REF> : never;
declare type CustomizedTableOrViewRefFor<TABLE_OR_VIEW extends ITableOrView<any>, NAME> = TABLE_OR_VIEW[typeof tableOrViewRef] extends TABLE_OR_VIEW_ALIAS<infer R, infer ALIAS> ? TABLE_OR_VIEW_ALIAS<CUSTOMIZED_TABLE_OR_VIEW<R, NAME>, ALIAS> : CUSTOMIZED_TABLE_OR_VIEW<TABLE_OR_VIEW[typeof tableOrViewRef], NAME>;
declare type CustomizedTableOrViewRefForWitNoAlias<TABLE_OR_VIEW extends ITableOrView<any>, NAME> = TABLE_OR_VIEW[typeof tableOrViewRef] extends TABLE_OR_VIEW_ALIAS<infer R, any> ? CUSTOMIZED_TABLE_OR_VIEW<R, NAME> : CUSTOMIZED_TABLE_OR_VIEW<TABLE_OR_VIEW[typeof tableOrViewRef], NAME>;
declare type CustomizedTableOrViewNoAliasable<TABLE_OR_VIEW extends ITableOrView<any>, NAME> = {
export type WithView<REF extends WITH_VIEW<AnyDB, any>, COLUMNS> = AddAliasMethods<WithViewColumns<IWithView<REF>, COLUMNS>>;
type CustomizedTableOrViewType<TABLE_OR_VIEW extends ITableOrView<any>, REF extends ITableOrViewRef<AnyDB>> = TABLE_OR_VIEW extends TableOrViewAlias<infer T, infer ALIAS> ? (T extends ITable<any> ? TableOrViewAlias<ITable<REF>, ALIAS> : T extends IView<any> ? TableOrViewAlias<IView<REF>, ALIAS> : T extends IWithView<any> ? TableOrViewAlias<IWithView<REF>, ALIAS> : T extends IValues<any> ? TableOrViewAlias<IValues<REF>, ALIAS> : never) : TABLE_OR_VIEW extends ITable<any> ? ITable<REF> : TABLE_OR_VIEW extends IView<any> ? IView<REF> : TABLE_OR_VIEW extends IWithView<any> ? IWithView<REF> : TABLE_OR_VIEW extends IValues<any> ? IValues<REF> : never;
type CustomizedTableOrViewRefFor<TABLE_OR_VIEW extends ITableOrView<any>, NAME> = TABLE_OR_VIEW[typeof tableOrViewRef] extends TABLE_OR_VIEW_ALIAS<infer R, infer ALIAS> ? TABLE_OR_VIEW_ALIAS<CUSTOMIZED_TABLE_OR_VIEW<R, NAME>, ALIAS> : CUSTOMIZED_TABLE_OR_VIEW<TABLE_OR_VIEW[typeof tableOrViewRef], NAME>;
type CustomizedTableOrViewRefForWitNoAlias<TABLE_OR_VIEW extends ITableOrView<any>, NAME> = TABLE_OR_VIEW[typeof tableOrViewRef] extends TABLE_OR_VIEW_ALIAS<infer R, any> ? CUSTOMIZED_TABLE_OR_VIEW<R, NAME> : CUSTOMIZED_TABLE_OR_VIEW<TABLE_OR_VIEW[typeof tableOrViewRef], NAME>;
type CustomizedTableOrViewNoAliasable<TABLE_OR_VIEW extends ITableOrView<any>, NAME> = {
[K in ValueSourcesOf<TABLE_OR_VIEW>]: RemapValueSourceType<CustomizedTableOrViewRefFor<TABLE_OR_VIEW, NAME>, TABLE_OR_VIEW[K]>;
} & CustomizedTableOrViewType<TABLE_OR_VIEW, CustomizedTableOrViewRefForWitNoAlias<TABLE_OR_VIEW, NAME>>;
export declare type CustomizedTableOrView<T extends ITableOrView<any>, NAME extends string> = (T extends {
export type CustomizedTableOrView<T extends ITableOrView<any>, NAME extends string> = (T extends {
as(as: any): any;
} ? AddAliasMethods<CustomizedTableOrViewNoAliasable<T, NAME>> : CustomizedTableOrViewNoAliasable<T, NAME>) & {};
export declare type AutogeneratedPrimaryKeyColumnsTypesOf<T extends ITableOrView<any>> = ({
export type AutogeneratedPrimaryKeyColumnsTypesOf<T extends ITableOrView<any>> = ({
[K in keyof T]-?: T[K] extends ValueSourceOf<T[typeof tableOrViewRef]> & Column ? (T[K] extends ComputedColumn ? never : (T[K] extends PrimaryKeyAutogeneratedColumn ? ValueSourceValueType<T[K]> : never)) : never;
})[keyof T];
export declare type ColumnsForSetOf<TYPE extends ITableOrView<any>> = ({
export type ColumnsForSetOf<TYPE extends ITableOrView<any>> = ({
[K in keyof TYPE]-?: TYPE[K] extends ValueSourceOf<TYPE[typeof tableOrViewRef]> & Column ? (TYPE[K] extends ComputedColumn ? never : K) : never;
})[keyof TYPE];
export declare type RequiredColumnsForSetOf<T extends ITableOrView<any>> = ({
export type RequiredColumnsForSetOf<T extends ITableOrView<any>> = ({
[K in keyof T]-?: T[K] extends ValueSourceOf<T[typeof tableOrViewRef]> & Column ? (T[K] extends ComputedColumn ? never : (T[K] extends OptionalColumn ? never : (T[K] extends ColumnWithDefaultValue ? never : K))) : never;
})[keyof T];
export declare type OptionalColumnsForSetOf<T extends ITableOrView<any>> = ({
export type OptionalColumnsForSetOf<T extends ITableOrView<any>> = ({
[K in keyof T]-?: T[K] extends ValueSourceOf<T[typeof tableOrViewRef]> & Column ? (T[K] extends ComputedColumn ? never : (T[K] extends OptionalColumn ? K : (T[K] extends ColumnWithDefaultValue ? K : never))) : never;
})[keyof T];
export {};

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc