Documentation / ERD schema
Design assistant
Describe a table or a relationship, or give a photo of a schema: the assistant draws a draft in the diagram, which you apply or reject.
The design assistant lives in the ERD schema tab, behind the Assistant button.
What you can ask
Create an invoices table linked to customers.Add an archived_at column to the customers table.Link orders to warehouses.The assistant reads the existing structure before suggesting anything. It follows the conventions of your tables: naming language, case, plural, identifier type.
Start from an image
Drop the photo of a schema into the panel: a whiteboard, a sketch, a screenshot from another tool.
Reproduce the schema in this photo.The assistant transcribes every table, column and relationship it can read, spots the primary keys, and tells you what it could not read.
Note Reading an image requires a model that can see images. OpenDB warns you if the chosen model may not be able to.
The draft
The assistant does not change the database directly. It produces a draft, drawn in the diagram:
- new tables and changed tables;
- added, changed or removed columns, each one marked;
- dropped tables.
A bar summarizes the draft ("2 tables created, 1 changed") and flags anything destructive. You can show or copy the SQL.
Two buttons finish:
- Apply runs the changes;
- Reject discards the draft.
Checks before the draft
Each suggested change is checked against the database, with the same rules as the table designer: does the table already exist, do the referenced columns exist, does the foreign key's type match the referenced column's.
If there is an error, nothing runs: the assistant receives the errors and corrects its suggestion.
Changes are ordered automatically: referenced tables are created before those that reference them, and drops come last.
Apply mode
You choose when an approval is requested, in Settings → AI agent → Structure changes of the ERD assistant.
| Mode | Approval requested |
|---|---|
| Draft to approve | Always. This is the default. |
| Automatic additions | Only if the draft changes or removes something |
| Fully automatic | Never |
Warning In Fully automatic mode, dropping a table or a column runs without confirmation. Keep Draft to approve on a database that holds useful data.
What the assistant does not do
- It never removes what you did not ask it to remove.
- It does not change data, only structure.
- It does not see the tables that are hidden from you.
If a change fails
On PostgreSQL, a failure rolls everything back. On MySQL and MariaDB, the changes that ran before the failure stay applied, and OpenDB tells you which ones.
Unsaved conversation
The exchange with the assistant is not saved as a conversation. It disappears when you leave the tab. To keep a record, ask the agent the same thing in the chat.