by oftenwrong · 5y ago · 0 comments
---
And on a different topic:
The Java SQL/database library, jOOQ [1] comes with a code generator that allows you to generate Java classes corresponding to your schema. This is pretty cool because it enables type-safe query building. It's a bit like connecting Java's type system to the database's type system. I find this to be really useful for ensuring correctness.
And if you're taking the approach from the first half of my comment, you can generate code any versions of the schema you need in the application.
[1] https://www.jooq.org/ jOOQ is really cool for a lot of reasons. The code generator is just one piece of it. For example, it can be used to translate between different vendors' dialects.
No comments yet.