Store

To get the store:

let store = wetland.getStore('store');

.getConnection()

Gets a connection for role. Uses round robin. If no argument is passed, uses 'single' as default role.

store.getConnection('master');

.getConnections()

Gets the connection registered on this store.

store.getConnections();

.getName()

Gets the name of the store.

store.getName();

.register()

Registers connections. Connection config is an object and its keys vary according to the type of connection.

store.register({
  client: 'mysql',
  connection: {
    host    : '127.0.0.1',
    user    : 'root'
    database: 'wetland_database'
  }
});

.registerConnection()

Register a connection. Stating role is optional.

store.registerConnection({connection: {...}}, 'slave');

.registerPool()

Registers a pool of connections.

store.registerPool({
  client     : 'mysql',
  connections: [{...}, {...}]
});

.registerReplication()

Registers replication connections.

store.registerReplication({
  client     : 'mysql',
  connections: {
    master: [{...}, {...}],
    slave : [{...}, {...}, {...}]
  }
});

results matching ""

    No results matching ""