fusion-db
Drizzle schema and Postgres client for the Fusion stack. It ships the reusable
foundation schema (Better Auth's user / session / account / verification, plus a
mailbox, audit log, runtime config and API tokens) together with a server-only Drizzle client.
The package is source-published (Model A): consumers bundle the TypeScript directly.
Install
Published to GitHub Packages under the @tikab-interactive scope, so an .npmrc with a
read:packages token is required:
@tikab-interactive:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${NPM_TOKEN}bun add @tikab-interactive/fusion-db drizzle-orm pgdrizzle-orm and pg are peer dependencies — install them in the consuming app.
Server-only by design
The package exposes two export conditions. Server bundles get the real pg-backed client; browser
bundles resolve to a stub that throws on access — so the pg driver never reaches the client:
Use it from a server function or route loader:
import { db, user } from "@tikab-interactive/fusion-db";
const users = await db.select().from(user);Subpath exports
| Import | Contents |
|---|---|
@tikab-interactive/fusion-db | db client + the full composed schema |
@tikab-interactive/fusion-db/schema | composed schema (foundation + app) |
@tikab-interactive/fusion-db/foundation | foundation tables only |
Next up: the schema and the client.