UNPKG

@sqb/builder

Version:

Extensible multi-dialect SQL query builder written with TypeScript

90 lines (89 loc) 4.45 kB
import { SelectQuery } from './query/select-query.js'; import { Serializable } from './serializable.js'; import { Operator } from './sql-objects/operator.js'; import { OpAnd } from './sql-objects/operators/op-and.js'; import { OpEq } from './sql-objects/operators/op-eq.js'; import { OpExists } from './sql-objects/operators/op-exists.js'; import { OpGt } from './sql-objects/operators/op-gt.js'; import { OpGte } from './sql-objects/operators/op-gte.js'; import { OpILike } from './sql-objects/operators/op-ilike.js'; import { OpIn } from './sql-objects/operators/op-in.js'; import { OpIs } from './sql-objects/operators/op-is.js'; import { OpIsNot } from './sql-objects/operators/op-is-not.js'; import { OpLike } from './sql-objects/operators/op-like.js'; import { OpLt } from './sql-objects/operators/op-lt.js'; import { OpLte } from './sql-objects/operators/op-lte.js'; import { OpNe } from './sql-objects/operators/op-ne.js'; import { OpNot } from './sql-objects/operators/op-not.js'; import { OpNotExists } from './sql-objects/operators/op-not-exists.js'; import { OpNotILike } from './sql-objects/operators/op-not-ilike.js'; import { OpNotIn } from './sql-objects/operators/op-not-in.js'; import { OpNotLike } from './sql-objects/operators/op-not-like.js'; import { OpOr } from './sql-objects/operators/op-or.js'; import { RawStatement } from './sql-objects/raw-statement.js'; declare function And(...args: (Operator | RawStatement)[]): OpAnd; declare function Or(...args: (Operator | RawStatement)[]): OpOr; declare function Eq(expression: string | Serializable, value: any): OpEq; declare function Ne(expression: string | Serializable, value: any): OpNe; declare function Gt(expression: string | Serializable, value: any): OpGt; declare function Gte(expression: string | Serializable, value: any): OpGte; declare function Lt(expression: string | Serializable, value: any): OpLt; declare function Lte(expression: string | Serializable, value: any): OpLte; declare function Between(expression: string | Serializable, values: any[]): any; declare function Between(expression: string | Serializable, value1: any, value2: any): any; declare function NotBetween(expression: string | Serializable, values: any[]): any; declare function NotBetween(expression: string | Serializable, value1: any, value2: any): any; declare function In(expression: string | Serializable, value: any): OpIn; declare function NotIn(expression: string | Serializable, value: any): OpNotIn; declare function Like(expression: string | Serializable, value: any): OpLike; declare function NotLike(expression: string | Serializable, value: any): OpNotLike; declare function Ilike(expression: string | Serializable, value: any): OpILike; declare function NotILike(expression: string | Serializable, value: any): OpNotILike; declare function Is(expression: string | Serializable, value: any): OpIs; declare function IsNot(expression: string | Serializable, value: any): OpIsNot; declare function Exists(expression: SelectQuery): OpExists; declare function NotExists(expression: SelectQuery): OpNotExists; declare function Not(expression: Serializable): OpNot; declare const op: { and: typeof And; or: typeof Or; eq: typeof Eq; '=': typeof Eq; ne: typeof Ne; '!=': typeof Ne; gt: typeof Gt; '>': typeof Gt; gte: typeof Gte; '>=': typeof Gte; lt: typeof Lt; '<': typeof Lt; lte: typeof Lte; '<=': typeof Lte; between: typeof Between; btw: typeof Between; notBetween: typeof NotBetween; nbtw: typeof NotBetween; '!between': typeof NotBetween; '!btw': typeof NotBetween; in: typeof In; notIn: typeof NotIn; nin: typeof NotIn; '!in': typeof NotIn; like: typeof Like; not: typeof Not; notLike: typeof NotLike; nlike: typeof NotLike; '!like': typeof NotLike; ilike: typeof Ilike; notILike: typeof NotILike; nilike: typeof NotILike; '!ilike': typeof NotILike; is: typeof Is; isNot: typeof IsNot; '!is': typeof IsNot; exists: typeof Exists; notExists: typeof NotExists; '!exists': typeof NotExists; }; export { op }; export { And, Between, Eq, Eq as Equal, Exists, Gte as GreaterAnEqualTo, Gt as GreaterThan, Gt, Gte, Ilike, In, Is, IsNot, Like, Lte as LowerAndEqualTo, Lt as LowerThan, Lt, Lte, Ne, NotILike as Nilike, NotIn as Nin, NotLike as NLike, Not, NotBetween, Ne as NotEqual, NotExists, NotILike, NotIn, NotLike, Or, };