Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

machinepack-waterline

0.1.1 • Public • Published

node-machine logo machinepack-waterline

node-machine logo machinepack-waterline

Warning

Currently, this is experimental. See the Waterline driver interface for more information.

Example

Using .find()
Waterline.find({
  model: 'users',
  where: {
    age: { '>': 50 },
    preferredNumRazorBlades: { '>=': 3 }
  }
}).setEnvironment({ sails: sails })
.exec(function (err){
  // ...
});
Using .query()
Waterline.query({
  datastore: 'ricksMySQLDb',
  statement: {}
}).setEnvironment({ sails: sails })
.exec(function (err){
  // ...
});
Using .connect()
Waterline.connect({
  datastore: 'ricksMySQLDb',
  during: function (connection, done) {
    Waterline.find({
      model: 'user',
      connection: connection
    })
    .setEnvironment({ sails: sails })
    .exec(done)
  }
}).setEnvironment({ sails: sails })
.exec(function (err){
  // ...
});
Using .transaction()
Waterline.transaction({
  datastore: 'ricksMySQLDb',
  during: function (connection, done) {
    Waterline.find({
      model: 'user',
      connection: connection
    })
    .setEnvironment({ sails: sails })
    .exec(done)
  }
}).setEnvironment({ sails: sails })
.exec(function (err){
  // ...
});

License

MIT © 2016 contributors

install

npm i machinepack-waterline

Downloadsweekly downloads

3

version

0.1.1

license

MIT

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability