Skip to content

Configuration ​

Skifta uses a simple TOML configuration file to define how your SQL dumps should be transformed. The config file specifies:

  • SQL dialect (PostgreSQL, MySQL, SQLite)
  • Tables and columns to transform
  • Transformers to apply for each column
  • Transformation options (optional, per transformer)

πŸ’‘ New to Skifta? Start with the Installing and Quickstart guides.

Creating a Configuration File ​

The easiest way to get started is to generate a starter config:

bash
skifta init

This creates a skifta.toml file in your current directory with example configurations you can customize.

SQL Dialect ​

Skifta supports several SQL dialects. Specify the one that matches your SQL dump:

toml
dialect = "postgres"

Supported dialects are listed in the Dialect guide.

Tables ​

Define each target table using the [[table]] block:

toml
[[table]]
name = "customers"

Columns ​

Inside each table, you define which columns to transform and which transformer to apply.

Nested Format ​

toml
[[table]]
name = "employees"

[[table.columns]]
name = "first_name"
transformer = "name"

Inline Format ​

If you prefer a compact style, use inline objects:

toml
[[table]]
name = "employees"
columns = [
  { name = "first_name", transformer = "name" },
  { name = "email", transformer = "email" }
]

Both styles are supported β€” pick whichever suits your workflow.

Transformers ​

Transformers are reusable building blocks that control how values are modified or generated. You can specify them by name or provide an object for advanced options.

See the Transformers section for full details and examples.

Full Example ​

Here's a complete skifta.toml example for an e-commerce database:

toml
dialect = "postgres"

[[table]]
name = "customers"
columns = [
  { name = "email", transformer = "email" },
  { name = "first_name", transformer = "name" },
  { name = "last_name", transformer = "name" },
  { name = "phone", transformer = "phone-number" }
]

[[table]]
name = "orders"
columns = [
  { name = "shipping_address", transformer = "lipsum" },
  { name = "billing_address", transformer = "lipsum" }
]

[[table]]
name = "payments"
columns = [
  { name = "card_number", transformer = "credit-card" },
  { name = "cardholder_name", transformer = "name" }
]

[[table]]
name = "employees"
columns = [
  { name = "email", transformer = "email" },
  { name = "salary", transformer = { obfuscate = { preserve_length = true } } },
  { name = "ssn", transformer = { static = { value = "XXX-XX-XXXX" } } }
]

This configuration will:

  • Mask all customer PII (emails, names, phone numbers)
  • Anonymize shipping and billing addresses
  • Replace credit card numbers with valid-format test cards
  • Obfuscate employee salaries while preserving length
  • Replace SSNs with a static redacted value

What’s Next? ​