Skip to content

Clarify docs on spawn database#29

Merged
saward merged 7 commits intomainfrom
clarify-docs-on-spawn-database
Mar 16, 2026
Merged

Clarify docs on spawn database#29
saward merged 7 commits intomainfrom
clarify-docs-on-spawn-database

Conversation

@saward
Copy link
Copy Markdown
Owner

@saward saward commented Mar 10, 2026

Description

Docs did not clearly specify that spawn_database refers 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_database usage was not yet implemented, so this PR implements it.

Breaking change.

Issue

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 DatabaseConfigTargetConfig, databasestargets, --database--target across all Rust source and tests
  • Make spawn_database optional (Option<String>) and implement \c spawn_database psql 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_database split-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 DatabaseConfigTargetConfig, 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 databaseOptiontargetOption
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.

Comment thread src/engine/postgres_psql.rs Outdated
Comment thread src/engine/postgres_psql.rs Outdated
Comment thread src/engine/postgres_psql.rs Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/engine/postgres_psql.rs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@saward saward merged commit 9b78c49 into main Mar 16, 2026
8 checks passed
@saward
Copy link
Copy Markdown
Owner Author

saward commented Mar 16, 2026

Fixes #29

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.

2 participants