SQL to AsciiDoc Converter
Transform SQL database dumps into AsciiDoc table markup for technical documentation, books, and articles
SQL Input
AsciiDoc Output
About SQL to AsciiDoc Converter
Convert SQL database dumps (CREATE TABLE and INSERT statements) to AsciiDoc table markup for technical documentation, books, and articles. AsciiDoc is a lightweight markup language widely used for technical writing and documentation.
Key Features
- Multiple Table Styles: Default, grid (all borders), and frame (outer border)
- Column Alignment: Auto-detect, left, center, or right alignment
- Header Support: Optional header row
- Table Titles: Automatically uses table name as title
- Column Specifications: Proper AsciiDoc column syntax
- Smart Parsing: Extracts column names and data from SQL dumps
- File Download: Save as .adoc file
How to Use
- Input SQL Data: Paste your SQL CREATE TABLE and INSERT statements or upload a .sql file
- Choose Table Style: Select default, grid, or frame style
- Set Alignment: Choose auto-detect or specific alignment
- Configure Header: Toggle header row display
- Copy or Download: Use the Copy or Download button to save your AsciiDoc markup
Table Styles
Default:
- Clean, minimal table appearance
- No explicit borders in markup
- Relies on AsciiDoc processor defaults
Grid (all borders):
- Shows all cell borders
- Professional appearance
- Best for complex tables
Frame (outer border):
- Shows only outer table border
- Clean, modern look
- Good for simple tables
Example Conversion
SQL Input:
CREATE TABLE products ( id INT, name VARCHAR(100), price DECIMAL(10,2), category VARCHAR(50) ); INSERT INTO products VALUES (1, 'Laptop', 999.99, 'Electronics'); INSERT INTO products VALUES (2, 'Mouse', 24.99, 'Accessories');
AsciiDoc Output:
.products [cols=">,<,>,<"] |=== |id |name |price |category |1 |Laptop |999.99 |Electronics |2 |Mouse |24.99 |Accessories |===
Alignment Options
Auto-detect:
- Automatically detects numeric columns
- Right-aligns numeric data
- Left-aligns text data
- Recommended for most use cases
Left Alignment (<):
- Default alignment for text
- Best for names and descriptions
Center Alignment (^):
- Balanced visual appearance
- Good for headers and short values
Right Alignment (>):
- Perfect for numeric values
- Aligns decimal points naturally
Common Use Cases
- Technical Documentation: Include database schemas in technical docs
- Books: Write technical books with AsciiDoc and Asciidoctor
- API Documentation: Document database structures
- README Files: Create professional documentation
- GitHub Pages: Use with Jekyll-AsciiDoc plugin
- PDF Generation: Convert to PDF with Asciidoctor-PDF
AsciiDoc Syntax
- Table Delimiter: |=== marks table start and end
- Cell Separator: | character separates cells
- Column Specs: cols attribute defines alignment and width
- Table Title: . prefix creates table caption
- Alignment: < (left), ^ (center), > (right)
AsciiDoc Processors
- Asciidoctor: Modern AsciiDoc processor (Ruby)
- Asciidoctor.js: JavaScript implementation
- Asciidoctor-PDF: Direct PDF generation
- Asciidoctor-EPUB3: EPUB book generation
Supported SQL Syntax
- CREATE TABLE: Extracts column names for table headers
- INSERT INTO: Parses data values from INSERT statements
- Data Types: Handles all SQL data types (VARCHAR, INT, DECIMAL, etc.)
- Quoted Strings: Handles single and double quotes with proper escaping
Integration
The generated AsciiDoc markup works with:
- Asciidoctor: Convert to HTML, PDF, EPUB, and more
- GitHub: Render .adoc files in repositories
- GitLab: Native AsciiDoc support
- Static Site Generators: Jekyll, Hugo with plugins
- IDEs: IntelliJ IDEA, VS Code with extensions
Privacy & Security
All conversions happen locally in your browser. Your SQL data is never uploaded to any server, ensuring complete privacy and security.
