✔️ Introducing DBML Check Constraints — Enforce Data Rules with Ease
Great news! We've added support for Check constraints, allowing you to set rules on your table fields to enforce data quality—such as ensuring quantities are above zero or ratings stay within a range.
Here's a simple DBML example:
Table orders {
id integer [pk, increment]
price decimal [not null, check: `price > 0`]
discount decimal [not null, default: 0, check: `discount >= 0`]
checks {
`discount < price` [name: 'valid_discount']
}
}
Previously, these had to go in notes, which meant they could disappear during SQL imports or exports. Now, define them right in DBML, import and export with accuracy, and view them in your ER diagrams and docs for clearer sharing.

It's a simple way to make your databases more reliable and your documentation more informative. Update your docs now and start applying Check constraints!
We hope these enhancements improve your database design and communication experience. Try them out and let us know what you think.