1.0.8 • Published 11 months ago

@w72/fastify-knex v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months 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

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago