TinyETL
Fast, zero-config ETL in a single binary

Transform and move data between any format or database instantly. No dependencies, no config files, just one command.
# MySQL → Parquet with inline transformation
# Stream 100k+ rows/sec from CSV → SQLite
# Download & convert web data
Why TinyETL?
✅ Single 12.5MB binary — no dependencies, no installation headaches
✅ 180k+ rows/sec streaming — handles massive datasets efficiently
✅ Zero configuration — automatic schema detection and table creation (override with schema and config files in yaml)
✅ Lua transformations — powerful data transformations
✅ Universal connectivity — CSV, JSON, Parquet, Avro, MySQL, PostgreSQL, SQLite, DuckDB, native MSSQL (currently slow). Coming soon: ODBC, Snowflake, Databricks, OneLake
✅ Cross-platform — Linux, macOS, Windows ready
Quick Install
Download the binary (recommended):
Visit the releases page and download the appropriate binary for your platform:
- Linux x64, Linux ARM64
- macOS Intel, macOS Apple Silicon
- Windows x64, Windows ARM64
Or install with Cargo (builds from source):
Verify installation:
Get Started in 30 Seconds
# File format conversion (auto-detects schemas)
# Database to database
# Transform while transferring
# Process large datasets efficiently
# Download and convert web data
# Run complex ETL jobs from configuration files
Usage
Usage: tinyetl [OPTIONS] <SOURCE> <TARGET>
tinyetl run <CONFIG_FILE>
Direct Transfer:
<SOURCE> Source connection string (file path or connection string)
<TARGET> Target connection string (file path or connection string)
Config File Mode:
run <CONFIG_FILE> Run ETL job from YAML configuration file
Options:
--infer-schema Auto-detect columns and types
--schema-file <FILE> Path to schema file (YAML) to override auto-detection
--batch-size <BATCH_SIZE> Number of rows per batch [default: 10000]
--preview <N> Show first N rows and inferred schema without copying
--dry-run Validate source/target without transferring data
--log-level <LOG_LEVEL> Log level: info, warn, error [default: info]
--skip-existing Skip rows already in target if primary key detected
--truncate Truncate target before writing (overrides append-first behavior)
--transform-file <FILE> Path to Lua file containing a 'transform' function
--transform <EXPRESSIONS> Inline transformation expressions (semicolon-separated, e.g., "new_col=row.old_col * 2; name=row.first .. ' ' .. row.last")
--source-type <TYPE> Force source file type (csv, json, parquet) - useful for HTTP URLs without clear extensions
--source-secret-id <ID> Secret ID for source password (resolves to TINYETL_SECRET_{id})
--dest-secret-id <ID> Secret ID for destination password (resolves to TINYETL_SECRET_{id})
-h, --help Print help
-V, --version Print version
Basic usage examples:
# Local file operations
# Download from web
# Secure file transfer via SSH
# Database operations
# Data inspection and validation
# Advanced options
# Transfer with custom batch size
# Dry run to validate without transferring
# Apply inline transformations
# Apply transformations from Lua file
Supported Data Sources and Targets
TinyETL supports two main categories of data sources and targets:
File-Based Sources (Multiple Protocols)
File Formats:
- CSV - Comma-separated values
- JSON - JavaScript Object Notation (array of objects)
- Parquet - Columnar storage format
- Avro - Binary serialization format with schema evolution
Access Protocols:
- Local Files - Direct file system access
- HTTP/HTTPS - Download from web servers
- SSH/SCP - Secure file transfer
Protocol Features:
- file:// - Local file system (default for simple paths)
- http:// and https:// - Web downloads with progress tracking
- ssh:// - Secure shell file transfer using SCP
- --source-type parameter for format override (useful for URLs without clear extensions)
Database Sources
Supported Databases:
- SQLite - Embedded database
- PostgreSQL - Advanced open-source database
- MySQL - Popular relational database
- DuckDB - Embedded analytical database optimized for OLAP workloads
Connection Examples:
# SQLite
# PostgreSQL
# MySQL
# DuckDB
Source Type Override
When using HTTP/HTTPS or SSH protocols, URLs may not always indicate the file format clearly (e.g., API endpoints, URLs with query parameters). Use the --source-type parameter to explicitly specify the format:
# API endpoint that returns CSV data
# Google Drive download (no file extension in URL)
# SSH file without clear extension
# Local files usually don't need source-type (auto-detected from extension)
Supported source types: csv, json, parquet, avro
Database Connection Strings
TinyETL uses standard database connection URLs with an optional table specification using the # separator.
PostgreSQL:
# Basic format
# Examples
MySQL:
# Basic format
# Examples
# Default table name is 'data' if not specified
SQLite:
# File path (table name inferred from filename without extension)
# Explicit table name using connection string format
DuckDB:
# File path (table name inferred from filename without extension)
# Explicit table name using # separator
# Reading from DuckDB table
Important Notes:
- Table names are automatically created if they don't exist
- For MySQL, the database must exist before running TinyETL
- DuckDB is optimized for analytical (OLAP) workloads and offers better performance than SQLite for aggregations
- Connection strings should be quoted to prevent shell interpretation
- Default ports: PostgreSQL (5432), MySQL (3306)
Secure Password Management
TinyETL provides secure methods for handling database passwords to avoid exposing sensitive credentials in command-line arguments or shell history.
Environment Variables (Recommended)
Instead of including passwords directly in connection strings, use environment variables and use the --source-secret-id and --dest-secret-id parameters:
# Set custom environment variables
# Use explicit secret IDs
Environment Variable Pattern:
- Format:
TINYETL_SECRET_{protocol}_{type}orTINYETL_SECRET_{protocol} - Examples:
TINYETL_SECRET_mysql_dest- for MySQL destination connectionsTINYETL_SECRET_postgres_source- for PostgreSQL source connectionsTINYETL_SECRET_mysql- generic MySQL password (works for both source/dest)
Security Warnings
TinyETL automatically detects when passwords are included in CLI parameters and warns you:
# This will show a security warning:
Security Best Practices:
- ✅ Use environment variables for passwords
- ✅ Use explicit secret IDs for multiple environments
- ✅ Keep connection strings in CI/CD without embedded passwords
- ❌ Avoid putting passwords directly in connection strings
- ❌ Avoid storing passwords in shell scripts or command history
Data Transformations
TinyETL supports powerful data transformations using Lua scripting during the ETL process. Transform, combine, filter, and modify data as it flows from source to target.
Using Inline Transformations
Use the --transform option with semicolon-separated expressions. All original columns are automatically preserved, and you can add new columns or override existing ones:
# Add a new column while keeping all existing columns
# Multiple transformations (original columns + new calculated columns)
# Override existing columns and add new ones
Using Lua Files
For complex transformations, create a Lua file with a transform function. Note: With Lua files, you have full control over which columns to include. Only columns explicitly returned are kept:
transform.lua:
Transformation Rules
- Schema Inference: The output schema is determined by the first transformed row
- Column Preservation: For inline expressions, all original columns are preserved by default
- Column Override: Transformations can override existing columns with new values
- New Columns: New columns returned by transform are added to the target schema
- Column Filtering: For Lua files, only columns returned by the transform function are kept
- Row Filtering: Return
nilor empty table{}from Lua functions to filter out rows - Type Safety: Lua values are automatically converted to appropriate SQL types
- Error Handling: Transformation errors stop the process with clear error messages
Available Data Types
- Strings:
"text"or'text' - Numbers:
42,3.14(integers become INTEGER, decimals become REAL) - Booleans:
true,false - Null:
nil(becomes NULL in target) - Dates: Input as RFC3339 strings, can be manipulated as strings
Lua Built-ins Available
- String functions:
string.find(),string.match(),string.gsub(), concatenation with.. - Math functions:
math.floor(),math.ceil(),math.abs(), basic operators - Logic:
and,or,not, conditional expressions - Pattern matching with string methods
Row Filtering (Lua Files Only)
You can filter out rows by returning nil or an empty table {} from your transform function:
Note: Inline expressions (--transform) always preserve all rows. Row filtering only works with Lua files (--transform-file).
Examples
# Clean and standardize phone numbers
# Category mapping
# Extract year from date and calculate age
# Filter and transform with Lua file (removes invalid rows)
# Preview transformations before applying
Schema File Format
Create a YAML file defining your expected schema. Here's the complete format:
schema.yaml:
fields:
- name: "id"
type: "Integer"
nullable: false
- name: "email"
type: "Text"
nullable: false
pattern: "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"
- name: "age"
type: "Integer"
nullable: true
default: 0
- name: "salary"
type: "Decimal"
nullable: true
- name: "is_active"
type: "Boolean"
nullable: false
default: true
- name: "created_at"
type: "DateTime"
nullable: true
pattern: "^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}"
Supported Data Types
- Text - String values, supports regex pattern validation
- Integer - Whole numbers (32-bit signed integers)
- Decimal - High-precision decimal numbers using
rust_decimal - Boolean - True/false values (accepts: true, false, 1, 0, yes, no)
- DateTime - ISO 8601 date-time strings, supports pattern validation
Schema Field Properties
| Property | Type | Required | Description |
|---|---|---|---|
name |
String | ✅ | Column name (must match source data) |
type |
String | ✅ | Data type: Text, Integer, Decimal, Boolean, DateTime |
nullable |
Boolean | ❌ | Allow null/empty values (default: true) |
pattern |
String | ❌ | Regex pattern for validation (Text/DateTime types) |
default |
Any | ❌ | Default value when field is missing or null |
Validation Behavior
Type Conversion:
- Automatic conversion from string representations to target types
- Boolean parsing:
"true","1","yes"→true;"false","0","no"→false - Integer parsing:
"123"→123 - Decimal parsing:
"123.45"→123.45(high precision)
Null Handling:
- Missing fields use
defaultvalue if specified - Null/empty values use
defaultvalue if specified - If
nullable: false, null values without defaults cause validation errors
Pattern Validation:
- Regex patterns applied to Text and DateTime fields
- Validation failures stop processing with clear error messages
- Use double backslashes `` for regex escapes in YAML
Error Handling:
- Schema validation errors halt processing immediately
- Clear error messages indicate field name, expected type, and actual value
- Pattern validation failures show the expected regex pattern
Schema Examples
Customer Data Schema:
fields:
- name: "customer_id"
type: "Integer"
nullable: false
- name: "full_name"
type: "Text"
nullable: false
- name: "email"
type: "Text"
nullable: false
pattern: "^[\w\.-]+@[\w\.-]+\.[a-zA-Z]{2,}$"
- name: "phone"
type: "Text"
nullable: true
pattern: "^\+?[1-9]\d{1,14}$" # E.164 format
- name: "registration_date"
type: "DateTime"
nullable: false
pattern: "^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}"
- name: "is_premium"
type: "Boolean"
nullable: false
default: false
- name: "credit_limit"
type: "Decimal"
nullable: true
default: "0.00"
Sales Data Schema:
fields:
- name: "order_id"
type: "Text"
nullable: false
pattern: "^ORD-\d{8}$" # Format: ORD-12345678
- name: "quantity"
type: "Integer"
nullable: false
default: 1
- name: "unit_price"
type: "Decimal"
nullable: false
- name: "discount_rate"
type: "Decimal"
nullable: true
default: "0.0"
- name: "total_amount"
type: "Decimal"
nullable: false
- name: "order_date"
type: "DateTime"
nullable: false
Integration with Transformations
Schema validation occurs before transformations, ensuring input data quality:
# Validate input, then transform
Validation Flow:
- Load schema from YAML file
- Validate each row against schema (type checking, patterns, nullability)
- Apply defaults for missing/null fields
- Apply transformations to validated data
- Transfer to target
Use Cases
- Data Quality Assurance: Ensure incoming data meets quality standards
- API Integration: Validate data from external APIs before processing
- ETL Pipelines: Enforce consistent schemas across pipeline stages
- Data Contracts: Define and enforce data format agreements
- Migration Validation: Ensure data integrity during system migrations
YAML Configuration Files
For complex ETL jobs, TinyETL supports YAML configuration files that make your data pipelines more maintainable and version-controllable:
# Run ETL job from configuration file
Benefits of Configuration Files
✅ Clean, readable YAML format - Better organization than long command lines
✅ Environment variable substitution - Perfect for secrets and dynamic values
✅ Multi-line transformations - Complex Lua transforms with proper formatting
✅ Version control friendly - Store and share ETL job definitions
✅ Reusable configurations - Same job across environments
Configuration File Format
version: 1
source:
uri: "employees.csv" # or database connection string
target:
uri: "employees_output.json" # or database connection string
options:
batch_size: 10000 # Number of rows per batch
infer_schema: true # Auto-detect column types
schema_file: "schema.yaml" # Override with external schema
preview: 10 # Show N rows without transfer
dry_run: false # Validate without transferring
log_level: "info" # info, warn, error
skip_existing: false # Skip if target exists
truncate: false # Truncate target before writing
transform: | # Inline Lua transformation
-- Calculate derived fields
full_name = row.first_name .. " " .. row.last_name
annual_salary = row.monthly_salary * 12
hire_year = tonumber(string.sub(row.hire_date, 1, 4))
transform_file: "script.lua" # External transform file
source_type: "csv" # Force source file type
Environment Variables
Use ${VAR_NAME} syntax for dynamic values:
version: 1
source:
uri: "postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:5432/mydb#users"
target:
uri: "${OUTPUT_PATH}/processed_users.parquet"
options:
batch_size: ${BATCH_SIZE:-5000} # Default to 5000 if not set
log_level: "${LOG_LEVEL:-info}"
# Set environment variables
# Run with environment substitution
Examples
Simple file conversion:
# basic_job.yaml
version: 1
source:
uri: "sales_data.csv"
target:
uri: "sales_data.parquet"
options:
batch_size: 50000
infer_schema: true
Database with transformations:
# etl_job.yaml
version: 1
source:
uri: "postgresql://user:${DB_PASSWORD}@host/db#raw_orders"
target:
uri: "analytics.db#processed_orders"
options:
truncate: true
transform: |
-- Calculate order totals and profit margins
total_amount = row.quantity * row.unit_price
profit_margin = (total_amount - row.cost) / total_amount
order_year = tonumber(string.sub(row.order_date, 1, 4))
Run any configuration file with:
Command Examples
# Basic schema validation
# Schema validation with preview
# Combined schema validation and transformations
# Validate API data before processing
--source-type=csv
Sample Output
→ Connecting to source: sales.csv
→ Inferring schema...
→ 8 columns detected
→ Transformation enabled
→ Connecting to target: local.db#sales
→ Schema updated by transformations: 12 columns
→ Copying 100,000 rows
████████████ 100% (145k rows/sec)
→ Done in 2.3s
Performance Goals
- Handle datasets up to 5 million rows efficiently
- Maintain low memory footprint through streaming
- Achieve transfer speeds of 180k+ rows per second for typical datasets
- Cross-platform compatibility (Linux, macOS, Windows)
Roadmap
MVP (Current Focus):
- Core CSV, JSON, SQLite connectors ✅
- MySQL and PostgreSQL connectors ✅
- Schema inference ✅
- Lua-based data transformations ✅
- Batch processing ✅
- Basic CLI interface ✅
- YAML configuration files ✅
Future Enhancements:
- Advanced transformation functions and libraries
- Multi-file processing with glob patterns
- Advanced schema mapping
- Data validation and quality checks
License
This project is licensed under a modified Apache License 2.0 - see the LICENSE file for details.
Commercial use is explicitly allowed with the exception of reselling TinyETL in a cloud SaaS format, please contact licensing@tinyetl.com for additional commercial licensing terms.
Built with Rust for performance, safety, and reliability.