- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Might be YodaSQL
Edit Admin
I like it. Twice as much WTF for my money today.
Admin
I presume jOOQ is an acceptable builder. I'm a fan.
Admin
Perhaps I'm missing something, so please educate me: how is using a SQL builder NOT "just concatenation with extra steps"? I mean, at the end of it all, it's just going to emit the query as a string, right?
Admin
It checks variable types and escapes/quotes properly.
Edit Admin
It's all about abstraction levels.
Edit Admin
I mean, yes, the final output is a string, so at some level, it's going to emit a string of characters, thus making anything "concatenation with extra steps". But, if you have a decent builder API, what it absolutely prohibits is constructing invalid statements: you construct the syntax tree as a data structure, manipulate it, and then only when it goes to the database, do you convert it to SQL. The canonical representation is the syntax, not the string, and it's an exception to construct anything but a valid statement.