Licence
MIT
Version
0.3.1
Deps
2
Size
239 kB
Vulns
0
Weekly
0
@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 (with deposit configuration), availability rules, bookings, payments (prepayments, deposits, no-show holds, cancellation fees), 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