# @reviq/db Database client and helper functions for the RevIQ platform. ## Usage ```typescript import { createDb } from "@reviq/db"; const db = createDb(process.env.DATABASE_URL); // Use db with Kysely queries const users = await db.selectFrom("users").selectAll().execute(); // Clean up when done await db.destroy(); ``` ## Exports ### Client - `createDb(url)` - Create a Kysely database instance ### Helper Functions - `executeBootstrap(trx, input)` - Bootstrap a new database with superuser and org - `generateToken()` - Generate an API token - `hashToken(token)` - Hash a token for storage - `parseToken(token)` - Parse and validate a token - `TOKEN_PREFIX` - The `reviq_` prefix for API tokens ### Types - `Database` - Re-exported from `@reviq/db-schema` - `BootstrapInput` / `BootstrapResult` - Types for bootstrap operation