Import & Export
Ainecto reads and writes several common formats so you can move schemas in and out without lock-in.
SQL Import
Paste a CREATE TABLE script and Ainecto parses it into tables, columns, indexes, and foreign keys.
Supported dialects:
- MySQL / MariaDB
- PostgreSQL
- Oracle
- SQL Server
How to use:
- Open or create a diagram
- Choose Import → SQL from the diagram menu
- Paste your DDL
- Review the preview, then Import
The import is batch-based — all tables, columns, indexes, and refs are committed atomically. A version snapshot is created automatically with the description "Imported from SQL".
SQL import is gated by plan. Free tier has a limited number of imports; paid tiers have no limit.
What gets parsed
| Element | Imported? |
|---|---|
CREATE TABLE (columns, types, constraints) | ✓ |
| Primary keys | ✓ |
| Unique constraints | ✓ |
Foreign keys (REFERENCES) | ✓ |
Indexes (CREATE INDEX, KEY ...) | ✓ |
| Default values | ✓ |
CHECK constraints | Partial (display only) |
| Triggers, stored procedures, views | Not imported |
If parsing fails on a specific statement, the importer reports the line and continues with the rest. You can fix the source and re-import.
DBML Export
DBML (Database Markup Language) is a clean text format for ERDs. Ainecto can export the current diagram as DBML:
GET /api/diagrams/{uuid}/dbml
In the app, use Export → DBML from the diagram menu.
DBML round-trips well with other tools like dbdiagram.io.
SQL Export
Generate CREATE TABLE statements for the current diagram in your chosen dialect:
- MySQL / MariaDB
- PostgreSQL
- Oracle
- SQL Server
Use Export → SQL and pick the dialect. The output respects column order, indexes, and foreign keys.
Image Export
For sharing in slides or docs:
| Format | Use case |
|---|---|
| PNG | Embedding in docs, Slack, Notion, etc. |
| SVG | Crisp scaling for presentations and print |
Both export the current canvas viewport (or the full diagram, your choice). Use Export → PNG or Export → SVG.
Round-trip workflows
A common workflow:
- Import an existing production schema with SQL Import
- Refine the diagram visually or via AI
- Generate migrations by exporting SQL and diffing against the original
Or for greenfield projects:
- Use Natural Language → ERD to bootstrap
- Refine on the canvas
- Export SQL for your migration tool of choice