0.8.6 • Published 6 years ago

fastify-rds v0.8.6

Weekly downloads
-
License
MIT
Repository
-
Last release
6 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

6 years ago

0.8.4

6 years ago

0.8.2

6 years ago

0.8.1

6 years ago

0.8.0

6 years ago

0.7.6

6 years ago

0.7.5

6 years ago

0.7.0

6 years ago

0.6.0

6 years ago

0.5.0

6 years ago