1.0.3 ā¢ Published 3 years ago
@vvni/fastify-knex v1.0.3
@vvni/fastify-knex
š¼ Fastify Knex Plugin for supporting many databases (MySQL, PostgreSQL, Maria, Oracle, MSSQL).
Installation
npm install @vvni/fastify-knex --save
Usage
const knex = require("@vvni/fastify-knex");
// KnexJS client DB configuration JSON object.
fastify.register(knex, {
client: "mysql2",
// ... other options
});
fastify.get("/", (request, reply) => {
console.log(fastify.knex); // Knex DB instance
});
License
MIT