TypeORM

TypeORM - data-mapper ORM for TypeScript and JavaScript (ES7, ES6, ES5). Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, WebSQL databases. Works in Node.JS and Browser.

Using service container

In TypeORM you can use service container. Service container allows to inject custom services in some places, like in subscribers or custom naming strategies. Or for example, you can get access to ConnectionManager from any place using service container.

Here is example how you can setup typedi service container with TypeORM. But note, that you can setup any service container with TypeORM.


import {createConnection, ConnectionOptions} from "typeorm";
import {Container} from "typedi";

// its important to setup container before you start to work with TypeORM
useContainer(Container);
createConnection({/* ... */);
        
Fork me on GitHub