weavori sync
Copy data from one PostgreSQL database to another.
Usage
weavori sync [source-dsn] [flags]
The sync command connects to a source PostgreSQL database, introspects its schema, resolves foreign key dependencies, and syncs data table-by-table to a target database. Tables are synced in dependency order to maintain referential integrity.
Flags
| Flag | Default | Description |
|---|---|---|
-o, --output | "" | Target database DSN (required) |
--schema | "" | Only sync tables matching this schema name |
--table | "" | Only sync tables matching this table name |
--mode | "copy" | Sync mode: copy (fast) or insert (compatible) |
--batch | 1000 | Number of rows per batch |
--create-tables | true | Create schemas and tables on target before syncing |
--no-color | false | Disable ANSI color output |
--verbose | false | Include detailed progress output |
Persistent flags
These flags are inherited from the root command:
| Flag | Default | Description |
|---|---|---|
--api-key | "" | API key for non-interactive authentication |
--output | "pretty" | Output format: pretty, plain, or json |
Examples
Full sync
weavori sync "postgres://user:pass@localhost:5432/source" \
--output "postgres://user:pass@localhost:5432/target"
Sync a single schema
weavori sync "postgres://user:pass@localhost:5432/source" \
--output "postgres://user:pass@localhost:5432/target" \
--schema "analytics"
INSERT mode for compatibility
weavori sync "postgres://user:pass@localhost:5432/source" \
--output "postgres://user:pass@localhost:5432/target" \
--mode insert