Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
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
# Load a CSV into Snowflake (staged and loaded with COPY INTO)
# Excel sheet → Parquet on S3
# Download & convert web data
Why TinyETL?
✅ Single binary — about a 20 MB download (50 MB unpacked), with no runtime dependencies: no Python, no JVM, no shared libraries to install
✅ Fast and streaming — 140k–345k rows/sec on a laptop, with memory that stays flat as files grow (see Performance)
✅ 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, Excel, Parquet, Avro, MySQL, PostgreSQL, SQLite, CrateDB, DuckDB, MSSQL, ODBC, Snowflake. Coming soon: 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 Apple Silicon, macOS Intel
- Windows x64, Windows ARM64
The Linux binary needs glibc 2.35 or later (Ubuntu 22.04+, Debian 12+, Fedora 36+). On older systems, such as RHEL/Rocky 9 or Amazon Linux 2023, build from source with Cargo (below).
Each download is a single self-contained binary with nothing else to install. The Linux and macOS binaries include the unixODBC driver manager (LGPL-2.1-or-later); see License.
Linux x86_64 (use tinyetl-linux-aarch64 for ARM64):
&&
|
macOS Apple Silicon (use tinyetl-macos-intel-x86_64 for Intel Macs):
&&
|
The binary isn't notarized by Apple. If you downloaded it with a browser and macOS blocks it, run xattr -d com.apple.quarantine tinyetl (files fetched with curl aren't affected).
Windows x86_64 (use tinyetl-windows-aarch64 for ARM64):
Invoke-WebRequest -Uri "https://github.com/alrpal/TinyETL/releases/latest/download/tinyetl-windows-x86_64.zip" -OutFile "tinyetl.zip"
Expand-Archive -Path "tinyetl.zip" -DestinationPath "tinyetl"
# then add the tinyetl folder to your PATH
Each archive also contains LICENSE, THIRD_PARTY_LICENSES.md and a licenses/ folder.
Or install with Cargo (builds from source):
Building from source needs Rust 1.94 or later (rustup update) and a C/C++ compiler. The bundled C libraries (DuckDB, SQLite, Lua, unixODBC, AWS-LC, and OpenSSL on Linux) are compiled from source, so no system libraries are needed. A clean build takes several minutes, mostly DuckDB:
- Debian/Ubuntu:
sudo apt install build-essential perl(perlis used to build OpenSSL) - macOS:
xcode-select --install
Verify installation:
Get Started in 30 Seconds
# File format conversion (auto-detects schemas)
# Database to database
# Transform while transferring
# Large files stream with flat memory
# Download and convert web data
# Run complex ETL jobs from configuration files
Usage
A tiny ETL tool for moving data between sources
Usage: tinyetl [OPTIONS] [SOURCE] [TARGET]
tinyetl <COMMAND>
Commands:
run Run a job from a YAML configuration file
generate-default-config Generate a default YAML configuration example and output to STDOUT
generate-config Generate a YAML configuration file from CLI arguments and output to STDOUT
help Print this message or the help of the given subcommand(s)
Arguments:
[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 Not implemented yet; has no effect
--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, avro, xlsx, ...) - useful for 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
# Cloud storage and warehouses
# Data inspection and validation
# Replace a table's rows instead of appending
# Custom batch size
# 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)
- JSON Lines - One JSON object per line (
.jsonl,.ndjson) - Parquet - Columnar storage format (written with Snappy compression)
- Avro - Binary serialization format with schema evolution
- Excel - Reads
.xlsx,.xlsm,.xlsb,.xlsand OpenDocument.ods; writes.xlsx. Pick a sheet withfile.xlsx#Sheet(see "Excel" below)
Access Protocols:
-
Local Files - Direct file system access
-
HTTP/HTTPS - Download from web servers (supports authentication and custom headers via YAML config)
# For authenticated APIs, use YAML config (see HTTP Source Options section) -
SSH/SCP - Secure file transfer
-
Amazon S3 - Read and write single objects (also works with S3-compatible stores such as Cloudflare R2)
Protocol Features:
- file:// - Local file system (default for simple paths)
- http:// and https:// - Web downloads with progress tracking
- Supports Basic and Bearer token authentication
- Custom HTTP headers via YAML configuration
- Environment variable substitution for secure credential management
- ssh:// - Secure shell file transfer using SCP
- s3:// - Amazon S3 and S3-compatible object storage, as both source and target
- Credentials from
AWS_*environment variables, IAM roles, or YAML options (see S3 Options section)
- Credentials from
- --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
- SQL Server - Native driver (
mssql://), no ODBC driver needed - CrateDB - Distributed SQL database, through
postgresql://URLs - DuckDB - Embedded analytical database optimized for OLAP workloads
- ODBC - Any database with an ODBC driver (tested: SQL Server, PostgreSQL, MySQL/MariaDB, SQLite)
- Snowflake - Cloud data warehouse; bulk loads through stage +
COPY INTO
Connection Examples:
# SQLite
# PostgreSQL
# MySQL
# SQL Server (native)
# CrateDB
# DuckDB
# Snowflake (key-pair auth; see "Snowflake" below)
# ODBC (any database with an ODBC driver; see "ODBC" below)
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, jsonl, parquet, avro, xlsx (and the other spreadsheet extensions above)
Excel
- Reading: the first row is the header; blank header cells become
column_Nand repeated names get_2,_3, …. Rows with no values are skipped. The whole sheet is loaded into memory (the spreadsheet libraries read a sheet at once), so use CSV or Parquet for very large data. - Types: Excel stores every number as a double: whole numbers are read as integers, others as decimals. Date cells are read as dates, booleans as booleans, and text cells stay text (so
02134keeps its leading zero). Error cells (#N/A,#DIV/0!) are read as NULL. - Writing: produces an
.xlsxwith a bold header row; dates get a date format, and integers beyond ±2^53, which a double can't hold exactly, are written as text. Rows are streamed to a temporary file, so memory stays low. A sheet holds at most 1,048,576 rows; larger exports fail with a message. Writing replaces an existing file (it doesn't add a sheet to it). - S3 and HTTP:
s3://bucket/report.xlsxworks as a source and a target; HTTP(S) URLs ending in a spreadsheet extension, or with--source-type xlsx, work as sources.
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
When reading, column types come from the declared types (INTEGER, VARCHAR(255), DECIMAL(10,2), DATETIME, …). Columns declared JSON are read as JSON, including JSON stored as BLOB, unless sampled values aren't valid JSON, in which case they're read as text. Other BLOB values are read as text if they're valid UTF-8, and as hex otherwise.
SQL Server (native):
# Basic format (username and password are required)
# Examples
Tables are in the login's default schema (usually dbo); schema.table names aren't supported by the native connector yet. For other schemas, Windows authentication or other driver features, use odbc:// with Microsoft's ODBC driver (below).
CrateDB:
# Basic format
# Examples
TinyETL detects CrateDB and creates decimal columns as NUMERIC(38,10), since CrateDB needs a precision and scale.
DuckDB:
# File path (table name inferred from filename without extension)
# Explicit table name using # separator
# Reading from DuckDB table
ODBC:
odbc:// works with any database that has an ODBC driver. Everything after odbc:// up to the last # is passed to the driver unchanged, and the text after # is the table (table, or schema.table).
# SQL Server (Microsoft ODBC Driver 18)
# SQL Server with Windows Authentication
# PostgreSQL (psqlODBC)
# MySQL / MariaDB (MariaDB Connector/ODBC also works with MySQL servers)
# SQLite (SQLite ODBC driver)
# A DSN configured in odbc.ini, or a driver library given by path
How it works:
- Reading runs one
SELECT * FROM <table>and streams the rows. Column types come from the driver, so integers, decimals, booleans and dates keep their types - Writing creates the table if it doesn't exist, using column types for the database the driver reports: SQL Server, PostgreSQL, MySQL/MariaDB and SQLite get the same types as TinyETL's native connectors; other databases get standard ANSI SQL types (
VARCHAR(4000),BIGINT,DECIMAL(38,10),BOOLEAN,DATE,TIMESTAMP). To control the types, create the table yourself first. Rows are inserted in batches with ODBC parameter arrays inside one transaction, committed at the end - Identifiers are quoted the way the driver reports (
"name"for most databases,`name`for MySQL) - Text is exchanged with the driver as UTF-16, so any Unicode text works
Tested with SQL Server (ODBC Driver 18), PostgreSQL (psqlODBC), MySQL (MariaDB Connector/ODBC) and SQLite (SQLite ODBC Driver); see test_env/odbc/. Other databases (Oracle, DB2, Snowflake, …) should work through the ANSI fallback but haven't been tested.
ODBC Driver Requirements:
TinyETL includes the ODBC driver manager, so you only need the driver for your database. You do not need to install unixODBC.
- Windows: Drivers are typically pre-installed or available via vendor installers. TinyETL uses the driver manager built into Windows. Non-ASCII text on Windows hasn't been tested yet
- macOS: Install drivers via Homebrew (e.g.
brew install microsoft/mssql-release/msodbcsql18,brew install psqlodbc). TinyETL finds drivers registered in Homebrew'sodbcinst.iniautomatically. Oracle's MySQL Connector/ODBC for macOS is built for the iODBC driver manager and needslibiodbcinstalled; the MariaDB driver doesn't - Linux: Install drivers via your package manager (
apt install odbc-postgresql odbc-mariadb libsqliteodbc, Microsoft'smsodbcsql18). Drivers registered by file name in/etc/odbcinst.ini, as Debian and Ubuntu do, are found in/usr/lib/<arch>/odbc/when you name them withDriver=. For a DSN inodbc.ini, give itsDriveras a full library path (or setLD_LIBRARY_PATH=/usr/lib/<arch>/odbc) - Drivers and DSNs are read from
odbcinst.ini/odbc.iniin/etc, or from the directory in theODBCSYSINIenvironment variable if set. You can also skip registration and give the driver's library path:Driver=/path/to/libdriver.so
Important ODBC Notes:
- Always quote ODBC connection strings to prevent shell interpretation
- Put values containing
;in braces, e.g.PWD={pa;ss} - The database must exist before using TinyETL
- For SQL Server driver names:
ODBC Driver 18 for SQL Server(latest),ODBC Driver 17 for SQL Server, orSQL Server(older). Driver 18 encrypts by default; addTrustServerCertificate=yesfor servers with self-signed certificates
Snowflake:
# Format
snowflake://user[:password]@account/database/schema?warehouse=WH[&role=ROLE]#table
# Load a file into a table (created if it doesn't exist)
# Replace the table's rows instead of appending
# Export a table (or schema.table / database.schema.table)
- Account: the account identifier,
ORGNAME-ACCOUNTNAME(or a legacy locator such asxy12345.us-east-1).SELECT CURRENT_ORGANIZATION_NAME() || '-' || CURRENT_ACCOUNT_NAME()shows it - Authentication: use key-pair authentication; Snowflake is phasing out password-only sign-in, especially for service users. Point TinyETL at an unencrypted or passphrase-protected PKCS#8 private key with
SNOWFLAKE_PRIVATE_KEY_PATH(andSNOWFLAKE_PRIVATE_KEY_PASSPHRASE), or with theprivate_key_path/private_key_passphraseoptions in a YAML config. Alternatively, put a password or programmatic access token in the URL, or pass it with--source-secret-id/--dest-secret-id. A key wins over a password - Loading: rows are written to Zstandard-compressed CSV files (several times smaller than gzip, since the upload is usually the slow part), uploaded to the table's own stage (
@%table, so noCREATE STAGEprivilege is needed) and loaded with oneCOPY INTOat the end. The load, and theDELETEfor--truncate, run in one transaction: if anything fails, the table keeps its old rows. Memory use stays flat, since each staged file (500,000 rows by default) is uploaded as soon as it's full - Azure and Google Cloud accounts: TinyETL can only upload to stages on AWS-hosted accounts so far. On other clouds it detects this and loads with batched
INSERTstatements instead, which works but is slower and uses more warehouse time. Reading works on every cloud - Reading streams the result of
SELECT * FROM <table>. NUMBER, FLOAT, BOOLEAN, DATE, TIMESTAMP and VARIANT/OBJECT/ARRAY (as JSON) keep their types; other types are read as text - Names: plain names (letters, digits,
_,$) are left unquoted, so Snowflake stores them upper-case: a CSV columncustomer_idbecomesCUSTOMER_ID, which you can query ascustomer_id, and reading the table back givesCUSTOMER_ID. Names with other characters are quoted and keep their exact case - Column types for new tables:
VARCHAR,NUMBER(38,0),NUMBER(38,10),BOOLEAN,DATE,TIMESTAMP_NTZ(TinyETL's timestamps are UTC) andVARIANTfor JSON. To choose your own types, create the table first
YAML options for Snowflake endpoints (under source.options / target.options):
| Option | Default | Meaning |
|---|---|---|
private_key_path |
SNOWFLAKE_PRIVATE_KEY_PATH |
Private key for key-pair auth |
private_key_passphrase |
SNOWFLAKE_PRIVATE_KEY_PASSPHRASE |
Passphrase of an encrypted key |
warehouse, role |
from the URL | Override the URL's values |
load_method |
auto |
auto (stage on AWS, INSERT elsewhere), stage or insert |
stage_file_rows |
500000 |
Rows per staged file |
See examples/22_snowflake for a complete setup, from creating a key pair to a test run.
Important Notes:
- Tables are created if they don't exist; the database (and schema) must already exist
- Existing tables are appended to;
--truncatereplaces their rows - Each load runs in one transaction (PostgreSQL, MySQL, SQLite, DuckDB, SQL Server, ODBC, Snowflake): if the transfer fails, the table keeps its previous rows, including with
--truncate. CrateDB has no transactions, so a failed load there can leave a partial table - Reading runs one
SELECT * FROM <table>and streams the rows, so memory stays flat for any table size - 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), CrateDB (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
How it works: --source-secret-id ID reads the environment variable TINYETL_SECRET_ID and sets it as the password in the source URL (--dest-secret-id does the same for the target). The ID is any name you choose, such as prod_db. It works for URL-style connection strings (postgres://, mysql://, mssql://, snowflake://); for odbc://, put the password in the connection string or a DSN, and for S3 use the AWS variables.
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 Conversion: Lua values are converted back to TinyETL types (see below)
- Error Handling: Transformation errors stop the process with clear error messages
Available Data Types
- Strings:
"text"or'text' - Numbers:
42,3.14(Lua integers become integers, other numbers become decimals) - Booleans:
true,false - Null:
nil(becomes NULL in target) - Dates: Passed to Lua as RFC 3339 strings (
2024-01-15T10:30:00+00:00), returned as strings - JSON: Passed to Lua as JSON text
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.How types are inferred: column types come from the first 1,000 rows. A column whose values all have one type gets that type; whole and fractional numbers together (
84,29.85) make a decimal column; any other mix makes a text column. Blank values (empty or whitespace only) don't count. While copying, every value is converted to its column's type: numbers in a text column become text, text that parses in a numeric, boolean, date or JSON column is converted, and blank values in non-text columns become NULL. A later value that can't be converted (abcin an integer column) is written unchanged where the target allows it (files, SQLite) and fails with the column name on typed databases such as PostgreSQL. Use a schema file to fix the types up front.
schema.yaml:
columns:
- name: "id"
type: "Integer"
nullable: false
- name: "email"
type: "String"
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
Type names are case-insensitive:
- String - Text values, supports regex pattern validation
- Integer - Whole numbers (64-bit signed)
- Decimal - Exact decimal numbers (
rust_decimal, up to 28 significant digits) - Boolean -
true/false - Date, DateTime - Dates and timestamps (values are UTC)
- Json - JSON values; text in a Json column is parsed as JSON
Schema Field Properties
| Property | Type | Required | Description |
|---|---|---|---|
name |
String | ✅ | Column name (must match source data) |
type |
String | ✅ | Data type: String, Integer, Decimal, Boolean, Date, DateTime, Json |
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 Checking:
- Each value must already have the column's type. CSV values are typed as they're read: whole numbers, decimals,
true/falseand dates are recognized; anything else is text - Text in a
Jsoncolumn is parsed as JSON - A mismatch (
yesin a Boolean column,abcin an Integer column) stops the transfer with the column name
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
- Write patterns in single quotes (
pattern: '^\d{4}$'): in double-quoted YAML strings,\dis an invalid escape
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: "String"
nullable: false
- name: "email"
type: "String"
nullable: false
pattern: '^[\w\.-]+@[\w\.-]+\.[a-zA-Z]{2,}$'
- name: "phone"
type: "String"
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: "String"
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
# Optional source-specific options (e.g., for HTTP sources)
# options:
# header.User-Agent: "TinyETL/0.11.1"
# header.Accept: "text/csv"
# auth.basic.username: "user"
# auth.basic.password: "${PASSWORD}"
# auth.bearer: "${BEARER_TOKEN}"
target:
uri: "employees_output.json" # or database connection string
# Optional target-specific options
# options:
# region: "us-east-1" # e.g. S3 target (s3://bucket/path/file.parquet)
# access_key_id: "${AWS_ACCESS_KEY_ID}"
# secret_access_key: "${AWS_SECRET_ACCESS_KEY}"
# 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 # Not implemented yet; has no effect
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
Source and Target Options
TinyETL supports connector-specific options that can be passed to sources and targets. These options are particularly useful for HTTP sources that require authentication or custom headers.
HTTP Source Options
When reading from HTTP/HTTPS URLs, you can specify authentication and custom headers:
version: 1
source:
uri: "http://api.example.com/data.csv"
options:
# Custom headers (prefix with "header.")
header.User-Agent: "TinyETL/0.11.1"
header.Accept: "text/csv"
header.X-API-Version: "v2"
# Basic authentication
auth.basic.username: "myuser"
auth.basic.password: "${API_PASSWORD}"
# OR Bearer token authentication
# auth.bearer: "${API_TOKEN}"
target:
uri: "output.json"
options:
batch_size: 1000
Available HTTP Options:
header.{HeaderName}- Add custom HTTP headers (e.g.,header.User-Agent,header.Accept)auth.basic.username- Username for HTTP Basic authenticationauth.basic.password- Password for HTTP Basic authenticationauth.bearer- Bearer token for token-based authentication
Security Best Practice: Use environment variables for sensitive values like passwords and tokens:
source:
uri: "https://api.example.com/data"
options:
auth.bearer: "${API_TOKEN}" # Read from environment variable
See Example 18: HTTP with Authentication for complete working examples.
S3 Options
s3://bucket/path/file.ext works as both a source and a target for CSV, JSON, JSON Lines, Parquet, Avro and Excel (.xlsx) files:
Settings are read from the standard AWS environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN, AWS_REGION, AWS_ENDPOINT, AWS_ALLOW_HTTP). On AWS infrastructure, IAM roles (EC2 instance profiles, ECS task roles, web identity) are picked up automatically. In a YAML config, each endpoint can override them:
version: 1
source:
uri: "s3://my-bucket/raw/orders.csv"
options:
region: "eu-west-1"
access_key_id: "${S3_ACCESS_KEY_ID}"
secret_access_key: "${S3_SECRET_ACCESS_KEY}"
target:
uri: "s3://other-bucket/exports/orders.parquet"
options:
endpoint: "https://<account-id>.r2.cloudflarestorage.com" # S3-compatible stores
access_key_id: "${R2_ACCESS_KEY_ID}"
secret_access_key: "${R2_SECRET_ACCESS_KEY}"
Available S3 Options:
region- AWS region of the bucket (defaults tous-east-1)endpoint- Custom endpoint URL for S3-compatible storesaccess_key_id,secret_access_key,session_token- Static credentialsallow_http- Allow non-TLS endpoints (true/false; implied by anhttp://endpoint option)path_style-truefor path-style requests (the default),falsefor virtual-hosted-style
Behavior and limitations:
- One object per source or target; prefixes and wildcards are not supported
- The file format comes from the object key's extension (sources can override it with
--source-type) - Data is staged in a local temporary file, so the machine needs free disk space for the object
- Writing replaces an existing object. The upload happens once the transfer has finished, so a failed run leaves the existing object untouched
- The credentials need
s3:ListBucketon the bucket ands3:GetObject/s3:PutObjecton its objects (the target checks whether the object exists before writing) - Profiles in
~/.aws/credentials/~/.aws/configand AWS SSO are not read; use environment variables instead --source-secret-id/--dest-secret-iddo not apply to S3 URLs
See Example 19: S3 for a complete working example.
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
$ tinyetl sales.csv "sales.db#sales" --transform "total=row.amount * row.quantity"
INFO tinyetl::transfer: → Connecting to source: sales.csv
INFO tinyetl::transfer: → Connecting to target: sales.db#sales
INFO tinyetl::transfer: → Inferring schema from source...
INFO tinyetl::transfer: → 8 columns detected
INFO tinyetl::transfer: → Transformation enabled
INFO tinyetl::transfer: → Schema updated by transformations: 9 columns
INFO tinyetl::transfer: → Creating target table: sales
INFO tinyetl::transfer: → Copying 100000 rows
INFO tinyetl::transfer: → Done in 1.0s
INFO tinyetl: Transfer completed successfully!
INFO tinyetl: Processed 100000 rows in 0.98s (101586 rows/sec)
(Timestamps trimmed. A progress bar is shown while copying.)
Performance
An 8-column CSV converted on an Apple M4 Pro with the default batch size. Times are for 1,000,000 rows (83 MB); peak memory is shown for 1M and 10M rows (843 MB):
| Target | Time (1M rows) | Rows/sec | Peak memory, 1M rows | Peak memory, 10M rows |
|---|---|---|---|---|
| CSV | 2.9 s | 345k | 32 MB | 32 MB |
| Parquet | 2.9 s | 345k | 58 MB | 70 MB |
| JSON Lines | 3.4 s | 294k | 32 MB | 32 MB |
| DuckDB | 3.6 s | 278k | 118 MB | 218 MB |
| JSON | 3.8 s | 263k | 32 MB | 32 MB |
| Avro | 4.4 s | 227k | 47 MB | 47 MB |
| SQLite | 7.2 s | 139k | 53 MB | 58 MB |
| Excel (.xlsx) | 7.3 s | 137k | 33 MB | (Excel's limit is 1,048,576 rows) |
Every source and file target streams: rows are read and written a batch at a time, so memory stays flat as files grow. Reading the 10M-row Parquet, JSON or Avro file back to CSV peaks at 31–79 MB. Excel is the exception on the read side: a sheet is loaded whole. Network databases and warehouses depend mostly on the server and the network.
Roadmap
Done:
- Files: CSV, JSON, JSON Lines, Parquet, Avro, Excel, streamed with flat memory ✅
- Databases: SQLite, DuckDB, PostgreSQL, MySQL, SQL Server, CrateDB, any ODBC driver ✅
- Snowflake (staged bulk loads) ✅
- Remote files over HTTP(S), SSH and S3 ✅
- Schema inference, schema files, Lua transforms, YAML jobs ✅
Next:
- Databricks and OneLake
--skip-existing(the flag exists but has no effect yet)- 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 (Excel)
- Chris Riccomini @criccomini
- Andreas Motl @amotl (CrateDB)
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.
Bundled third-party libraries: to keep the binary free of runtime dependencies, the Linux and macOS binaries statically link the unixODBC driver manager (2.3.14), licensed under the GNU LGPL v2.1 or later, the Linux binary also includes OpenSSL (Apache License 2.0), and every binary includes AWS-LC (ISC/Apache-2.0, used for TLS by the Snowflake client). They are not covered by TinyETL's license, and the commercial terms above do not apply to them. Their license texts ship with every download, and THIRD_PARTY_LICENSES.md explains where to get their source and how to rebuild TinyETL against a modified unixODBC.
Built with Rust for performance, safety, and reliability.