by codeptualize · 3y ago · 0 comments
I guess it's a good example of how powerful Rust is. The "magic" that sqlx does at compile time gets really difficult if not impossible to do without macros.
Of course you could create a separate parser/builder, and codegen works as well, but definitely not as convenient and flexible.
caveat: I'm an ex-DBA so I'm comfortable with building complex tables, relationships and queries. Less familiar folks might struggle building the tables, relationships, and doing joins, ctes etc.
There are derives involved, of course, so that probably counts as macros.