UNPKG

ts-sql-query

Version:

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.

428 lines 256 kB
import type { ITableOrView, ITableOrViewOf, ITableOrViewRef, HasAddWiths } from "../utils/ITableOrView"; import type { AnyDB } from "../databases"; import type { int, double, /*LocalDate, LocalTime, LocalDateTime,*/ stringDouble, stringInt, LocalTime, LocalDateTime, LocalDate, uuid } from "ts-extended-types"; import type { TypeAdapter } from "../TypeAdapter"; import type { aggregatedArrayValueSourceType, anyBooleanValueSourceType, bigintValueSourceType, booleanValueSourceType, columnsType, comparableValueSourceType, customDoubleValueSourceType, customIntValueSourceType, customLocalDateTimeValueSourceType, customLocalDateValueSourceType, customLocalTimeValueSourceType, customUuidValueSourceType, database, dateTimeValueSourceType, dateValueSourceType, doubleValueSourceType, equalableValueSourceType, ifValueSourceType, intValueSourceType, localDateTimeValueSourceType, localDateValueSourceType, localTimeValueSourceType, nullableValueSourceType, numberValueSourceType, optionalType, requiredTableOrView, resultType, stringDoubleValueSourceType, stringIntValueSourceType, stringNumberValueSourceType, stringValueSourceType, tableOrView, tableOrViewRef, timeValueSourceType, type, typeSafeBigintValueSourceType, typeSafeStringValueSourceType, typeSafeUuidValueSourceType, uuidValueSourceType, valueSourceType } from "../utils/symbols"; import { valueType, valueSourceTypeName, isValueSourceObject } from "../utils/symbols"; export type OptionalType = 'required' | 'requiredInOptionalObject' | 'originallyRequired' | 'optional'; export type MergeOptional<OP1 extends OptionalType, OP2 extends OptionalType> = OP1 extends 'any' ? 'optional' : OP2 extends 'any' ? 'optional' : OP1 extends 'required' ? OP2 : OP1 extends 'requiredInOptionalObject' ? (OP2 extends 'required' ? 'requiredInOptionalObject' : OP2) : OP1 extends 'originallyRequired' ? (OP2 extends 'required' | 'requiredInOptionalObject' ? 'originallyRequired' : OP2) : 'optional'; export declare function __mergeOptional(op1: OptionalType, op2: OptionalType): OptionalType; export type MergeOptionalUnion<OPTIONAL_TYPE extends OptionalType> = 'any' extends OPTIONAL_TYPE ? 'optional' : 'optional' extends OPTIONAL_TYPE ? 'optional' : 'originallyRequired' extends OPTIONAL_TYPE ? 'originallyRequired' : 'requiredInOptionalObject' extends OPTIONAL_TYPE ? 'requiredInOptionalObject' : 'required'; export type OptionalTypeRequiredOrAny<OPTIONAL_TYPE extends OptionalType> = OPTIONAL_TYPE extends 'any' ? any : OPTIONAL_TYPE extends 'required' ? 'required' : any; type OptionalValueType<OPTIONAL_TYPE extends OptionalType> = OPTIONAL_TYPE extends 'optional' ? null | undefined : never; export type OptionalTypeOfValue<T> = undefined extends string ? 'optional' : undefined extends T ? 'optional' : null extends T ? 'optional' : 'required'; export type ValueSourceValueType<T> = T extends IValueSource<any, infer TYPE, any, infer OPTIONAL_TYPE> ? TYPE | OptionalValueType<OPTIONAL_TYPE> : never; export type ValueSourceValueTypeForResult<T> = T extends IValueSource<any, infer TYPE, any, infer OPTIONAL_TYPE> ? TYPE | (OPTIONAL_TYPE extends 'required' ? never : null) : never; export type ValueSourceValueTypeForObjectResult<T> = T extends IValueSource<any, infer TYPE, any, infer OPTIONAL_TYPE> ? TYPE | (OPTIONAL_TYPE extends 'required' ? never : undefined) : never; export type ValueSourceValueTypeForNullableObjectResult<T> = T extends IValueSource<any, infer TYPE, any, infer OPTIONAL_TYPE> ? TYPE | (OPTIONAL_TYPE extends 'required' ? never : null) : never; export type ValueSourceValueTypeForRequiredInOptionalObject<T> = T extends IValueSource<any, infer TYPE, any, infer OPTIONAL_TYPE> ? TYPE | (OPTIONAL_TYPE extends 'required' | 'requiredInOptionalObject' ? never : undefined) : never; export type ValueSourceValueTypeForRequiredInNullableOptionalObject<T> = T extends IValueSource<any, infer TYPE, any, infer OPTIONAL_TYPE> ? TYPE | (OPTIONAL_TYPE extends 'required' | 'requiredInOptionalObject' ? never : null) : never; export type ValueSourceValueTypeForOptionalObjectResultSameOuterJoin<T> = T extends IValueSource<any, infer TYPE, any, infer OPTIONAL_TYPE> ? TYPE | (OPTIONAL_TYPE extends 'required' | 'requiredInOptionalObject' | 'originallyRequired' ? never : undefined) : never; export type ValueSourceValueTypeForOptionalNullableObjectResultSameOuterJoin<T> = T extends IValueSource<any, infer TYPE, any, infer OPTIONAL_TYPE> ? TYPE | (OPTIONAL_TYPE extends 'required' | 'requiredInOptionalObject' | 'originallyRequired' ? never : null) : never; export interface AnyValueSource { [valueSourceType]: 'ValueSource'; } export interface ValueSourceOfDB<DB extends AnyDB> extends AnyValueSource { [database]: DB; } export interface ValueSourceOf<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>> extends ValueSourceOfDB<TABLE_OR_VIEW[typeof database]> { [tableOrView]: TABLE_OR_VIEW; } export interface IValueSource<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, TYPE, TYPE_NAME, OPTIONAL_TYPE extends OptionalType> extends ValueSourceOf<TABLE_OR_VIEW> { [valueType]: TYPE; [optionalType]: OPTIONAL_TYPE; [valueSourceTypeName]: TYPE_NAME; } export interface ValueSource<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, TYPE, TYPE_NAME, OPTIONAL_TYPE extends OptionalType> extends IValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, OPTIONAL_TYPE> { isConstValue(): boolean; getConstValue(): TYPE; allowWhen(when: boolean, errorMessage: string): this; allowWhen(when: boolean, error: Error): this; disallowWhen(when: boolean, errorMessage: string): this; disallowWhen(when: boolean, error: Error): this; } export type ValueType = 'boolean' | 'stringInt' | 'int' | 'bigint' | 'customInt' | 'stringDouble' | 'double' | 'customDouble' | 'string' | 'uuid' | 'customUuid' | 'localDate' | 'customLocalDate' | 'localTime' | 'customLocalTime' | 'localDateTime' | 'customLocalDateTime' | 'enum' | 'custom' | 'customComparable' | 'aggregatedArray' | ''; export type NativeValueType = Exclude<ValueType, 'enum' | 'custom' | 'customComparable' | 'aggregatedArray' | ''>; export interface __ValueSourcePrivate extends HasAddWiths { [isValueSourceObject]: true; __valueType: ValueType; __valueTypeName: string; __optionalType: OptionalType; __typeAdapter?: TypeAdapter; __isBooleanForCondition?: boolean; __aggregatedArrayColumns?: __AggregatedArrayColumns | AnyValueSource; __aggregatedArrayMode?: __AggregatedArrayMode; __aggreagtedProjectingOptionalValuesAsNullable?: boolean; __aggregatedArrayDistinct?: boolean; __uuidString?: boolean; isConstValue(): boolean; getConstValue(): any; } export declare function __isBooleanValueSource(valueSourcePrivate: __ValueSourcePrivate): boolean; export declare function __isBooleanValueType(valueType: ValueType): boolean; export declare function __isUuidValueSource(valueSourcePrivate: __ValueSourcePrivate): boolean; export declare function __isUuidValueType(valueType: ValueType): boolean; export declare function __isStringValueSource(valueSourcePrivate: __ValueSourcePrivate): boolean; export declare function __isLocalDateValueSource(valueSourcePrivate: __ValueSourcePrivate): boolean; export declare function __isLocalTimeValueSource(valueSourcePrivate: __ValueSourcePrivate): boolean; export declare function __isLocalDateTimeValueSource(valueSourcePrivate: __ValueSourcePrivate): boolean; export type __AggregatedArrayColumns = { [P: string]: AnyValueSource | __AggregatedArrayColumns; }; export type __AggregatedArrayMode = 'ResultObject' | 'InnerResultObject'; export declare function isValueSource(value: any): value is AnyValueSource; export declare function __getValueSourceOfObject(obj: ITableOrView<any>, prop: string): ValueSource<ITableOrViewRef<AnyDB>, unknown, unknown, any> | undefined; export declare function __getValueSourcePrivate(valueSource: AnyValueSource | IIfValueSource<any, any>): __ValueSourcePrivate; export interface INullableValueSource<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, TYPE, TYPE_NAME, OPTIONAL_TYPE extends OptionalType> extends IValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, OPTIONAL_TYPE> { [nullableValueSourceType]: 'NullableValueSource'; } export interface NullableValueSource<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, TYPE, TYPE_NAME, OPTIONAL_TYPE extends OptionalType> extends ValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, OPTIONAL_TYPE>, INullableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, OPTIONAL_TYPE> { isNull(): BooleanValueSource<TABLE_OR_VIEW, 'required'>; isNotNull(): BooleanValueSource<TABLE_OR_VIEW, 'required'>; valueWhenNull(value: TYPE): NullableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, 'required'>; valueWhenNull<VALUE extends IValueSource<ITableOrViewRef<this[typeof database]>, TYPE, this[typeof valueSourceTypeName], any>>(value: VALUE): NullableValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], TYPE, TYPE_NAME, VALUE[typeof optionalType]>; nullIfValue(value: TYPE): NullableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, 'optional'>; nullIfValue<VALUE extends IValueSource<ITableOrViewRef<this[typeof database]>, TYPE, this[typeof valueSourceTypeName], any>>(value: VALUE): NullableValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], TYPE, TYPE_NAME, 'optional'>; asOptional(): NullableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, 'optional'>; asRequiredInOptionalObject(): NullableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, 'requiredInOptionalObject'>; onlyWhenOrNull(when: boolean): NullableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, 'optional'>; ignoreWhenAsNull(when: boolean): NullableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, 'optional'>; } export interface IExecutableSelectQuery<DB extends AnyDB, RESULT, COLUMNS, REQUIRED_TABLE_OR_VIEW extends ITableOrViewOf<DB, any>> { [type]: 'ExecutableSelectQuery'; [database]: DB; [requiredTableOrView]: REQUIRED_TABLE_OR_VIEW; [resultType]: RESULT; [columnsType]: COLUMNS; } export interface IExecutableInsertQuery<TABLE extends ITableOrView<any>, RESULT> { [type]: 'ExecutableInsertQuery'; [database]: TABLE[typeof database]; [tableOrView]: TABLE; [resultType]: RESULT; } export interface IExecutableUpdateQuery<TABLE extends ITableOrView<any>, RESULT> { [type]: 'ExecutableUpdateQuery'; [database]: TABLE[typeof database]; [tableOrView]: TABLE; [resultType]: RESULT; } export interface IExecutableDeleteQuery<TABLE extends ITableOrView<any>, RESULT> { [type]: 'ExecutableDeleteQuery'; [database]: TABLE[typeof database]; [tableOrView]: TABLE; [resultType]: RESULT; } export interface IEqualableValueSource<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, TYPE, TYPE_NAME, OPTIONAL_TYPE extends OptionalType> extends INullableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, OPTIONAL_TYPE> { [equalableValueSourceType]: 'EqualableValueSource'; } export interface EqualableValueSource<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, TYPE, TYPE_NAME, OPTIONAL_TYPE extends OptionalType> extends NullableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, OPTIONAL_TYPE>, IEqualableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, OPTIONAL_TYPE> { equalsIfValue(value: TYPE | null | undefined): IfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; equals(value: TYPE): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected falsy value (when the provided value is null or undefined); you should be using equalsIfValue instead */ equals(value: TYPE | OptionalValueType<OPTIONAL_TYPE>): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; equals<VALUE extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; notEqualsIfValue(value: TYPE | null | undefined): IfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; notEquals(value: TYPE): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected falsy value (when the provided value is null or undefined); you should be using notEqualsIfValue instead */ notEquals(value: TYPE | OptionalValueType<OPTIONAL_TYPE>): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; notEquals<VALUE extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; isIfValue(value: TYPE | null | undefined): IfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; is(value: TYPE | null | undefined): BooleanValueSource<TABLE_OR_VIEW, 'required'>; is<VALUE extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], 'required'>; isNotIfValue(value: TYPE | null | undefined): IfValueSource<TABLE_OR_VIEW, 'required'>; isNot(value: TYPE | null | undefined): BooleanValueSource<TABLE_OR_VIEW, 'required'>; isNot<VALUE extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], 'required'>; inIfValue(values: TYPE[] | null | undefined): IfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; in(values: TYPE[]): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; in<VALUE extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; in<TABLE_OR_VIEW2 extends ITableOrView<any>>(select: IExecutableSelectQuery<TABLE_OR_VIEW[typeof database], TYPE | null | undefined, IEqualableValueSource<any, TYPE, TYPE_NAME, any>, TABLE_OR_VIEW2>): BooleanValueSource<TABLE_OR_VIEW | TABLE_OR_VIEW2[typeof tableOrViewRef], OPTIONAL_TYPE>; notInIfValue(values: TYPE[] | null | undefined): IfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; notIn(values: TYPE[]): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; notIn<VALUE extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; notIn<TABLE_OR_VIEW2 extends ITableOrView<any>>(select: IExecutableSelectQuery<TABLE_OR_VIEW[typeof database], TYPE | null | undefined, IEqualableValueSource<any, TYPE, TYPE_NAME, any>, TABLE_OR_VIEW2>): BooleanValueSource<TABLE_OR_VIEW | TABLE_OR_VIEW2[typeof tableOrViewRef], OPTIONAL_TYPE>; inN(...value: TYPE[]): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; inN<VALUE extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(...value: Array<TYPE | VALUE>): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; notInN(...value: TYPE[]): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; notInN<VALUE extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(...value: Array<TYPE | VALUE>): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; valueWhenNull(value: TYPE): EqualableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, 'required'>; valueWhenNull<VALUE extends IValueSource<ITableOrViewRef<this[typeof database]>, TYPE, this[typeof valueSourceTypeName], any>>(value: VALUE): EqualableValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], TYPE, TYPE_NAME, VALUE[typeof optionalType]>; nullIfValue(value: TYPE): EqualableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, 'optional'>; nullIfValue<VALUE extends IValueSource<ITableOrViewRef<this[typeof database]>, TYPE, this[typeof valueSourceTypeName], any>>(value: VALUE): EqualableValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], TYPE, TYPE_NAME, 'optional'>; asOptional(): EqualableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, 'optional'>; asRequiredInOptionalObject(): EqualableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, 'requiredInOptionalObject'>; onlyWhenOrNull(when: boolean): EqualableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, 'optional'>; ignoreWhenAsNull(when: boolean): EqualableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, 'optional'>; } export interface IComparableValueSource<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, TYPE, TYPE_NAME, OPTIONAL_TYPE extends OptionalType> extends IEqualableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, OPTIONAL_TYPE> { [comparableValueSourceType]: 'ComparableValueSource'; } export interface ComparableValueSource<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, TYPE, TYPE_NAME, OPTIONAL_TYPE extends OptionalType> extends EqualableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, OPTIONAL_TYPE>, IComparableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, OPTIONAL_TYPE> { /** @deprecated use lessThanIfValue method instead */ smallerIfValue(value: TYPE | null | undefined): IfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated use lessThan method instead */ smaller(value: TYPE | OptionalValueType<OPTIONAL_TYPE>): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated use lessThan method instead */ smaller<VALUE extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; /** @deprecated use greaterThanIfValue method instead */ largerIfValue(value: TYPE | null | undefined): IfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated use greaterThan method instead */ larger(value: TYPE | OptionalValueType<OPTIONAL_TYPE>): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated use greaterThan method instead */ larger<VALUE extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; /** @deprecated use lessOrEqualsIfValue method instead */ smallAsIfValue(value: TYPE | null | undefined): IfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated use lessOrEquals method instead */ smallAs(value: TYPE | OptionalValueType<OPTIONAL_TYPE>): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated use lessOrEquals method instead */ smallAs<VALUE extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; /** @deprecated use greaterOrEqualsIfValue method instead */ largeAsIfValue(value: TYPE | null | undefined): IfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated use greaterOrEquals method instead */ largeAs(value: TYPE | OptionalValueType<OPTIONAL_TYPE>): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated use greaterOrEquals method instead */ largeAs<VALUE extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; lessThanIfValue(value: TYPE | null | undefined): IfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; lessThan(value: TYPE): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected falsy value (when the provided value is null or undefined); you should be using lessThanIfValue instead */ lessThan(value: TYPE | OptionalValueType<OPTIONAL_TYPE>): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; lessThan<VALUE extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; greaterThanIfValue(value: TYPE | null | undefined): IfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; greaterThan(value: TYPE): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected falsy value (when the provided value is null or undefined); you should be using greaterThanIfValue instead */ greaterThan(value: TYPE | OptionalValueType<OPTIONAL_TYPE>): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; greaterThan<VALUE extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; lessOrEqualsIfValue(value: TYPE | null | undefined): IfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; lessOrEquals(value: TYPE): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected falsy value (when the provided value is null or undefined); you should be using lessOrEqualsIfValue instead */ lessOrEquals(value: TYPE | OptionalValueType<OPTIONAL_TYPE>): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; lessOrEquals<VALUE extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; greaterOrEqualsIfValue(value: TYPE | null | undefined): IfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; greaterOrEquals(value: TYPE): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected falsy value (when the provided value is null or undefined); you should be using greaterOrEqualsIfValue instead */ greaterOrEquals(value: TYPE | OptionalValueType<OPTIONAL_TYPE>): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; greaterOrEquals<VALUE extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; between(value: TYPE, value2: TYPE): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected falsy value (when the provided value is null or undefined); you should be using greaterOrEqualsIfValue instead */ between(value: TYPE | OptionalValueType<OPTIONAL_TYPE>, value2: TYPE | OptionalValueType<OPTIONAL_TYPE>): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; between<VALUE2 extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: TYPE, value2: VALUE2): BooleanValueSource<TABLE_OR_VIEW | VALUE2[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE2[typeof optionalType]>>; /** @deprecated you are using a value that can returns an unexpected falsy value (when the provided value is null or undefined); you should be using greaterOrEqualsIfValue instead */ between<VALUE2 extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: TYPE | OptionalValueType<OPTIONAL_TYPE>, value2: VALUE2): BooleanValueSource<TABLE_OR_VIEW | VALUE2[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE2[typeof optionalType]>>; between<VALUE extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: VALUE, value2: TYPE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; /** @deprecated you are using a value that can returns an unexpected falsy value (when the provided value is null or undefined); you should be using greaterOrEqualsIfValue instead */ between<VALUE extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: VALUE, value2: TYPE | OptionalValueType<OPTIONAL_TYPE>): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; between<VALUE extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>, VALUE2 extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: VALUE, value2: VALUE2): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView] | VALUE2[typeof tableOrView], MergeOptional<MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>, VALUE2[typeof optionalType]>>; notBetween(value: TYPE, value2: TYPE): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected falsy value (when the provided value is null or undefined); you should be using greaterOrEqualsIfValue instead */ notBetween(value: TYPE | OptionalValueType<OPTIONAL_TYPE>, value2: TYPE | OptionalValueType<OPTIONAL_TYPE>): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; notBetween<VALUE2 extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: TYPE, value2: VALUE2): BooleanValueSource<TABLE_OR_VIEW | VALUE2[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE2[typeof optionalType]>>; /** @deprecated you are using a value that can returns an unexpected falsy value (when the provided value is null or undefined); you should be using greaterOrEqualsIfValue instead */ notBetween<VALUE2 extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: TYPE | OptionalValueType<OPTIONAL_TYPE>, value2: VALUE2): BooleanValueSource<TABLE_OR_VIEW | VALUE2[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE2[typeof optionalType]>>; notBetween<VALUE extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: VALUE, value2: TYPE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; /** @deprecated you are using a value that can returns an unexpected falsy value (when the provided value is null or undefined); you should be using greaterOrEqualsIfValue instead */ notBetween<VALUE extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: VALUE, value2: TYPE | OptionalValueType<OPTIONAL_TYPE>): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; notBetween<VALUE extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>, VALUE2 extends IEqualableValueSource<ITableOrViewRef<this[typeof database]>, TYPE, TYPE_NAME, any>>(value: VALUE, value2: VALUE2): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView] | VALUE2[typeof tableOrView], MergeOptional<MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>, VALUE2[typeof optionalType]>>; valueWhenNull(value: TYPE): ComparableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, 'required'>; valueWhenNull<VALUE extends IValueSource<ITableOrViewRef<this[typeof database]>, TYPE, this[typeof valueSourceTypeName], any>>(value: VALUE): ComparableValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], TYPE, TYPE_NAME, VALUE[typeof optionalType]>; nullIfValue(value: TYPE): ComparableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, 'optional'>; nullIfValue<VALUE extends IValueSource<ITableOrViewRef<this[typeof database]>, TYPE, this[typeof valueSourceTypeName], any>>(value: VALUE): ComparableValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], TYPE, TYPE_NAME, 'optional'>; asOptional(): ComparableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, 'optional'>; asRequiredInOptionalObject(): ComparableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, 'requiredInOptionalObject'>; onlyWhenOrNull(when: boolean): ComparableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, 'optional'>; ignoreWhenAsNull(when: boolean): ComparableValueSource<TABLE_OR_VIEW, TYPE, TYPE_NAME, 'optional'>; } export interface IBooleanValueSource<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, OPTIONAL_TYPE extends OptionalType> extends IEqualableValueSource<TABLE_OR_VIEW, boolean, 'BooleanValueSource', OPTIONAL_TYPE> { [booleanValueSourceType]: 'BooleanValueSource'; [anyBooleanValueSourceType]: 'AnyBooleanValueSource'; } export interface BooleanValueSource<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, OPTIONAL_TYPE extends OptionalType> extends EqualableValueSource<TABLE_OR_VIEW, boolean, 'BooleanValueSource', OPTIONAL_TYPE>, IBooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE> { negate(): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; and(value: boolean): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected falsy value (when the provided value is null or undefined); this could be an error in your code */ and(value: boolean | OptionalValueType<OPTIONAL_TYPE>): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; and<VALUE extends IIfValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; and<VALUE extends IBooleanValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; or(value: boolean): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected falsy value (when the provided value is null or undefined); this could be an error in your code */ or(value: boolean | OptionalValueType<OPTIONAL_TYPE>): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; or<VALUE extends IIfValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; or<VALUE extends IBooleanValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; onlyWhen(condition: boolean): IIfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; ignoreWhen(condition: boolean): IIfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; valueWhenNull(value: boolean): BooleanValueSource<TABLE_OR_VIEW, 'required'>; valueWhenNull<VALUE extends IValueSource<ITableOrViewRef<this[typeof database]>, boolean, this[typeof valueSourceTypeName], any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], VALUE[typeof optionalType]>; nullIfValue(value: boolean): BooleanValueSource<TABLE_OR_VIEW, 'optional'>; nullIfValue<VALUE extends IValueSource<ITableOrViewRef<this[typeof database]>, boolean, this[typeof valueSourceTypeName], any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], 'optional'>; asOptional(): BooleanValueSource<TABLE_OR_VIEW, 'optional'>; asRequiredInOptionalObject(): BooleanValueSource<TABLE_OR_VIEW, 'requiredInOptionalObject'>; onlyWhenOrNull(when: boolean): BooleanValueSource<TABLE_OR_VIEW, 'optional'>; ignoreWhenAsNull(when: boolean): BooleanValueSource<TABLE_OR_VIEW, 'optional'>; } export interface IIfValueSource<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, OPTIONAL_TYPE extends OptionalType> { [database]: TABLE_OR_VIEW[typeof database]; [tableOrView]: TABLE_OR_VIEW; [valueType]: boolean; [optionalType]: OPTIONAL_TYPE; [ifValueSourceType]: 'IfValueSource'; [anyBooleanValueSourceType]: 'AnyBooleanValueSource'; } export interface IfValueSource<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, OPTIONAL_TYPE extends OptionalType> extends IIfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE> { negate(): IIfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; and(value: boolean): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected falsy value (when the provided value is null or undefined); this could be an error in your code */ and(value: boolean | OptionalValueType<OPTIONAL_TYPE>): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; and<VALUE extends IIfValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): IfValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; and<VALUE extends IBooleanValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; or(value: boolean): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected falsy value (when the provided value is null or undefined); this could be an error in your code */ or(value: boolean | OptionalValueType<OPTIONAL_TYPE>): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; or<VALUE extends IIfValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): IfValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; or<VALUE extends IBooleanValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; onlyWhen(condition: boolean): IIfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; ignoreWhen(condition: boolean): IIfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; trueWhenNoValue(): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; falseWhenNoValue(): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; valueWhenNoValue(value: boolean): BooleanValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; valueWhenNoValue<VALUE extends IIfValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): IIfValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; valueWhenNoValue<VALUE extends IBooleanValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): BooleanValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; } export interface IAnyBooleanValueSource<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, OPTIONAL_TYPE extends OptionalType> { [database]: TABLE_OR_VIEW[typeof database]; [tableOrView]: TABLE_OR_VIEW; [valueType]: boolean; [optionalType]: OPTIONAL_TYPE; [anyBooleanValueSourceType]: 'AnyBooleanValueSource'; } export interface AlwaysIfValueSource<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, OPTIONAL_TYPE extends OptionalType> extends IIfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE> { negate(): AlwaysIfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; and(value: boolean): AlwaysIfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected falsy value (when the provided value is null or undefined); this could be an error in your code */ and(value: boolean | OptionalValueType<OPTIONAL_TYPE>): AlwaysIfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; and<VALUE extends IIfValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): AlwaysIfValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; and<VALUE extends IBooleanValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): AlwaysIfValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; or(value: boolean): AlwaysIfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected falsy value (when the provided value is null or undefined); this could be an error in your code */ or(value: boolean | OptionalValueType<OPTIONAL_TYPE>): AlwaysIfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; or<VALUE extends IIfValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): AlwaysIfValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; or<VALUE extends IBooleanValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): AlwaysIfValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; onlyWhen(condition: boolean): AlwaysIfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; ignoreWhen(condition: boolean): AlwaysIfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; trueWhenNoValue(): AlwaysIfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; falseWhenNoValue(): AlwaysIfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; valueWhenNoValue(value: boolean): AlwaysIfValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; valueWhenNoValue<VALUE extends IIfValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): AlwaysIfValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; valueWhenNoValue<VALUE extends IBooleanValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): AlwaysIfValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; } export interface INumberValueSource<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, OPTIONAL_TYPE extends OptionalType> extends IComparableValueSource<TABLE_OR_VIEW, number, 'NumberValueSource', OPTIONAL_TYPE> { [numberValueSourceType]: 'NumberValueSource'; } export interface NumberValueSource<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, OPTIONAL_TYPE extends OptionalType> extends ComparableValueSource<TABLE_OR_VIEW, number, 'NumberValueSource', OPTIONAL_TYPE>, INumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE> { asInt(): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; asDouble(): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated 'stringInt' type is deprecated, define your customInt instead */ asStringInt(): StringNumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated 'stringDouble' type is deprecated, define your customInt instead */ asStringDouble(): StringNumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; asBigint(): BigintValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; abs(): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; ceil(): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; floor(): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; round(): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; exp(): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; ln(): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; log10(): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; sqrt(): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; cbrt(): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; sign(): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; acos(): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; asin(): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; atan(): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; cos(): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; cot(): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; sin(): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; tan(): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; power(value: number): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected null value (when the provided value is null or undefined); this could be an error in your code */ power(value: number | OptionalValueType<OPTIONAL_TYPE>): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; power<VALUE extends INumberValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): NumberValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; logn(value: number): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected null value (when the provided value is null or undefined); this could be an error in your code */ logn(value: number | OptionalValueType<OPTIONAL_TYPE>): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; logn<VALUE extends INumberValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): NumberValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; roundn(value: number): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected null value (when the provided value is null or undefined); this could be an error in your code */ roundn(value: number | OptionalValueType<OPTIONAL_TYPE>): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; roundn<VALUE extends INumberValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): NumberValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; minValue(value: number): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected null value (when the provided value is null or undefined); this could be an error in your code */ minValue(value: number | OptionalValueType<OPTIONAL_TYPE>): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; minValue<VALUE extends INumberValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): NumberValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; maxValue(value: number): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected null value (when the provided value is null or undefined); this could be an error in your code */ maxValue(value: number | OptionalValueType<OPTIONAL_TYPE>): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; maxValue<VALUE extends INumberValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): NumberValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; add(value: number): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected null value (when the provided value is null or undefined); this could be an error in your code */ add(value: number | OptionalValueType<OPTIONAL_TYPE>): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; add<VALUE extends INumberValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): NumberValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; substract(value: number): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected null value (when the provided value is null or undefined); this could be an error in your code */ substract(value: number | OptionalValueType<OPTIONAL_TYPE>): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; substract<VALUE extends INumberValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): NumberValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; multiply(value: number): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected null value (when the provided value is null or undefined); this could be an error in your code */ multiply(value: number | OptionalValueType<OPTIONAL_TYPE>): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; multiply<VALUE extends INumberValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): NumberValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; divide(value: number): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected null value (when the provided value is null or undefined); this could be an error in your code */ divide(value: number | OptionalValueType<OPTIONAL_TYPE>): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; divide<VALUE extends INumberValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): NumberValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; modulo(value: number): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected null value (when the provided value is null or undefined); this could be an error in your code */ modulo(value: number | OptionalValueType<OPTIONAL_TYPE>): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; modulo<VALUE extends INumberValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): NumberValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; /** @deprecated use modulo method instead */ mod(value: number | OptionalValueType<OPTIONAL_TYPE>): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated use modulo method instead */ mod<VALUE extends INumberValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): NumberValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; atan2(value: number): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated you are using a value that can returns an unexpected null value (when the provided value is null or undefined); this could be an error in your code */ atan2(value: number | OptionalValueType<OPTIONAL_TYPE>): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; atan2<VALUE extends INumberValueSource<ITableOrViewRef<this[typeof database]>, any>>(value: VALUE): NumberValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], MergeOptional<OPTIONAL_TYPE, VALUE[typeof optionalType]>>; valueWhenNull(value: number): NumberValueSource<TABLE_OR_VIEW, 'required'>; valueWhenNull<VALUE extends IValueSource<ITableOrViewRef<this[typeof database]>, number, this[typeof valueSourceTypeName], any>>(value: VALUE): NumberValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], VALUE[typeof optionalType]>; nullIfValue(value: number): NumberValueSource<TABLE_OR_VIEW, 'optional'>; nullIfValue<VALUE extends IValueSource<ITableOrViewRef<this[typeof database]>, number, this[typeof valueSourceTypeName], any>>(value: VALUE): NumberValueSource<TABLE_OR_VIEW | VALUE[typeof tableOrView], 'optional'>; asOptional(): NumberValueSource<TABLE_OR_VIEW, 'optional'>; asRequiredInOptionalObject(): NumberValueSource<TABLE_OR_VIEW, 'requiredInOptionalObject'>; onlyWhenOrNull(when: boolean): NumberValueSource<TABLE_OR_VIEW, 'optional'>; ignoreWhenAsNull(when: boolean): NumberValueSource<TABLE_OR_VIEW, 'optional'>; } /** @deprecated 'stringInt' and 'stringDouble' types are deprecated, define your customInt instead */ export interface IStringNumberValueSource<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, OPTIONAL_TYPE extends OptionalType> extends IComparableValueSource<TABLE_OR_VIEW, number | string, 'StringNumberValueSource', OPTIONAL_TYPE> { [stringNumberValueSourceType]: 'StringNumberValueSource'; } /** @deprecated 'stringInt' and 'stringDouble' types are deprecated, define your customInt instead */ export interface StringNumberValueSource<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, OPTIONAL_TYPE extends OptionalType> extends ComparableValueSource<TABLE_OR_VIEW, number | string, 'StringNumberValueSource', OPTIONAL_TYPE>, IStringNumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE> { /** @deprecated 'stringInt' type is deprecated, define your customInt instead */ asStringInt(): StringNumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; /** @deprecated 'stringDouble' type is deprecated, define your customInt instead */ asStringDouble(): StringNumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; asBigint(): BigintValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; abs(): StringNumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; ceil(): StringNumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; floor(): StringNumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; round(): StringNumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; exp(): StringNumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; ln(): StringNumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; log10(): StringNumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; sqrt(): StringNumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; cbrt(): StringNumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; sign(): NumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; acos(): StringNumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; asin(): StringNumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; atan(): StringNumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; cos(): StringNumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; cot(): StringNumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; sin(): StringNumberValueSource<TABLE_OR_VIEW, OPTIONAL_TYPE>; tan(): StringNumberValueSource<TABLE_OR_VIEW,