An adapter for panva/node-oidc-provider.
General usage with a knex file:
const knex = require("knex");
const config = require("./knexfile");
const { knexAdapter } = require(".");
const client = knex(config[process.env.NODE_ENV ?? "development"]);
const config = {
/* ... */
adapter: knexAdapter(client),
};
Or, if you don't care reusing the knex
client:
const { knexAdapter } = require(".");
const config = {
/* ... */
adapter: knexAdapter({ client: "pg" }),
};
The default adapter with a default postgres connexion can also be used:
const config = {
/* ... */
adapter: require("."),
};