Database Adapters
Connect Himayah to your existing database schema using official adapters for Drizzle ORM, Prisma, and Kysely.
Database Adapters
Himayah is completely database-agnostic. It never manages migrations or owns your schema. Instead, you define your tables and provide them to a thin adapter that maps them to Himayah's internal interface.
The adapter interface HimayahAdapter is a plain TypeScript type. You can write a custom adapter for any database — MongoDB, Supabase, DynamoDB, EdgeDB — as long as you implement the required methods.
Drizzle ORM
Package: @himayah/adapter-drizzle
Works with any Drizzle-supported database: PostgreSQL, MySQL, SQLite (including libSQL / Turso).
Installation
Setup
Option A: Programmatic Schemas (Recommended)
Instead of writing 150+ lines of database schemas manually, you can use Himayah's dialect-specific programmatic schema builders to dynamically generate your tables in one line.
Option B: Manual Schemas
If you need full customization over column types, names, or indexing structures, map your manual schema tables directly to the drizzleAdapter:
Manual Schema Reference
Prisma
Package: @himayah/adapter-prisma
Works with any Prisma-supported database. Model names are configurable if your schema uses different naming.
Installation
Setup
Prisma Schema
Kysely
Package: @himayah/adapter-kysely
Full type-safe query builder support. Pass your Kysely instance and optionally override table names.
Installation
Setup
Kysely Database Type
Writing a Custom Adapter
If none of the official adapters work for your database, implement the HimayahAdapter interface directly:
