Quickstart Guide
Get Skifta up and running in 5 minutes. This guide walks you through masking your first SQL dump.
Prerequisites
Before starting, make sure Skifta is installed. If not, follow the Installing guide.
Step 1: Create a Configuration File
Navigate to your project directory and initialize a Skifta config:
bash
skifta initThis generates a skifta.toml file with example configurations. The file defines:
- SQL dialect (postgres, mysql, sqlite)
- Tables and columns to transform
- Transformers to apply to each column
Step 2: Configure Your Transformations
Open skifta.toml and customize it for your database schema.
Example: Masking a Users Table
toml
dialect = "postgres"
[[table]]
name = "users"
columns = [
{ name = "email", transformer = "email" },
{ name = "first_name", transformer = "name" },
{ name = "last_name", transformer = "name" },
{ name = "phone", transformer = "phone-number" }
]Example: Multi-Table Configuration
toml
dialect = "postgres"
[[table]]
name = "users"
columns = [
{ name = "email", transformer = "email" },
{ name = "full_name", transformer = "name" }
]
[[table]]
name = "orders"
columns = [
{ name = "shipping_address", transformer = "lipsum" }
]
[[table]]
name = "payments"
columns = [
{ name = "credit_card", transformer = "credit-card" }
]Browse all available transformers to see what you can mask.
Step 3: Run the Transformation
Transform your SQL dump with a single command:
bash
skifta -i production-dump.sql -o anonymized-dump.sqlWhat happens:
- Skifta parses your SQL dump according to the specified dialect
- Identifies
INSERTstatements for configured tables - Transforms specified columns using the configured transformers
- Outputs a new SQL file with masked data
Alternative: Stream to stdout
If you prefer working with pipes:
bash
skifta -i production-dump.sql > anonymized-dump.sqlStep 4: Verify the Output
Check the anonymized dump to ensure transformations worked as expected:
bash
# Quick preview of transformed data
head -n 50 anonymized-dump.sql
# Or import into a test database
psql test_db < anonymized-dump.sqlCommon Use Cases
Scenario: Sharing Data with External Developers
bash
# 1. Export production data
pg_dump production_db > prod-dump.sql
# 2. Mask PII with Skifta
skifta -i prod-dump.sql -o safe-dump.sql
# 3. Share safe-dump.sql with contractorsScenario: Creating Test Fixtures
bash
# 1. Dump a subset of production data
pg_dump --table=users --table=orders production_db > subset.sql
# 2. Anonymize for CI/CD
skifta -i subset.sql -o test-fixtures.sql
# 3. Use in your test suiteWhat's Next?
- Configuration Guide: Learn advanced configuration options
- Transformers Reference: Explore all available transformers and their options
- Dialect Support: Understand dialect-specific considerations
- CI/CD Integration: Integrate Skifta into your automation pipelines (coming soon)
Need Help?
- Found a bug? Open an issue on GitHub
- Have questions? Check the FAQ (coming soon)
- Want to contribute? See our Contributing Guide (coming soon)