UNPKG

@sqb/builder

Version:

Extensible multi-dialect SQL query builder written with TypeScript

43 lines (42 loc) 1.22 kB
import { SerializationType } from '../enums.js'; import { Serializable } from '../serializable.js'; import { SerializeContext } from '../serialize-context.js'; import { Operator } from './operator.js'; import { LogicalOperator } from './operators/logical-operator.js'; import { RawStatement } from './raw-statement.js'; export declare class CaseStatement extends Serializable { _expressions: { condition: Serializable; value: any; }[]; _elseValue: any; _condition?: LogicalOperator; _alias?: string; constructor(); get _type(): SerializationType; /** * Defines "when" part of Case expression. */ when(...condition: (Operator | RawStatement)[]): this; /** * Defines "then" part of Case expression. */ then(value: any): this; /** * Defines "else" part of Case expression. */ else(value: any): this; /** * Sets alias to case expression. */ as(alias: string): this; /** * Performs serialization * * @param {Object} ctx * @return {string} * @override */ _serialize(ctx: SerializeContext): string; protected __defaultSerialize(ctx: SerializeContext, o: any): string; }