@xemahq/biome-database-sdk
v0.1.1
Published
Shared utilities for biome API services: database URL construction, migration discovery (Prisma/Flyway/Drizzle), org-managed database attachment, Prisma client factory, and migration runner. Eliminates code duplication across biomes.
Readme
@xemahq/biome-database-sdk
Database setup and migration helpers for biome services
Overview
Shared database plumbing for biome API services so each biome does not re-implement it. It builds database URLs, discovers migrations across Prisma, Flyway, and Drizzle layouts, attaches org-managed databases, creates a Prisma client, and runs migrations. It supports single- and multi-database setups behind one consistent surface, and fails fast on incomplete configuration rather than falling back silently.
When to use it
- Use it inside a biome API service that needs database URL construction, migration discovery and running, or org-managed database attachment.
Installation
pnpm add @xemahq/biome-database-sdkUsage
import { ensureDatabaseUrls } from '@xemahq/biome-database-sdk';
// Before bootstrapping the app, build connection URLs from config:
ensureDatabaseUrls({ singleDatabase: true });Peer requirements
- NestJS (
@nestjs/common,@nestjs/core) for the org-managed database module. @prisma/clientfor the Prisma client factory and migration runner.
License
Apache-2.0 © Xema — xema.dev
