import { QueryBuilder } from "https://deno.land/x/cotton@v0.7.1/mod.ts";
Allows to build complex SQL queries and execute those queries.
Methods
having(column: string, expression: QueryExpression): QueryBuilder
Add SQL HAVING clause to query with custom query expression.
not(column: string, expression: QueryExpression): QueryBuilder
Add WHERE NOT clause to query with custom query expression.
or(column: string, expression: QueryExpression): QueryBuilder
Add WHERE ... OR clause to query with custom query expression.
order(column: string, direction?: OrderDirection): QueryBuilder
Add an "order by" clause to the query.
replace(data: QueryValues): QueryBuilder
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.
toSQL()
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.
where(column: string, expression: QueryExpression): QueryBuilder
Add basic WHERE clause to query with custom query expression.