Constructors
constructor
- new QueryBuilder(options): QueryBuilder
Parameters
- options: QueryBuilderOptions
Methods
select
- select(columns): this
Returns this
where
- where(condition): this
Returns this
andWhere
- andWhere(condition): this
Returns this
orWhere
- orWhere(condition): this
Returns this
orderBy
- orderBy(orderBy): this
Returns this
limit
- limit(count): this
Returns this
offset
- offset(count): this
Returns this
join
- join(table, alias, on): this
Parameters
- table: string
- alias: string
- on: string
Returns this
leftJoin
- leftJoin(table, alias, on): this
Parameters
- table: string
- alias: string
- on: string
Returns this
rightJoin
- rightJoin(table, alias, on): this
Parameters
- table: string
- alias: string
- on: string
Returns this
fullJoin
- fullJoin(table, alias, on): this
Parameters
- table: string
- alias: string
- on: string
Returns this
groupBy
- groupBy(columns): this
Returns this
having
- having(condition): this
Returns this
insert
- insert(values): this
Parameters
- values: Record<string, any>
Returns this
update
- update(set): this
Returns this
delete
- delete(): this
Returns this
build
- build(): {
sql: string;
parameters: any[];
} Returns {
sql: string;
parameters: any[];
}
sql: string
parameters: any[]
Add SELECT columns