Hacker News new | ask | show | jobs
by zo1 3450 days ago
Code generation is a big one for me. A nice thing I like doing is defining "interfaces" for a particular database table, along with the tables definition in a particular format. Then I can generate any kind of access to that table I'm willing to spend time on creating a generator for.

I'm still hoping to find a decent "SQL flavor" interpreter and/or translator. That would be a killer feature, allowing me to define "procs" in vanilla ANSI SQL, and translate them into whatever database's SQL format I need without worrying too-much about syntax and optimizing. Because you know, it's 2016, and I still need to know that fetching N rows of results from a table has multiple syntax forms depending on your chosen database and version.

1 comments

Code generation used to annoy me a lot for some reason, in Java land, I guess that was back when Ant was used and code generation made the build process a bit more annoying. Also somewhat rigid.

I wonder if some of the ORM's would get you to a bit closer to the cross-platform proc. They need to know all of the variances of the db's in terms of the syntax I guess, but I doubt you'd ever get to a stage of writing cross-db stored procs that compiled to TransactSQL etc... or whether the effort would be worth it.

Have you had to do that? i.e. write the same functionality in two different databases as a stored proc? I guess software vendors might face that. I'd probably push the logic back into the app code if possible, unless the amount/processing of data precludes it for whatever reason.