connection- The connection used by
queryRunner- The query runner used by
EntityManager. Used only in transactional instances of EntityManager.
query- Executes a raw SQL query.
hasId- Checks if given entity has its primary column property defined.
getId- Gets given entity's primary column property value. If the entity has composite primary keys then the returned value will be an object with names and values of primary columns.
create- Creates a new instance of
User. Optionally accepts an object literal with user properties which will be written into newly created user object.
merge- Merges multiple entities into a single entity.
save- Saves a given entity or array of entities. If the entity already exists in the database, then it's updated. If the entity does not exist in the database yet, it's inserted. It saves all given entities in a single transaction (in the case of entity manager is not transactional). Also supports partial updating since all undefined properties are skipped. In order to make a value
NULL, you must manually set the property to equal
remove- Removes a given entity or array of entities. It removes all given entities in a single transaction (in the case of entity, manager is not transactional).
insert- Inserts a new entity, or array of entities.
update- Partially updates entity by a given update options or entity id.
upsert- Inserts a new entity or array of entities unless they already exist in which case they are updated instead. Supported by AuroraDataApi, Cockroach, Mysql, Postgres, and Sqlite database drivers.
delete- Deletes entities by entity id, ids or given conditions:
count- Counts entities that match given options. Useful for pagination.
increment- Increments some column by provided value of entities that match given options.
decrement- Decrements some column by provided value that match given options.
find- Finds entities that match given options.
findAndCount- Finds entities that match given find options. Also counts all entities that match given conditions, but ignores pagination settings (from and take options).
findByIds- Finds multiple entities by id.
findOne- Finds the first entity that matches some id or find options.
findOneOrFail- Finds the first entity that matches some id or find options. Rejects the returned promise if nothing matches.
clear- Clears all the data from the given table (truncates/drops it).
release- Releases query runner of an entity manager. Used only when query runner was created and managed manually.