copy-schema
Copies a database schema from a source database to a destination, with plan/apply modes, table filters, and optional row data.
Instructions
dbabrain common.cli copy-schema: A schema to copy from one database into another.
server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request):
source: Where the schema is read from: {connection, database_name, schema} - connection is the complete login (db_type, host, port, username, password). The app that calls fills it from its own data/ (dbabrain.lib.data_source...
destination: Where it is written: {connection, database_name, schema} - connection is the complete login. The app that calls fills it from its own data/ (dbabrain.lib.data_sources.request_fill); common.cli reads no configuration (...
mode: plan | apply.
tables: Which tables.
include_tables: Only these.
exclude_tables: Not these.
modules: Which modules.
include_modules: Only these.
exclude_modules: Not these.
with_data: Copy rows too.
batch_size: Rows per batch.
create_schema: Create it.
skip_nonempty_tables: Leave a table with rows alone.
map_filegroups: Filegroup mapping.
partition_boundaries: Copy partition boundaries.
module_passes: Passes over modules.
phases: Which phases.
plan: A plan to apply.
verify: Compare after.
report_unsupported: List what cannot be copied.
assert_dest_instance: The instance it must be.
lock_name: The application lock.
lock_timeout_seconds: Waiting for it.
target: The machine or instance: a server_id, or
<db_type> <ip>[:port].schema: The schema.
database_name: One database.
timeout_seconds: How long to wait.
key: The secret-store passphrase, when not in the environment.
key_base64: The same, base64.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "copy-schema"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |