1.0.8 • Published 2 years ago

@w72/fastify-knex v1.0.8

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

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago