A collection of Prisma extensions and adapters — typed, composable, driver-agnostic. Built for Bun, works anywhere.
| Package | Description |
|---|---|
@stratapkg/adapter-bun |
Prisma adapter for Bun.sql and bun:sqlite |
@stratapkg/spatial |
PostGIS — typed spatial queries, WKB↔GeoJSON, CTE-based geo filters |
@stratapkg/cache |
Transparent query cache with auto-invalidation |
@stratapkg/blob |
S3-compatible file storage — upload, signed URLs, auto-delete |
@stratapkg/chronicle |
Audit log — before/after snapshots, actor metadata, queryable history |
All extensions compose via $extends:
import { PrismaClient } from './generated/client'
import { PrismaBunAdapter } from '@stratapkg/adapter-bun'
import { withSpatial } from '@stratapkg/spatial'
import { withCache } from '@stratapkg/cache'
import { withBlob } from '@stratapkg/blob'
import { withChronicle } from '@stratapkg/chronicle'
const prisma = new PrismaClient({ adapter: new PrismaBunAdapter(sql) })
.$extends(withSpatial(spatialConfig))
.$extends(withCache({ driver: redisDriver, ttl: { '*': 30 } }))
.$extends(withBlob({ driver: s3Driver, models: { User: { avatar: { prefix: 'avatars' } } } }))
.$extends(withChronicle({ driver: sqliteDriver, models: ['User', 'Order'] }))Driver-agnostic — each extension accepts a driver interface. Bun drivers are first-class, Node.js drivers available as subpath imports:
import { BunRedisDriver } from '@stratapkg/cache/bun'
import { IoredisDriver } from '@stratapkg/cache/ioredis'
import { MemoryDriver } from '@stratapkg/cache/memory'Zero mandatory dependencies — install only what you use. Drivers are peer dependencies.
Prisma 7+ native — built around the new adapter API and $extends query extensions.
- Bun >= 1.1 (for Bun-specific drivers)
- Prisma >= 7.0
MIT