Skip to main content
The basecut.yml file defines what Basecut extracts, how traversal is bounded, how PII is anonymized, and where output is written.

Complete Example

Top-Level Fields

from

from defines the starting rows.
  • Use table: users for public.users.
  • Use table: schema.table for non-public schemas.
  • where supports named params (:id), values go in params.

traverse

virtual_foreign_keys

Use virtual_foreign_keys when related tables are enforced in application code but not declared as database FK constraints. Single-column (compact) form:
Composite-column (structured) form:
Notes:
  • Virtual FK edges are traversed the same way as real FKs during extraction.
  • Bare table names are normalized to public.<table>.
  • Compact endpoints must be table.column or schema.table.column.
  • from.columns and to.columns must have the same number of columns.
  • Duplicate virtual FK definitions are rejected.

limits.rows

Cycle handling: When tables form circular foreign key relationships (cycles), Basecut automatically caps the combined row count for the cycle group based on the sum of effective table limits. For example, if three tables in a cycle each have per_table: 1000, the cycle budget is 3000 total rows. Adjust per_table or add individual tables entries to control cycle sizes.

anonymize

Shorthand:
Object form:
Notes:
  • mode: auto enables built-in PII auto-detection plus explicit rules.
  • mode: manual applies only explicit rules.
  • mode: off disables anonymization.
  • Table-grouped rule keys can be unqualified (users) for public.users.
  • excluded_domains (top-level) is an optional list of email domains that bypass anonymization. Emails matching these domains (case-insensitive, exact match) are left unchanged, whether the email strategy was set via explicit rules or auto-detection. Useful for preserving internal/test emails like @yourcompany.com.
  • Per-rule params.excluded_domains overrides the global list for that specific rule. If present (even as an empty list), the global excluded_domains are ignored for that rule. A rule without params.excluded_domains inherits the global list.

output

String shorthand:
Object form:
For cloud providers:
Notes:
  • For provider: s3, bucket is required.
  • For Cloudflare R2, use provider: s3 + endpoint and set region: auto.

Minimal Config