npm.io
0.12.4 • Published 9 years ago

sails-postgresql-prepquery

Licence
MIT
Version
0.12.4
Deps
6
Vulns
6
Weekly
0
Stars
1

PostgreSQL Sails/Waterline Adapter with PrepQuery

sails-postgresql v0.12.2 with prepQuery

prepQuery is used for performance optimization. x2 faster then raw query. millions times faster then sails adapter. Doh.... For personal usage.

example,

      User.prepQuery({
        text: `select * from users where id = $1`,
        type: ['int'],
        values: [clientSession.uid]
      },
      (err, result) => {
        if (err) {return cb(err)}
        if (!result.rowCount) {return cb(null, [])}
        return cb(null, result.rows)
      })

Install

Install is through NPM.

$ npm install sails-postgresql-prepquery

Credits

To learn more visit the project on GitHub at sails-postgresql.

Keywords