@bolkauth/driver-mysql2
v0.1.2
Published
MySQL driver helper for BolkAuth wrapping mysql2 and Drizzle ORM
Readme
@bolkauth/driver-mysql2
MySQL driver factory helper for BolkAuth. Connects via mysql2 and returns an initialized Drizzle ORM database instance along with a ready-to-use BolkAuth MySQL adapter.
Installation
pnpm add @bolkauth/driver-mysql2 @bolkauth/adapter-drizzle @bolkauth/core drizzle-orm mysql2Quickstart
import { createMysql2Driver } from "@bolkauth/driver-mysql2";
import { createBolkAuth } from "@bolkauth/core";
// 1. Initialize MySQL connection and BolkAuth adapter in one step
const { connection, db, adapter } = await createMysql2Driver({
connectionString: process.env.DATABASE_URL!,
});
// 2. Initialize BolkAuth engine
export const auth = createBolkAuth({
adapter,
secret: process.env.BOLKAUTH_SECRET!,
});License
MIT © BolkAuth
