Maowl Open Maowl

Arrange: untangle your database model in one click

Click Arrange in the side panel, under Add table and Add note, and Maowl lays out your model for you. It keeps crossing foreign keys to a minimum and puts your most connected tables in the middle. Tables, foreign key names, and notes never end up on top of each other.

How it decides

Maowl places the tables on a grid and looks for the layout with the fewest crossing foreign keys. Fewer crossings always come first. After that, it favors fewer lines running over other tables, then shorter lines, with your most connected tables closest to the center. Your current layout is always one of the candidates, so Arrange never swaps a good layout for a worse one. The same model always gives the same result.

No overlaps

Once the tables are placed, Arrange spaces everything out until no table, column list, foreign key name, or note covers anything else. Where there's room, a table also moves off any line that runs behind it. A foreign key's name slides along its line, together with its columns, to a clear spot. If it doesn't fit between its tables, those tables move apart to make room. A note moves to the nearest spot where it covers nothing, preferably one where its links don't cross foreign keys or pass under a table. Tables and notes glide into place. A single undo puts everything back.

Which tables move

Arrange works on every visible, unlocked table in the model, no matter what's selected. Locked tables stay where they are, and everything else keeps clear of them. Tables in hidden layers don't move. A note attached to a single table moves with that table. A note attached to a foreign key, or to several tables and foreign keys, moves with the midpoint of what it's attached to.

When Arrange leaves your layout alone

If Arrange can't find a better layout and nothing overlaps, everything stays where it is, so a second click changes nothing.

Placing new tables

When you import a schema file or table definitions, every table is placed so that none of them overlap. When an AI assistant draws or extends a model, Maowl places each new table next to the tables it connects to, with room for the foreign key's name. An assistant never moves tables you've placed unless you ask it to arrange the model.

Related