Skip to content

Feat/env db provider#347

Open
AugistineCreates wants to merge 6 commits into
ChainForgee:mainfrom
AugistineCreates:feat/env-db-provider
Open

Feat/env db provider#347
AugistineCreates wants to merge 6 commits into
ChainForgee:mainfrom
AugistineCreates:feat/env-db-provider

Conversation

@AugistineCreates

@AugistineCreates AugistineCreates commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Closes #251

This PR moves the Prisma database provider selection to an environment-driven switcher. This allows switching between SQLite and PostgreSQL dynamically without modifying schema.prisma.

Summary of Changes

  • Prisma Configuration Update:
    • Updated schema.prisma to use provider = env("DATABASE_PROVIDER") and shadowDatabaseUrl = env("SHADOW_DATABASE_URL").
    • Configured prisma.config.ts to dynamically intercept schema compilation and output a resolved, runtime-specific schema (schema.generated.prisma) corresponding to the configured DATABASE_PROVIDER.
  • Environment Templates: Added default configurations and instructions for PostgreSQL and SQLite in .env.example.
  • CI Matrix Integration: Added a matrix test execution to .github/workflows/backend-ci.yml that provisions a PostgreSQL service container and runs schema/migration checks on both sqlite and postgresql environments.
  • Documentation: Authored docs/db/providers.md to guide developers on configuring connection strings, handling shadow databases, and running migrations for specific engines.

Copy link
Copy Markdown
Contributor

Hi 👋 Appreciate this PR! The CI is flagging a failing check — could you take a peek at the failed job and push a fix? Happy to help if you need a hand 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move Prisma datasource choice to env-driven PG / SQLite switch

2 participants