You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A line starting with - continues the expression on the line above #1006
In an element body, a line that starts with an operator such as - is parsed as a continuation of the previous line's expression, even when that line is complete on its own (and across a blank line). For example, a Records row that starts with a negative number fails unless it is the first row:
Table scores {
id int
delta int
}
Records scores(id, delta) {
1, 5
-2, 7
}
fails with "Records can only contain simple values (literals, null, true, false, or enum references). Complex expressions are not allowed." on the -2, 7 line, because it is read as 5 - 2, 7. The same rows in the other order (-2, 7 first) export fine.
The parser already stops ( at the start of a line outside () and [] (expression_bp in packages/dbml-parse/src/core/parser/parser.ts), but an infix operator continues across the newline. Applying the same rule to every infix operator breaks 10 existing parser tests (fuzz tests on refs among them), so the fix probably has to be limited to element bodies, as discussed in #172.
This also blocks the -col syntax agreed in #172: -created_at on any line but the first of an Indexes block is read as a subtraction from the line above.
Activity
Roshan1299 commentedon Oct 17, 2026
Hi @huydo862003 , I've opened a PR here:#1007 - would appreciate a review when you get a chance!
huydo862003 commentedon Oct 17, 2026
@Roshan1299 Hi, thank you for your PR! I'll have a look into it next week!