Files
metabuilder/dbal
rmac 8bcc85a470 Implement DBAL Phase 1: Move database ownership from Next.js to DBAL
DBAL Improvements:
- Move Prisma schema to DBAL ownership (dbal/development/prisma/schema.prisma)
- Create Prisma client factory (getPrismaClient, createPrismaClient)
- Create DBAL client factory (getDBALClient, useDBAL)
- Set up seed orchestration structure to load from /seed/ folder
- Add db scripts to DBAL package.json (db:generate, db:push, db:studio)
- Export all factories and seedDatabase from DBAL

Architecture Documentation:
- Create ARCHITECTURE.md: Complete blueprint and data flow explanation
- Update CLAUDE.md: Clear guidance to avoid common bot errors
- Clarify /schemas folder as source of truth for architecture
- Emphasize seed data in /seed/, not in TypeScript code
- Show correct patterns: getDBALClient(), entity operations

Status:
- Phase 1 (DBAL Improvements): COMPLETE
- Phase 2 (Next.js Cleanup): PENDING
- Phase 3 (Build System): PENDING

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-01-14 18:38:16 +00:00
..

DBAL - Database Abstraction Layer

A language-agnostic database abstraction layer that provides a secure interface between client applications and database backends.

Structure

dbal/
├── development/     # TypeScript implementation (fast iteration)
├── production/      # C++ implementation (security & performance)
├── shared/          # Shared resources (API specs, tools, etc.)
└── docs/            # Documentation

Development

TypeScript (Development)

cd development
npm install
npm run build
npm test

C++ (Production)

cd production
# See production/docs/ for C++ build instructions

Shared Resources

  • API Schemas: shared/api/schema/
  • Tools: shared/tools/ (codegen, build assistant)
  • Scripts: shared/scripts/ (build, test)

License

MIT - See LICENSE file.