import { Filter, OrderBy } from './database'; import { Model, Field, SimpleField, Document } from 'sqlex'; import { DialectEncoder } from './engine'; export interface AliasEntry { name: string; model: Model; } export interface SelectQuery { fields: string; tables: string; where?: string; orderBy?: string; } export declare class Context { private counter; aliasMap: { [key: string]: AliasEntry; }; constructor(); getAlias(builder: QueryBuilder): string; } export declare class QueryBuilder { model: Model; field?: Field; parent?: QueryBuilder; dialect: DialectEncoder; context?: Context; alias?: string; froms?: string[]; fieldMap: {}; getFroms(): string[]; constructor(model: Model | QueryBuilder, dialect: DialectEncoder | Field); where(args: Filter): string; private or; private and; private expr; _extendFilter(filter: Filter, orderBy: OrderBy): Filter; _pushField(fields: string[], path: string): string; _select(name: string | SimpleField | Document, filter?: Filter, orderBy?: OrderBy): SelectQuery; select(name: string | SimpleField | Document, filter?: Filter, orderBy?: OrderBy, filterThunk?: (QueryBuilder: any) => string): string; column(): string; encodeField(name: string | SimpleField): string; private _join; private _in; private exists; private escape; private escapeId; } export declare function encodeFilter(args: Filter, model: Model, escape: DialectEncoder): string; export declare const AND = "and"; export declare const OR = "or"; export declare const NOT = "not"; export declare const LT = "lt"; export declare const LE = "le"; export declare const GE = "ge"; export declare const GT = "gt"; export declare const NE = "ne"; export declare const IN = "in"; export declare const LIKE = "like"; export declare const NULL = "null"; export declare const SOME = "some"; export declare const NONE = "none"; export declare function splitKey(arg: string): string[]; export declare function plainify(value: any): any;