2 ms·
On this topic: I'm in the process of making a compiler for a DSL I designed to help with the schema design process. https://gist.github.com/nomsolence/69bc0b5f
by kohtatsu 7y ago
On this topic: I'm in the process of making a compiler for a DSL I designed to help with the schema design process.
https://gist.github.com/nomsolence/69bc0b5fe1ba943d82cd37fdbd23df6d#file-tag-yes-to-the-dress-syrup https://gist.github.com/nomsolence/69bc0b5fe1ba943d82cd37fdb...
Pictured is the compiler internals; the attached .syrup is the DSL. (It started as a tangent on a project I'm doing for my girlfriend, the schema described in the .syrup has been improved a bit since)
Note: things after # are comments.
I find even just defaulting to NOT NULL and not having to worry about commas is a boon for when I create schemas.
The DSL will of course support things like compound primary keys and SQLite's WITHOUT ROWID.
I'll post the code here, likely before the weekend: https://github.com/nomsolence/syrup https://github.com/nomsolence/syrup
- tasogare 7y agoI really like the arrow for foreign keys. That and the intermediate table for n-n relationships (and the associate join queries) are the main pain point of SQL, in comparison to object modeling.