Database driver used by this connection.
All entity metadatas that are registered for this connection.
Indicates if connection is initialized or not.
Logger used to log orm events.
EntityManager of this connection.
Migration instances that are registered for this connection.
Connection name.
Naming strategy used in the connection.
Connection options.
Used to work with query result cache.
Used to load relation ids of specific entity relations.
Used to load relations and work with lazy relations.
Entity subscriber instances that are registered for this connection.
Gets the mongodb entity manager that allows to perform mongodb-specific repository operations with any entity in this connection.
Available only in mongodb connections.
Gets a sql.js specific Entity Manager that allows to perform special load and save operations
Available only in connection with the sqljs driver.
Builds metadatas for all registered classes inside this connection.
Closes connection with the database. Once connection is closed, you cannot use repositories or perform any operations except opening connection again.
Performs connection to the database. This method should be called once on application bootstrap. This method not necessarily creates database connection (depend on database type), but it also can setup a connection pool with database to use.
Creates an Entity Manager for the current connection with the help of the EntityManagerFactory.
Creates a new query builder that can be used to build a sql query.
Creates a new query builder that can be used to build a sql query.
Creates a query runner used for perform queries on a single database connection. Using query runners you can control your queries to execute using single database connection and manually control your database transaction.
Mode is used in replication mode and indicates whatever you want to connect to master database or any of slave databases. If you perform writes you must use master database, if you perform reads you can use slave databases.
Drops the database and all its data. Be careful with this method on production since this method will erase all your database tables and their data. Can be used only after connection to the database is established.
Finds exist entity metadata by the given entity class, target name or table name.
Gets custom entity repository marked with @EntityRepository decorator.
Gets entity metadata of the junction table (many-to-many table).
Gets entity metadata for the given entity class or schema name.
Gets mongodb-specific repository for the given entity class or name. Works only if connection is mongodb-specific.
Gets repository for the given entity.
Gets tree repository for the given entity class or name. Only tree-type entities can have a TreeRepository, like ones decorated with @Tree decorator.
Checks if entity metadata exist for the given entity class, target name or table name.
Executes raw SQL query and returns raw database results.
Runs all pending migrations. Can be used only after connection to the database is established.
Creates database schema for all entities registered in this connection. Can be used only after connection to the database is established.
If set to true then it drops the database with all its tables and data
Wraps given function execution (and all operations made there) into a transaction. All database operations must be executed using provided entity manager.
Reverts last executed migration. Can be used only after connection to the database is established.
Generated using TypeDoc
Connection is a single database ORM connection to a specific database. Its not required to be a database connection, depend on database type it can create connection pool. You can have multiple connections to multiple databases in your application.