2 ms·
> SQL query strings compose very badly Can you explain? I have no problem and have used or written my own SQL composition libraries pretty easily. It is code
by r00fus 13y ago
> SQL query strings compose very badly
Can you explain? I have no problem and have used or written my own SQL composition libraries pretty easily. It is code-composition, no doubt, but the BNF for SQL is very easy to grok even given the variations in platform.
- mercurial 13y agoRaw SQL is terrible when you need something a bit complicated. Want to do a complex search? Unfortunately, your coworker forgot an " AND " in a little-used function, which is going to blow up on you at runtime. Or maybe you didn't count the placeholders right and you inserted the wrong numbers values. Can you make that work for you with a library? Sure. But on its own, it's just bad. On the other hand, SQLAlchemy's query API is quite nice, and composes just fine.
- vertex-four 13y agoSQLAlchemy Core provides a rather decent DBAL for that, so you might not have to write your own libraries, while you don't have to use an ORM.