Available in versions: Dev (3.21) | Latest (3.20) | 3.19 | 3.18 | 3.17 | 3.16 | 3.15 | 3.14 | 3.13 | 3.12 | 3.11
Plain SQL
Applies to ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
A DSL is a nice thing to have, it feels "fluent" and "natural", especially if it models a well-known language, such as SQL.
But an internal DSL comes with two main limitations:
- It is limited by what is defined explicitly as formal API, unlike external DSLs, which can be supported completely as unchecked
String
types. - It has to follow the rules of the host language (Java in this case), and thus cannot mimick the equivalent external DSL to 100%.
We have seen a few functionalities where the DSL becomes a bit verbose. This can be especially true for:
The use-cases for jOOQ where verbosity or missing functionality is a problem are rather rare, and when they come up, you do have an option. Just write SQL the way you're used to using "plain SQL."
Table of contents
- 3.16.1.
- Plain SQL API
- 3.16.2.
- Plain SQL templating language
- 3.16.3.
- Plain SQL raw templates
previous : next |
References to this page
- jOOQ as a SQL builder without code generation
- The WITH clause
- Scalar functions
- Building conditional expressions
- The LIKE predicate
- SQL injection
- Custom data type bindings
- Plain SQL QueryParts
- Security considerations
- Features requiring generated code
- API validation using the Checker Framework or Error Prone
Feedback
Do you have any feedback about this page? We'd love to hear it!