0.1.0 • Published 8 years ago

express-database-mysql v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

express-database-mysql

travis package version nodejs version license downloads

MySQL connector for express-dababase.

Usage

const mysql = require('express-database-mysql')
const app = express()
app.use(database({
  db: mysql(/* all options for mysql2 */)
}))
app.get('/api/databases', (req, res, next) => req.database.query('show databases')
  .then(rows => res.json(rows)).catch(next))

API

  • req.database.query(sql, params): Promise - helper for mysql#query method, returns rows array without fields.
  • req.database.connect: Object - raw mysql connection

License

MIT, 2016 (c) Dmitry Tsvettsikh