LanguageTables
Tables
A table is a name, an optional description, and its columns between braces.
table orders "Customer orders" { id bigint pk placed_at datetime }
Names and descriptions
Table names are unique within a document, external tables included. The description, in double quotes, is for people: it shows next to the name in the diagram and in the side panel, and resin reads nothing into it.
A short table can sit on one line:
table tags { id bigint pk }
resin fmt writes it over three lines, as every other table.
Statements end at the line
A newline ends a statement, so every column sits on a line of its own. Inside parentheses newlines are ignored, which lets a long enum(...) wrap:
table payments { id bigint pk method varchar enum( CARD, BANK_TRANSFER, ) }
Other kinds of table
- External tables live outside the document: in another service, or another database.
- Audit tables are generated by
audit envers.
Comments#
%%starts a comment that runs to the end of the line. See Names and comments.