import { QueryBuilder } from "https://deno.land/x/cotton@v0.7.5/src/querybuilder.ts";
Allows to build complex SQL queries and execute those queries.
Constructors
Properties
Methods
Count records with given conditions
Count records with unique values
Delete record from the database.
Force the query to return distinct (unique) results.
Execute query and get the result
Get the first record of the query, shortcut for limit(1)
SQL FULL OUTER JOIN
Group records by a column
Add SQL HAVING clause to query
Add SQL HAVING clause to query with custom query expression.
SQL INNER JOIN
Insert a record to the table
SQL LEFT OUTER JOIN
Set the "limit" value for the query.
Add WHERE NOT clause to query
Add WHERE NOT clause to query with custom query expression.
Set the "offset" value for the query.
Add WHERE ... OR clause to query
Add WHERE ... OR clause to query with custom query expression.
Add an "order by" clause to the query.
Perform REPLACE
query to the table.
It will look for PRIMARY
and UNIQUE
constraints.
If something matched, it gets removed from the table
and creates a new row with the given values.
Sets the returning value for the query.
SQL RIGHT OUTER JOIN
Select table columns
Get the actual SQL query string. All the data are replaced by a placeholder. So, you need to also bind the values in order to execute the query.
Update record on the database
Add basic WHERE clause to query
Add basic WHERE clause to query with custom query expression.