0.8.6 • Published 7 years ago

fastify-rds v0.8.6

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

fastify-rds

mysql client for fastify framework, base ali-rds.

Install

npm install fastify-rds --save

Usage

Example:

const fastify = require('fastify');

fastify.register(require('fastify-rds'), {
  host: 'localhost',
  user: 'me',
  password: 'secret',
  database: 'mydb',
});

fastify.get('/user/:id', async (req, reply) => {
  return await fastify.mysql.get('users', { id: req.params.id });
});

api: ali-rds.

Multiple database instance

const fastify = require('fastify');

fastify.register(require('fastify-rds'), {
  name: 'main',
  host: 'localhost',
  user: 'me',
  passowrd: 'secret',
  database: 'mydb',
});

fastify.get('/user/:id', async (req, reply) => {
  return await fastify.mysql.main.get('users', { id: req.params.id });
});
0.8.6

7 years ago

0.8.4

7 years ago

0.8.2

7 years ago

0.8.1

7 years ago

0.8.0

7 years ago

0.7.6

7 years ago

0.7.5

7 years ago

0.7.0

7 years ago

0.6.0

7 years ago

0.5.0

7 years ago