CaseBuilder
class CaseBuilder<DB, TB extends keyof DB, W = unknown, O = never> implements Whenable<DB, TB, W, O> {}
constructor(props: CaseBuilderProps);
when<RE extends ReferenceExpression<DB, TB>, VE extends OperandValueExpressionOrList<DB, TB, RE>>(
lhs: unknown extends W ? RE : KyselyTypeError<"when(lhs, op, rhs) is not supported when using case(value)">,
rhs: VE,
): CaseThenBuilder<DB, TB, W, O>;when(value: unknown extends W ? KyselyTypeError<"when(value) is only supported when using case(value)"> : W): CaseThenBuilder<DB, TB, W, O>;
§Methods
§
when<RE extends ReferenceExpression<DB, TB>, VE extends OperandValueExpressionOrList<DB, TB, RE>>(lhs: unknown extends W ? RE : KyselyTypeError<"when(lhs, op, rhs) is not supported when using case(value)">, op: ComparisonOperatorExpression, rhs: VE): CaseThenBuilder<DB, TB, W, O>
[src]Adds a when
clause to the case statement.
A when
call must be followed by a CaseThenBuilder.then call.
when(expression: Expression<W>): CaseThenBuilder<DB, TB, W, O>
[src]when(value: unknown extends W ? KyselyTypeError<"when(value) is only supported when using case(value)"> : W): CaseThenBuilder<DB, TB, W, O>
[src]