import { kysely } from "https://dotland.deno.dev/x/kysely_postgrs_js_dialect@v0.27.3/deps.ts";
const { CaseWhenBuilder } = kysely;
Methods
else<E extends Expression<unknown>>(expression: E): CaseEndBuilder<DB, TB, O | ExtractTypeFromValueExpression<E>>
Adds an else
clause to the case
statement.
An else
call must be followed by an {@link Endable.end} or {@link Endable.endCase} call.
else<V>(value: V): CaseEndBuilder<DB, TB, O | V>
end(): ExpressionWrapper<DB, TB, O | null>
Adds an end
keyword to the case operator.
case
operators can only be used as part of a query.
For a case
statement used as part of a stored program, use {@link endCase} instead.
endCase(): ExpressionWrapper<DB, TB, O | null>
Adds end case
keywords to the case statement.
case
statements can only be used for flow control in stored programs.
For a case
operator used as part of a query, use {@link end} instead.
when<RE extends ReferenceExpression<DB, TB>, VE extends OperandValueExpressionOrList<DB, TB, RE>>(): CaseThenBuilder<DB, TB, W, O>
lhs: unknown extends W ? RE : KyselyTypeError<"when(lhs, op, rhs) is not supported when using case(value)">,
rhs: VE,
Adds a when
clause to the case statement.
A when
call must be followed by a {@link CaseThenBuilder.then} call.
when(expression: Expression<W>): CaseThenBuilder<DB, TB, W, O>