Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

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(expression: Expression<W>): 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>;
}

§Type Parameters

§
TB extends keyof DB
[src]
§
W = unknown
[src]
§
O = never
[src]

§Implements

§
Whenable<DB, TB, W, O>
[src]

§Constructors

§
new CaseBuilder(props: CaseBuilderProps)
[src]

§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]