safeslice

Interactive workflow

Every screen the wizard shows, what each one decides, and how to go back when you change your mind.

safeslice with no arguments runs the wizard. It drives exactly the same pipeline as the individual commands — it is not a second implementation — and writes the same safeslice.yaml they read.

Choosing a source

❯ 1  Enter a connection string   postgres://user@host:5432/dbname
  2  Use SAFESLICE_SOURCE
  3  Choose from saved connections

Point it at a read replica if you have one. The session is set read-only before anything else runs.

If the connection fails you get four actions — Retry, Change the connection, Enter a password, Cancel — plus the driver’s own message on request. A password typed here never reaches your shell history and is never written to disk.

Classifying columns

Safeslice classifies what it can from column names: email, phone, first_name, password, card_number and the rest. What it cannot judge is free text, and that is the decision it hands to you:

Column 2 of 7

Column   comments.body
Type     TEXT

⚠ Recommended: REDACT   (free text)
This is free-form user-generated text. It may contain names, emails,
phone numbers, addresses or anything else a person typed into a box.

Take every recommendation with one keystroke, or review each column individually. Nothing is ever classified as safe without a human choosing it.

Choosing how much data

Presets set the number of root rows, not the total — the total depends on how many related rows each one pulls in, and the preview shows the real number before anything is written.

PresetRoot rowsFor
Small1,000Local development
Medium10,000Realistic testing
Large100,000Performance work

A filter narrows the starting rows further: id = 4821 slices around one customer, created_at > '2026-01-01' around a date range.

Choosing a destination

Safeslice copies rows, not table definitions, so the target needs the same schema. It can create a local database and copy the structure with pg_dump --schema-only, or use one your own migrations already built.

If the database already exists, nothing is silently overwritten:

❯ 1  Use it as it is
  2  Create "myapp_dev_2" instead
  3  Choose another name
  4  Replace it            destroys everything in it
  5  Cancel

Replacing requires typing the database name. A y/N is answered by reflex; typing the name out is not.

The review screen

The last screen before any data moves shows exact per-table row counts, the foreign-key closure, any relationships the database does not enforce, and what will be masked. From there you can go back to the masking, the slice size or the destination — nothing has been written yet, so unwinding is free.

The results screen

When it finishes, everything it produced is one keypress away: the HTML report, the output folder, the CSV, the JSON, the masking rules, or the connection string copied to your clipboard. Nothing opens on its own.