Add database schema and Kysely packages
- Create initial database migration with full auth schema: - users, sessions, passkeys, devices tables - orgs, org_members, org_sites, org_invites tables - email_verifications, password_resets, login_requests tables - Indexes for common lookups and cleanup jobs - Add @reviq/db-schema package with kysely-codegen - Add @reviq/db package with Kysely client Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
26
packages/db/src/index.ts
Normal file
26
packages/db/src/index.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Database client for RevIQ Publisher Dashboard
|
||||
*
|
||||
* @module @reviq/db
|
||||
*/
|
||||
|
||||
import type { Kysely } from "kysely";
|
||||
import type { Database } from "@reviq/db-schema";
|
||||
import { createDb } from "./client.js";
|
||||
|
||||
/**
|
||||
* Default database instance
|
||||
*
|
||||
* Uses DATABASE_URL environment variable for connection
|
||||
*/
|
||||
export const db: Kysely<Database> = createDb();
|
||||
|
||||
/**
|
||||
* Export createDb for creating custom database instances
|
||||
*/
|
||||
export { createDb } from "./client.js";
|
||||
|
||||
/**
|
||||
* Re-export database types from db-schema
|
||||
*/
|
||||
export type { Database } from "@reviq/db-schema";
|
||||
Reference in New Issue
Block a user