Skip to content

feat(CC-ERATE-000056): add Postgres as configurable database provider (Phase 1)#49

Open
steven-dracker wants to merge 1 commit intomainfrom
feature/postgres-local-connectivity
Open

feat(CC-ERATE-000056): add Postgres as configurable database provider (Phase 1)#49
steven-dracker wants to merge 1 commit intomainfrom
feature/postgres-local-connectivity

Conversation

@steven-dracker
Copy link
Copy Markdown
Owner

Summary

  • Adds Npgsql.EntityFrameworkCore.PostgreSQL 8.0.11 package to ErateWorkbench.Api
  • Introduces DatabaseProvider config key ("Sqlite" | "Postgres") in appsettings.json
  • Startup branches: SQLite → Migrate() (unchanged); Postgres → EnsureCreated() (bypasses SQLite-specific PRAGMA migrations)
  • Provider name logged at startup via ILogger<AppDbContext>
  • Default remains "Sqlite" — zero behaviour change for existing deployments

Test plan

  • Build passes with 0 errors (verified locally)
  • App starts on default SQLite path (DatabaseProvider not set → falls back to Sqlite)
  • GET /health returns {"status":"ok"} on SQLite path
  • To test Postgres: set DatabaseProvider=Postgres and confirm startup log shows Database provider: Postgres

🤖 Generated with Claude Code

Introduces DatabaseProvider config key ("Sqlite" | "Postgres") alongside
Npgsql.EntityFrameworkCore.PostgreSQL 8.0.11. Startup branches on provider:
SQLite continues to use Migrate(); Postgres uses EnsureCreated() to bypass
SQLite-specific PRAGMA migrations. Provider name is logged at startup.
Default remains SQLite — no behaviour change unless DatabaseProvider=Postgres.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant