SQL to YAML Converter

Transform SQL database dumps into YAML (YAML Ain't Markup Language) format for configuration files, Kubernetes, Docker Compose, and modern applications

SQL Input

YAML Output

About SQL to YAML Converter

Convert SQL database dumps (CREATE TABLE and INSERT statements) to YAML (YAML Ain't Markup Language) format. Perfect for Kubernetes configurations, Docker Compose files, Ansible playbooks, and modern application config files.

Key Features

  • Array Format: List of items with - prefix
  • Object Format: Named objects with key: value pairs
  • Automatic Type Detection: Detects numbers, booleans, strings, and null
  • Configurable Indentation: Choose 2, 3, or 4 spaces
  • YAML 1.2 Compliant: Generates valid YAML according to specification
  • Smart String Quoting: Automatically quotes strings when needed
  • File Download: Save as .yaml or .yml file

How to Use

  1. Input SQL Data: Paste your SQL CREATE TABLE and INSERT statements or upload a .sql file
  2. Select Output Format: Choose between Array or Object format
  3. Adjust Indentation: Set indent size (2-4 spaces)
  4. Copy or Download: Use the Copy or Download button to save your YAML data

Output Format Options

  • Array Format: Each row becomes a list item, best for sequences
  • Object Format: Each row becomes a named object, best for mappings

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 Format Output:

- id: 1
  name: Laptop
  price: 999.99
  in_stock: true
- id: 2
  name: Mouse
  price: 24.99
  in_stock: false

Object Format Output:

item_0:
  id: 1
  name: Laptop
  price: 999.99
  in_stock: true
item_1:
  id: 2
  name: Mouse
  price: 24.99
  in_stock: false

Common Use Cases

  • Kubernetes: Generate ConfigMaps, Deployments, and Services
  • Docker Compose: Create docker-compose.yml from database
  • Ansible: Generate playbooks and inventory files
  • CI/CD: Create GitHub Actions, GitLab CI, CircleCI configs
  • Configuration Files: Application settings and environment configs
  • OpenAPI/Swagger: Generate API specifications
  • Cloud Formation: AWS CloudFormation templates

Type Detection

The converter automatically determines the appropriate YAML type:

  • Numbers: Integers and floats (1, 2.5, -10)
  • Booleans: true/false, yes/no values
  • Strings: Text values with automatic quoting when needed
  • null: NULL values become null

YAML Advantages

  • Human-Readable: Clean, minimal syntax easy to read and write
  • Whitespace-Significant: Uses indentation for structure
  • No Delimiters: No need for brackets or braces
  • Comments: Supports # comments
  • Multi-Line Strings: Natural multi-line string support
  • Anchors & Aliases: Reuse content with & and *

Compatible Applications

  • Kubernetes: Container orchestration configs
  • Docker: Docker Compose files
  • Ansible: Automation playbooks
  • GitHub Actions: CI/CD workflows
  • GitLab CI: Pipeline configurations
  • CircleCI: Build configurations
  • Swagger/OpenAPI: API specifications
  • Spring Boot: application.yml configs

YAML vs JSON

  • More Readable: YAML is easier for humans to read
  • Comments: YAML supports comments, JSON doesn't
  • Less Verbose: No need for quotes and commas everywhere
  • Multi-Line: Better support for multi-line strings
  • Superset: Valid JSON is valid YAML

Supported SQL Syntax

  • CREATE TABLE: Extracts column names for YAML 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 null

Privacy & Security

All conversions happen locally in your browser. Your SQL data is never uploaded to any server, ensuring complete privacy and security.