QueryBuilder can be initialized from given Connection and QueryRunner objects or from given other QueryBuilder.
QueryBuilder can be initialized from given Connection and QueryRunner objects or from given other QueryBuilder.
Connection on which QueryBuilder was created.
Contains all properties of the QueryBuilder that needs to be build a final query.
Query runner used to execute query builder query.
Gets the main alias string used in this query builder.
Adds (binds) given value to entity relation. Value can be entity, entity id or entity id map (if entity has composite ids). Value also can be array of entities, array of entity ids or array of entity id maps (if entity has composite ids). Works only for many-to-many and one-to-many relations. For many-to-one and one-to-one use #set method instead.
Adds (binds) and removes (unbinds) given values to/from entity relation. Value can be entity, entity id or entity id map (if entity has composite ids). Value also can be array of entities, array of entity ids or array of entity id maps (if entity has composite ids). Works only for many-to-many and one-to-many relations. For many-to-one and one-to-one use #set method instead.
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.
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.
Creates a completely new query builder. Uses same query runner as current QueryBuilder.
Creates "RETURNING" / "OUTPUT" expression.
Creates "WHERE" expression.
Concatenates all added where expressions into one string.
Creates "WHERE" expression and variables for the given "ids".
Creates DELETE query.
Disables escaping.
Escapes table name, column name or alias name using current database's escaping character.
Executes sql generated by query builder and returns raw database results.
Gets name of the table where insert should be performed.
Gets all parameters.
Gets generated sql query without parameters being replaced.
Gets query to be executed with all parameters used in it.
If returning / output cause is set to array of column names, then this method will return all column metadatas of those column names.
Gets generated sql that will be executed. Parameters in the query are escaped for the currently used driver.
Gets escaped table name with schema name if SqlServer driver used with custom schema name, otherwise returns escaped table name.
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?
Creates INSERT query.
Loads many entities (relational) from the relation. You can also provide ids of relational entities to filter by.
Loads a single entity (relational) from the relation. You can also provide id of relational entity to filter by.
Creates a query builder used to execute sql queries inside this query builder.
Sets entity (target) which relations will be updated.
Prints sql to stdout using console.log.
Sets entity's relation with which this query builder gonna work.
Sets entity's relation with which this query builder gonna work.
Removes (unbinds) given value from entity relation. Value can be entity, entity id or entity id map (if entity has composite ids). Value also can be array of entities, array of entity ids or array of entity id maps (if entity has composite ids). Works only for many-to-many and one-to-many relations. For many-to-one and one-to-one use #set method instead.
Replaces all entity's propertyName to name in the given statement.
Creates SELECT query. Replaces all previous selections if they exist.
Creates SELECT query and selects given data. Replaces all previous selections if they exist.
Creates SELECT query and selects given data. Replaces all previous selections if they exist.
Sets entity relation's value. Value can be entity, entity id or entity id map (if entity has composite ids). Works only for many-to-one and one-to-one relations. For many-to-many and one-to-many relations use #add and #remove methods instead.
Adds native parameters from the given object.
Sets parameter name and its value.
Adds all parameters from the given object.
Sets or overrides query builder's QueryRunner.
Creates UPDATE query and applies given update values.
Creates UPDATE query 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.
Creates UPDATE query for the given entity and applies given update values.
Creates UPDATE query for the given table name and applies given update values.
If set to true the query will be wrapped into a transaction.
Generated using TypeDoc
Allows to work with entity relations and perform specific operations with those relations.
todo: add transactions everywhere