Through wetland we are able to connect with the database, register entities and access methods that belong to different classes throughout the ORM. Here we are going to describe all of its methods and how to use them.

let wetland = new Wetland();


This method destroys all active connections, returning a Promise.



Gets the wetland config.



This method gets a scoped entity manager.



This method returns an instance of migrator, that you can use to create and run your database migrations.



Gets a store by name. If no name is given, this method will return the default store.



This method register multiple entities with the entity manager. Using this method is another way to register your entities, if you decide not to register them upon creating a wetland instance.

wetland.registerEntities([entity1, entity2]);


Just like .registerEntities(), but only registering one entity with the entity manager.



This method registers a store with wetland. The first registered store using this method will be set as the default store. The second argument is an object with your store configuration.

wetland.registerStore('myStore', {config: {...}});


Registers multiple stores with wetland. Stores must be passed as a single object.

let stores = {
  store1 : {...},
  store2 : {...}


results matching ""

    No results matching ""