Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #28 by clarifying documentation on spawn_database and simultaneously renaming the database/DatabaseConfig concept to target/TargetConfig throughout the codebase. The rename makes it clearer that "targets" refer to spawn connection configurations rather than a SQL concept of "database." This is a breaking change to both the TOML config format and the CLI API.
Changes:
- Rename
DatabaseConfig→TargetConfig,databases→targets,--database→--targetacross all Rust source and tests - Make
spawn_databaseoptional (Option<String>) and implement\c spawn_databasepsql metacommand to redirect migration tracking to a separate database when configured - Update all documentation, CLI reference pages, and add a new integration test for the
spawn_databasesplit-database behavior
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/engine/mod.rs |
Renames DatabaseConfig → TargetConfig, spawn_database becomes Option<String> |
src/engine/postgres_psql.rs |
Adds spawn_db_connect_command() and new build_record_migration_sql method; renames field types |
src/config.rs |
Renames database/databases to target/targets, updates db_config() to target_config() |
src/cli.rs |
Renames --database CLI flag to --target |
src/commands/migration/mod.rs |
Updates to use target_config() and config.target |
src/commands/check.rs |
Updates to use config.target and target_config() |
src/commands/init.rs |
Updates generated config to use targets section |
src/template.rs |
Updates to use target_config() |
tests/migration_build.rs |
Updates test helper to use TargetConfig and targets |
tests/integration_postgres.rs |
Updates to use TargetConfig/targets; adds test_spawn_database_config integration test |
mise.toml |
Adds [tasks.test] task |
docs/src/components/cli-options.ts |
Renames databaseOption → targetOption |
All docs/src/content/docs/ files |
Updates all documentation references from databases/--database to targets/--target |
README.md |
Updates config example from [databases.prod] to [targets.prod] |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 30 out of 30 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Fixes #29 |
Description
Docs did not clearly specify that
spawn_databaserefers to where the spawn metadata is stored. At the same time, have renamed 'database' to 'target' in a bunch of places, so that it's clearer that this is referring to something other than a mysql concept of database or a postgres concept of it.Also,
spawn_databaseusage was not yet implemented, so this PR implements it.Breaking change.
Issue
spawn_databasevague documentation #28