@thebookingkit/db
v0.2.0
Published
Drizzle ORM schema, migrations, and TypeScript types for The Booking Kit's 25 Postgres tables
Downloads
334
Maintainers
Readme
@thebookingkit/db
Drizzle ORM schema and migrations for PostgreSQL-backed booking systems.
Part of The Booking Kit — The Headless Booking Primitive.
Install
npm install @thebookingkit/dbQuick Start
import { createDb } from "@thebookingkit/db";
import { bookings, eventTypes, providers } from "@thebookingkit/db/schema";
const db = createDb(process.env.DATABASE_URL!);
const upcoming = await db.select().from(bookings).where(/* ... */);Key Features
- 23 PostgreSQL tables — Organizations, providers, event types, availability rules, bookings, payments, webhooks, workflows, and more
- Double-booking prevention —
EXCLUDE USING gistconstraint withbtree_gistextension - Full type exports — Inferred select and insert types for every table (
Booking,NewBooking, etc.) - Booking audit trail — Append-only
booking_eventstable tracks every status change - Multi-tenancy ready — Optional
organization_idon all tables - Custom migrations —
runCustomMigrationsfor btree_gist, audit triggers, and GDPR compliance - Multiple entry points —
@thebookingkit/db,@thebookingkit/db/schema,@thebookingkit/db/client
Documentation
License
MIT
