1.0.8 • Published 3 years ago

@w72/fastify-knex v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

fastify-knex

npm.io npm.io npm.io npm.io npm.io npm.io npm.io

Install

npm i @w72/fastify-knex knex

Usage

import fastify from "fastify";
import fastifyKnex from "@w72/fastify-knex";

const app = fastify({ logger: true });

app.register(fastifyKnex, {
  client: "sqlite3",
  useNullAsDefault: true,
  connection: { filename: ":memory:" },
});

app.get("/", async () => {
  const res = await app.knex.first(app.knex.raw("sqlite_version() as ver"));
  app.log.info("sqlite version: %s", res.ver);
  return { "sqlite version": res.ver };
});

app.listen();

License

Licensed under MIT.

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago