MySQL to reStructuredText Converter
Transform MySQL database dumps into reStructuredText table format for Sphinx documentation and Python projects
MySQL Input
Convert MySQL to other formats
reStructuredText Output
Related Tools
MySQL to Ruby
Convert MySQL CREATE TABLE and INSERT statements to Ruby arrays, hashes, and Struct objects for Rails applications
MySQL to SQL
Convert MySQL CREATE TABLE and INSERT statements to other SQL dialects (PostgreSQL, SQLite, SQL Server)
MySQL to Textile
Convert MySQL CREATE TABLE and INSERT statements to Textile markup format for Redmine and Textpattern
MySQL to TOML
Convert MySQL CREATE TABLE and INSERT statements to TOML configuration file format
MySQL to TracWiki
Convert MySQL CREATE TABLE and INSERT statements to TracWiki table markup format for Trac project management
MySQL to XML
Convert MySQL CREATE TABLE and INSERT statements to XML format with customizable structure and formatting
About MySQL to reStructuredText Converter
Convert MySQL database dumps (CREATE TABLE and INSERT statements) to reStructuredText table format for use in Python documentation, Sphinx projects, ReadTheDocs, and technical writing. reStructuredText (RST) is a lightweight markup language commonly used in the Python ecosystem.
Key Features
- Grid Tables: Robust format with borders, supports multi-line cells
- Simple Tables: Clean, minimal syntax for straightforward tables
- Header Support: Optional header rows with = separator
- Auto-sizing: Automatically calculates optimal column widths
- Sphinx Compatible: Works perfectly with Sphinx documentation generator
- Smart Parsing: Extracts column names and data from MySQL dumps
- File Download: Save as .rst file
How to Use
- Input MySQL Data: Paste your MySQL CREATE TABLE and INSERT statements or upload a .sql file
- Choose Table Style: Select grid table (robust) or simple table (clean)
- Configure Header: Toggle header row with = separator
- Copy or Download: Use the Copy or Download button to save your RST table
Table Styles
- Grid Table: Uses +, -, |, and = characters to create bordered tables with full support for multi-line cells
- Simple Table: Uses = characters for separators, cleaner syntax but limited to single-line cells
Example Conversion
MySQL Input:
CREATE TABLE employees ( id INT, name VARCHAR(100), age INT, city VARCHAR(50) ); INSERT INTO employees VALUES (1, 'John Doe', 28, 'New York'); INSERT INTO employees VALUES (2, 'Jane Smith', 34, 'London');
reStructuredText Output (Grid Table):
+----+------------+-----+----------+ | id | name | age | city | +====+============+=====+==========+ | 1 | John Doe | 28 | New York | +----+------------+-----+----------+ | 2 | Jane Smith | 34 | London | +----+------------+-----+----------+
reStructuredText Output (Simple Table):
== ============ === ========== id name age city == ============ === ========== 1 John Doe 28 New York 2 Jane Smith 34 London == ============ === ==========
Common Use Cases
- Python Documentation: Document database schemas in Python projects
- Sphinx Projects: Include database tables in Sphinx-generated documentation
- ReadTheDocs: Display MySQL data in ReadTheDocs documentation
- Technical Writing: Create technical documentation with database examples
- API Documentation: Document database structures in API docs
- PEPs: Include tables in Python Enhancement Proposals
Sphinx Integration
The generated reStructuredText tables work seamlessly with Sphinx:
- Automatic Rendering: Sphinx automatically renders RST tables as HTML
- Theme Support: Tables adapt to your Sphinx theme
- Cross-references: Can be referenced from other documentation pages
- PDF Export: Tables are included in PDF documentation builds
Grid vs Simple Tables
Grid Tables:
- More robust and flexible
- Support multi-line cells
- Clear visual structure with borders
- Better for complex data
Simple Tables:
- Cleaner, more minimal syntax
- Easier to edit manually
- Better for simple, single-line data
- More readable in plain text
Supported MySQL Syntax
- CREATE TABLE: Extracts column names for table headers
- INSERT INTO: Parses data values from INSERT statements
- Data Types: Handles all MySQL data types (VARCHAR, INT, DECIMAL, etc.)
- Quoted Strings: Handles single and double quotes with proper escaping
reStructuredText Resources
- Sphinx: Python documentation generator (sphinx-doc.org)
- ReadTheDocs: Documentation hosting platform (readthedocs.org)
- Docutils: reStructuredText processing system
- Python PEPs: Python Enhancement Proposals use RST
FAQ
- Do I need both CREATE TABLE and INSERT statements? The converter works best with both, but if only INSERTs are present it will infer headers or generate generic column names for the table.
- Which table style should I choose? Use grid tables for complex or multi-line content and when you want strong visual borders; use simple tables for smaller, single-line datasets and more compact source files.
- Can I edit the table after generation? Yes. The output is plain RST text, so you can tweak headers, adjust widths, or add narrative around the table directly in your documentation source.
- Is the output portable between Sphinx and other RST tools? Yes. Both grid and simple tables are standard reStructuredText constructs supported by Sphinx, Docutils, and typical RST toolchains.
- Is my SQL data transmitted anywhere? No. All parsing and conversion occur locally in your browser; the MySQL dump is not uploaded.
Privacy & Security
All conversions happen locally in your browser. Your MySQL data is never uploaded to any server, ensuring complete privacy and security.
