Skip to content

Commit 2c22e16

Browse files
committed
feat: Implement database configuration and migration support
- Updated `.env.example` and `purwa.toml.example` to include database URL configuration options. - Enhanced `AppConfig` to manage database connection URLs and added a new `DatabaseSection`. - Integrated SQLx for database operations, including migration functionalities in `purwa-orm`. - Expanded CLI commands in `empu` for managing database migrations. - Updated `README.md` to document new database configuration and integration test setup. - Refined `Cargo.toml` files to include necessary dependencies for SQLx and testcontainers.
1 parent 2814a89 commit 2c22e16

22 files changed

Lines changed: 3520 additions & 461 deletions

.env.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,10 @@
66

77
# Example: override app display name (maps to `[app].name`)
88
# PURWA_APP__NAME=my-app
9+
10+
# Database (Sprint 4): prefer `[database].url` in purwa.toml, or either of:
11+
# PURWA_DATABASE__URL=postgres://postgres:postgres@127.0.0.1:5432/myapp
12+
# DATABASE_URL=postgres://postgres:postgres@127.0.0.1:5432/myapp
13+
14+
# Integration tests with a real Postgres (optional if using testcontainers in CI):
15+
# TEST_DATABASE_URL=postgres://postgres:postgres@127.0.0.1:5432/purwa_test

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ jobs:
2828
- name: Clippy
2929
run: cargo clippy --workspace -- -D warnings
3030

31+
# `purwa-orm` integration tests use testcontainers (Docker on the runner).
3132
- name: Test
3233
run: cargo test --workspace

0 commit comments

Comments
 (0)