End-to-end Workflow

A complete walkthrough from installing Weavori to exporting synthetic data.

Last updated October 20, 2018

Scenario

You have a production PostgreSQL database and need a synthetic copy for staging or development.

Step 1: Install Weavori

If you haven't already, install Weavori for your platform.

$ weavori version
weavori 0.1.6

Step 2: Authenticate

Authenticate to unlock your plan's features:

$weavori login

This opens your browser for a secure sign-in. See the login reference for details.

Step 3: Save your database connection

Save your PostgreSQL DSN so subsequent commands use it automatically:

$ weavori connect "postgres://user:pass@localhost:5432/production"
Connection successful! DSN saved to config.

Step 4: Estimate the schema

Run estimate to introspect your database and verify connectivity. This is a safe, read-only operation.

$ weavori estimate "postgres://user:pass@localhost:5432/production"
Connecting to database...
Introspecting schema...
Connected.
Estimating...
Tables found: 15
Total rows (approx): 842100

Step 5: Plan without target

Run generate without --target to see the generation plan without writing any data:

$ weavori generate "postgres://user:pass@localhost:5432/production"
Generation order (parents before children):
1. public.departments
2. public.users
3. public.projects
4. public.tasks
5. public.comments
6. audit.log_entries
...
Schema introspection and FK resolution complete.
Specify --target <dsn> to generate and export synthetic data.

Step 6: Generate synthetic data

Create a target database and run the full generation:

$createdb staging_clone
$weavori generate "postgres://user:pass@localhost:5432/production" \ --target "postgres://user:pass@localhost:5432/staging_clone" \ --rows 5000

For non-interactive use (CI/CD), add --yes to skip the preview prompt:

$weavori generate "postgres://user:pass@localhost:5432/production" \ --target "postgres://user:pass@localhost:5432/staging_clone" \ --rows 5000 --yes

Weavori introspects, resolves dependencies, samples distributions, generates synthetic data, and exports it — all in one command.

Step 7: Verify the results

$ psql "postgres://user:pass@localhost:5432/staging_clone"
staging_clone=# SELECT COUNT(*) FROM users;
count
-------
5000
staging_clone=# SELECT u.name, t.title
staging_clone-# FROM tasks t JOIN users u ON t.assignee_id = u.id
staging_clone-# LIMIT 5;
name | title
---------------|---------------------
Jane Doe | Implement auth
John Smith | Write tests
...

Foreign key relationships are intact — every assignee_id references a valid users.id.

Next steps