SQL to TOML Converter
Transform SQL database dumps into TOML (Tom's Obvious, Minimal Language) configuration format for Rust, Python, and other modern applications
SQL Input
TOML Output
About SQL to TOML Converter
Convert SQL database dumps (CREATE TABLE and INSERT statements) to TOML (Tom's Obvious, Minimal Language) configuration format. Perfect for Rust Cargo.toml, Python pyproject.toml, and other modern configuration files.
Key Features
- Array of Tables: [[table]] format for structured data
- Inline Tables: Compact { key = value } format
- Automatic Type Detection: Detects integers, floats, booleans, and strings
- Custom Table Names: Specify your own table name
- TOML v1.0 Compliant: Generates valid TOML according to specification
- Smart Parsing: Extracts column names and data from SQL dumps
- File Download: Save as .toml file
How to Use
- Input SQL Data: Paste your SQL CREATE TABLE and INSERT statements or upload a .sql file
- Select Output Format: Choose between Array of Tables or Inline Tables
- Configure Table Name: Set a custom table name for your TOML output
- Copy or Download: Use the Copy or Download button to save your TOML data
Output Format Options
- Array of Tables: Each row becomes a [[table]] section, best for configuration files
- Inline Tables: Compact format with all data in one array, best for data lists
Example Conversion
SQL Input:
CREATE TABLE products ( id INT, name VARCHAR(100), price DECIMAL(10,2), inStock BOOLEAN ); INSERT INTO products VALUES (1, 'Laptop', 999.99, true); INSERT INTO products VALUES (2, 'Mouse', 24.99, false);
Array of Tables Output:
[[data]] id = 1 name = "Laptop" price = 999.99 in_stock = true [[data]] id = 2 name = "Mouse" price = 24.99 in_stock = false
Inline Tables Output:
data = [
{ id = 1, name = "Laptop", price = 999.99, in_stock = true },
{ id = 2, name = "Mouse", price = 24.99, in_stock = false }
] Common Use Cases
- Rust Projects: Generate Cargo.toml dependencies or configuration
- Python Projects: Create pyproject.toml configuration
- Configuration Files: Convert database data to config format
- Data Migration: Export SQL data to TOML for modern apps
- Settings Management: Store application settings in TOML
- Hugo Static Sites: Generate config.toml from database
- GitLab CI: Create .gitlab-ci.toml configuration
Type Detection
The converter automatically determines the appropriate TOML type:
- Integers: Whole numbers (1, 42, -10)
- Floats: Decimal numbers (3.14, -0.5, 999.99)
- Booleans: true/false values
- Strings: Text values with proper escaping
- Empty/NULL: Converted to empty strings ""
TOML Advantages
- Human-Readable: Easy to read and write by humans
- Minimal Syntax: Less verbose than JSON or XML
- Strongly Typed: Clear distinction between types
- No Ambiguity: Unambiguous specification
- Modern Standard: Widely adopted in modern tools
Compatible Applications
- Rust: Cargo package manager (Cargo.toml)
- Python: Poetry, pip (pyproject.toml)
- Hugo: Static site generator (config.toml)
- GitLab: CI/CD configuration
- Netlify: Site configuration (netlify.toml)
- Alacritty: Terminal emulator configuration
Supported SQL Syntax
- CREATE TABLE: Extracts column names for TOML keys
- INSERT INTO: Parses data values with type detection
- Data Types: Handles all SQL data types (VARCHAR, INT, DECIMAL, BOOLEAN, etc.)
- Quoted Strings: Handles single and double quotes with proper escaping
- NULL Values: Converted to empty strings
Privacy & Security
All conversions happen locally in your browser. Your SQL data is never uploaded to any server, ensuring complete privacy and security.
