|
|
|
|
|
by jhh
4733 days ago
|
|
One advantage is that the compiler checks your queries. In case of the jOOQ library, it also makes your queries typesafe and abstracts away some specifics of SQL dialects. Having typesafety transcend from the database to your "main" language is of advantage so long as you are using a statically typed language anyway. All this is possible while maintaining much of the expressive power of SQL. |
|
Essentially, I'm deeply uneasy about embedding translators from one language into another. As an example, not many people like using BigDecimal to describe arithmetic operations, despite it having a fluent syntax and improved type safety (e.g. around implicit conversions) compared to just writing an expression.