import { QueryBuilder } from "https://deno.land/x/typeorm@v0.2.23-rc10/src/index.ts";
Allows to build complex sql queries in a fashion way and execute those queries.
Constructors
QueryBuilder can be initialized from given Connection and QueryRunner objects or from given other QueryBuilder.
Methods
Computes given where argument - transforms to a where string all forms it can take.
Specifies FROM which entity's table select/update/delete will be executed. Also sets a main string alias of the selection data.
Concatenates all added where expressions into one string.
Creates "WHERE" expression and variables for the given "ids".
If returning / output cause is set to array of column names, then this method will return all column metadatas of those column names.
Gets escaped table name with schema name if SqlServer driver used with custom schema name, otherwise returns escaped table name.
Creates a query builder used to execute sql queries inside this query builder.
Replaces all entity's propertyName to name in the given statement.
Indicates if listeners and subscribers must be called before and after query execution. Enabled by default.
Clones query builder as it is. Note: it uses new query runner, if you want query builder that uses exactly same query runner, you can create query builder using its constructor, for example new SelectQueryBuilder(queryBuilder) where queryBuilder is cloned QueryBuilder.
Creates a completely new query builder. Uses same query runner as current QueryBuilder.
Escapes table name, column name or alias name using current database's escaping character.
Gets generated sql that will be executed. Parameters in the query are escaped for the currently used driver.
Checks if given relation exists in the entity. Returns true if relation exists, false otherwise.
todo: move this method to manager? or create a shortcut?
Checks if given relations exist in the entity. Returns true if relation exists, false otherwise.
todo: move this method to manager? or create a shortcut?
Sets entity's relation with which this query builder gonna work.
Creates UPDATE query for the given entity and applies given update values.
Creates UPDATE query for the given entity and applies given update values.
Creates UPDATE query for the given entity and applies given update values.