import { QueryCompiler } from "https://deno.land/x/cotton@v0.7.5/src/querycompiler.ts";
Transform QueryDescription to an executable SQL query string
Constructors
new
QueryCompiler(description: QueryDescription, dialect: DatabaseDialect)Properties
private
values: DatabaseValues[]Methods
private
bindValue(value: DatabaseValues | DatabaseValues[]): stringTransform value to a format that the database can understand
private
collectConstraints(): string[]Collect query constraints in the current query
Example result:
["WHERE `users`.`email` = ?", "AND `users`.`age` > 16", "LIMIT 1"]
private
getColumnName(column: string | string[]): stringprivate
getPlaceholder()private
getWhereBindings(keyword: "WHERE" | "HAVING", bindings: WhereBinding[]): stringCompile where bindings from query description to a string.
Example result:
WHERE `users`.`email` = ? AND `users`.`age` >= ?
private
normalizeColumnName(column: string)