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 15 MB 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)
Note: Auto-inferred schemas default all columns to nullable for safety
✅ Lua transformations — powerful data transformations
✅ Universal connectivity — CSV, JSON, Parquet, Avro, MySQL, PostgreSQL, SQLite, DuckDB, MSSQL, ODBC. Coming soon: 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>
Direct Transfer:
<SOURCE> Source connection string (file path or connection string)
<TARGET> Target connection string (file path or connection string)
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
Config File Mode:
run <CONFIG_FILE> Run ETL job from YAML configuration file
Config File Generation Modes:
generate-config [OPTIONS] <SOURCE> <TARGET> Generate a YAML configuration file from CLI arguments and output to STDOUT
generate-default-config Generate a default YAML configuration example and output to STDOUT
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
- ODBC - Universal database connectivity (SQL Server, Oracle, DB2, and more)
Connection Examples:
# SQLite
# PostgreSQL
# MySQL
# DuckDB
# ODBC - SQL Server (Windows with Trusted Auth)
# ODBC - SQL Server (with username/password)
# ODBC - Reading from SQL Server
# 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
ODBC (Universal Database Connectivity):
ODBC provides connectivity to SQL Server, Oracle, DB2, and many other databases. The connection string format varies by driver.
# SQL Server with Windows Authentication (Trusted Connection)
# SQL Server with SQL Authentication
# SQL Server - Reading data
# Oracle Database
# IBM DB2
ODBC Driver Requirements:
- Windows: Drivers typically pre-installed or available via vendor installers
- macOS: Install via Homebrew
- Linux: Install via package manager
Important ODBC Notes:
- Connection strings must be URL-encoded if they contain special characters
- The database must exist before using TinyETL
- Table names are specified after
#separator - Always quote ODBC connection strings to prevent shell interpretation
- For SQL Server driver names:
ODBC Driver 18 for SQL Server(latest),ODBC Driver 17 for SQL Server, orSQL Server(older)
Important Notes:
- Table names are automatically created if they don't exist
- For MySQL and ODBC databases, 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:
YAML Configuration (New Format)
Starting with version 0.9.0, TinyETL supports an enhanced YAML format for transformations with better type safety and clarity. The new format uses a tagged union structure:
# Multi-line script (best for complex logic)
transform:
type: script
value: |
full_name = row.first_name .. ' ' .. row.last_name
total_amount = row.quantity * row.unit_price
profit = total_amount * 0.3
# Inline expressions (simple one-liners)
transform:
type: inline
value: "total=row.qty * row.price; profit=total - row.cost"
# External Lua file (reusable transformations)
transform:
type: file
value: "transform.lua"
Backwards Compatibility: Old YAML configs without the type field are no longer supported.
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:
📝 Note on Schema Inference: When TinyETL automatically infers schema from your data, all columns are marked as
nullable: trueby default. This is a safety measure for ETL operations—sample data may not represent all possible values in your dataset. If you needNOT NULLconstraints or other strict validation, you must provide an explicit schema file.
schema.yaml:
columns:
- 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:
columns:
- 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:
columns:
- 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
# This is a configuration file for TinyETL.
# It is in YAML format.
# Comments start with the '#' character and are ignored.
# Blank lines are ignored.
#
# To use this configuration:
# 1. Customize this configuration as needed.
# 2. Save it as 'config.yaml' or with a similar name of your choosing.
# 3. Use the configuration by running: `tinyetl run config.yaml`.
#
# You may generate a configuration file from CLI arguments using:
# `tinyetl generate-config [OPTIONS] <SOURCE> <TARGET> > config.yaml`
#
# Use `${VAR_NAME}` syntax to insert dynamic values from environment variables.
# For example, to use a database password from an environment variable:
# uri: "postgres://user:${DB_PASSWORD}@localhost:5432/dbname"
version: 1
source:
uri: "employees.csv" # or database connection string
target:
uri: "employees_output.json" # or database connection string
# The "options" key and all other keys beneath "options" can be omitted.
# Sensible default values will be used for omitted keys.
options:
batch_size: 10000 # Number of rows per batch
infer_schema: true # Auto-detect column types
schema_file: "schema path.yaml" # Override with external schema
preview: 10 # Show N rows without transfer
dry_run: false # Validate without transferring
log_level: info # info, warn, error (lowercase in YAML)
skip_existing: false # Skip if target exists
source_type: "csv" # Force source file type
truncate: false # Truncate target before writing
# Transform configuration supports multiple formats:
# 1. Multi-line script (recommended for complex transformations)
transform:
type: script
value: |
-- 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))
# 2. Inline single-line expressions (for simple transformations)
# transform:
# type: inline
# value: "total=row.quantity * row.price; profit=total - row.cost"
# 3. External Lua file (for reusable transformation logic)
# transform:
# type: file
# value: "transform.lua"
# 4. No transformation (default)
# transform:
# type: none
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:
type: script
value: |
-- 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
Contributors
Special thanks to:
- Michael Descy @mjdescy
- Chris Riccomini @criccomini
for contributing to TinyETL!
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.