Build the SQL query string.
The complete SQL query string
Build query with parameter placeholders for prepared statements.
Object containing SQL with placeholders and parameter values
Create a copy of this query builder.
Specify columns for INSERT.
Start a DELETE statement.
Table to delete from
Select distinct rows only.
Specify the table to query from.
Table name
Optionalalias: stringOptional table alias
Add GROUP BY columns.
Add a HAVING condition.
Add an INNER JOIN clause.
Optionalalias: stringStart an INSERT statement.
Table to insert into
Add a JOIN clause.
Join type (INNER, LEFT, RIGHT, FULL, CROSS)
Table to join
Join condition
Optionalalias: stringOptional table alias
Add a LEFT JOIN clause.
Optionalalias: stringSet the maximum number of rows to return.
Set the number of rows to skip.
Add ORDER BY clause.
Column to order by
Sort direction (ASC or DESC)
Optionalnulls: "FIRST" | "LAST"NULLS FIRST or NULLS LAST
Add an OR WHERE condition.
Reset the builder to initial state.
Add a RIGHT JOIN clause.
Optionalalias: stringSpecify columns to select.
Column names or column specs with aliases
this for chaining
Set a column value for UPDATE.
Column to update
New value
Set multiple column values for UPDATE.
Object mapping column names to values
Start an UPDATE statement.
Table to update
Add values to INSERT. Can be called multiple times for multi-row inserts.
Values corresponding to columns
Add a WHERE condition.
Column name
Comparison operator
Value to compare against
Add a WHERE IS NOT NULL condition.
Add a WHERE IS NULL condition.
Fluent SQL query builder.
Supports SELECT, INSERT, UPDATE, and DELETE operations with a chainable API.
Example: SELECT query
Example: INSERT query
Example: UPDATE query
Example: DELETE query