Wetland is an enterprise grade object-relational mapper (ORM) for node.js.
Note: This module is under active development.
While it's usable and well tested, it's not done yet.
Some key features are still missing.
Features
The following is a list of the biggest features this ORM provides.
For more detailed information, you can look at the tests until the documentation has been written.
- Unit of work
- Transactions
- Entity manager
- Manager scopes
- Cascade persist
- Deep joins
- Repositories
- QueryBuilder
- Mapping
- MetaData
- Entity proxy
- Collection proxy
- Criteria parser
- More...
Installation
To install wetland simply run the following command:
npm i --save wetland
If you're using typescript, the typings are supplied by default. No additional typings have to be installed.
Usage
Usage will be documented soon. To give you an idea, here's an implementation example:
const Wetland = require('wetland').Wetland;
const Foo = require('./entity/foo').Foo;
const Bar = require('./entity/foo').Bar;
const wetland = new Wetland({
stores: {
simple: {
client : 'mysql',
connection: {
user : 'root',
database: 'testdatabase'
}
}
},
entities: [Foo, Bar]
});
let migrator = wetland.getMigrator().create();
migrator.apply().then(() => {});
let manager = wetland.getManager();
let repository = manager.getRepository(Foo);
repository.find({name: 'cake'}, {joins: ['candles', 'baker', 'baker.address']})
.then(results => {
});