Skip to main content
Module

x/kysely_deno_postgres_dialect/mod.ts>kysely.CaseWhenBuilder

Kysely dialect for PostgreSQL using the deno-postgres client.
Latest
class kysely.CaseWhenBuilder
implements Whenable<DB, TB, W, O>, Endable<DB, TB, O | null>
import { kysely } from "https://deno.land/x/kysely_deno_postgres_dialect@v0.27.1/mod.ts";
const { CaseWhenBuilder } = kysely;

Constructors

new
CaseWhenBuilder(props: CaseBuilderProps)

Type Parameters

DB
TB extends keyof DB
W
O

Methods

else<O2>(expression: Expression<O2>): CaseEndBuilder<DB, TB, O | O2>

Adds an else clause to the case statement.

An else call must be followed by an Endable.end or 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 endCase instead.

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 end instead.

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>

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>
when(value: unknown extends W ? KyselyTypeError<"when(value) is only supported when using case(value)"> : W): CaseThenBuilder<DB, TB, W, O>