You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: support structured database connection config as alternative to URL (#39)
Add discrete connection fields (host, port, user, password, name, options)
as an alternative to url/url_env. Connections are built using driver-native
APIs (PostgreSQL key-value DSN, MySQL OptsBuilder), bypassing URL parsing
so passwords with special characters work without encoding.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
12
12
-`urlencode` template filter for percent-encoding strings in URLs. Useful for embedding passwords or other values containing URL-reserved characters (`@`, `%`, `:`, `/`, etc.) in connection strings.
13
13
-`dprint` formatter for Markdown, JSON, TOML, YAML, and Dockerfile with CI check (`dprint/check@v2.2`) and definition-of-done gate.
14
+
- Structured database connection config as an alternative to URL (`host`, `port`, `user`, `password`, `name`, `options` fields). Passwords with URL-reserved characters (`@`, `%`, `:`, etc.) work without encoding. Connections are built using driver-native APIs (PostgreSQL key-value DSN, MySQL `OptsBuilder`), bypassing URL parsing entirely. The `url`/`url_env` fields remain supported for backward compatibility. See [#39](https://github.com/KitStream/initium/issues/39).
Copy file name to clipboardExpand all lines: docs/seeding.md
+62-8Lines changed: 62 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,11 +29,54 @@ initium seed --spec /seeds/seed.yaml --json
29
29
30
30
The seed spec file defines the complete seeding plan. Both YAML and JSON formats are supported (file extension determines parser). The spec file is a MiniJinja template rendered with environment variables before parsing.
31
31
32
+
### Database connection
33
+
34
+
Two connection styles are supported. Choose **one** — they cannot be combined.
Structured config builds the connection using driver-native APIs, bypassing URL parsing entirely. Passwords with `@`, `%`, `:`, or other URL-reserved characters work without encoding.
60
+
61
+
> **Note:** Structured config is not supported for SQLite — use `url` instead.
62
+
63
+
### Full schema
64
+
32
65
```yaml
33
66
database:
34
67
driver: postgres # Required. One of: postgres, mysql, sqlite
68
+
# --- URL-based connection (pick one style) ---
35
69
url: "postgres://..." # Direct database URL
36
70
url_env: DATABASE_URL # Or: name of env var containing the URL
71
+
# --- Structured connection (alternative to url/url_env) ---
0 commit comments