UNPKG

@devbro/sql-generator

Version:
49 lines (46 loc) 1.35 kB
declare class Expression { private sql; private bindings; constructor(sql?: string, bindings?: never[]); toCompiledSql(): CompiledSql; } type selectType = string; type whereBasic = { joinCondition: JoinCondition; negateCondition: boolean; }; type whereOp = { type: 'operation'; column: string; operation: string; value: Parameter; }; type whereOpColumn = { type: 'operationColumn'; column1: string; operation: string; column2: string; }; type whereRaw = { type: 'raw'; sql: string; bindings: Parameter[]; }; type whereNull = { type: 'null'; column: string; }; type whereType = whereBasic & (whereOp | whereOpColumn | whereNull); type Parameter = string | number | Date | boolean | null | Expression | undefined; type JoinCondition = 'and' | 'or'; type CompiledSql = { sql: string; bindings: Parameter[]; }; type havingType = whereBasic & (whereOp | whereRaw); type joinType = { type: 'inner' | 'left' | 'right' | 'full'; table: string; conditions: whereType[]; }; export { type CompiledSql as C, Expression as E, type JoinCondition as J, type Parameter as P, type whereOp as a, type whereOpColumn as b, type whereRaw as c, type whereNull as d, type whereType as e, type havingType as h, type joinType as j, type selectType as s, type whereBasic as w };