@bolkauth/driver-pg
v0.1.2
Published
PostgreSQL driver helper for BolkAuth wrapping pg Pool and Drizzle ORM
Readme
@bolkauth/driver-pg
PostgreSQL driver factory helper for BolkAuth. Connects via pg.Pool and returns an initialized Drizzle ORM database instance along with a ready-to-use BolkAuth adapter.
Installation
pnpm add @bolkauth/driver-pg @bolkauth/adapter-drizzle @bolkauth/core drizzle-orm pg
pnpm add -D @types/pgQuickstart
import { createPgDriver } from "@bolkauth/driver-pg";
import { createBolkAuth } from "@bolkauth/core";
// 1. Initialize PostgreSQL pool and BolkAuth adapter in one step
const { pool, db, adapter } = createPgDriver({
connectionString: process.env.DATABASE_URL!,
max: 10,
idleTimeoutMillis: 30000,
});
// 2. Initialize BolkAuth engine
export const auth = createBolkAuth({
adapter,
secret: process.env.BOLKAUTH_SECRET!,
});License
MIT © BolkAuth
