hm

hapi-mysql

Dead-simple MySQL plugin for Hapi

Showing:

Popularity

Downloads/wk

7

GitHub Stars

15

Maintenance

Last Commit

6yrs ago

Contributors

4

Package

Dependencies

1

Size (min+gzip)

90.5KB

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

hapi-mysql

Usage

Register plugin:

var server = Hapi.createServer('0.0.0.0', 8000);
server.pack.require('hapi-mysql', Config.db, function(err) {
  if (err) {
    console.error(err);
    throw err;
  }
});

Use plugin:

request.server.plugins['hapi-mysql'].pool.getConnection(function(err, connection) {

  // Use the connection
  connection.query(
    'SELECT 1 FROM mytable',
    function(err, rows) {

      if(err) {
        throw new Error(err)
      }
    }
  )

  // And done with the connection.
  connection.release();
})

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial