~/devreads

#dynamic sql

7 posts

11 Mar 2021

6 Mar 2020

lukaseder 1 min read

When using jOOQ to create dynamic SQL statements (one of jOOQ’s core value propositions), it is often necessary to add query elements conditionally, with a default “No-op” behaviour. For first time users, this default “no-op” behaviour is not always obvious as the jOOQ API is vast, and as with any vast API, there are many … Continue reading Create Empty…

jooq-in-useconditional sql clausesdynamic sqlempty sql clausesjooq

4 Mar 2020

lukaseder 1 min read

jOOQ supports a vast amount of SQL syntax out of the box. As such, most users will not think of resorting to string concatenation like in the old days when writing dynamic SQL with JDBC. But every now and then, a vendor specific feature is not supported by jOOQ (yes, it happens). In that case, … Continue reading Never Concatenate…

jooq-in-usedynamic sqljooqplain sqlplain sql templating

13 Apr 2018

lukaseder 1 min read

In a previous blog post, I wrote about why you should (almost) always default to using bind variables. There are some exceptions, which I will cover in another follow-up post, but by default, bind variables are the right choice, both from a performance and from a security perspective. In this article, I will show an … Continue reading When Using…

sqlbind variablescursor cachedynamic sqlexecution plan cache

25 Jul 2017

lukaseder 1 min read

jOOQ has been around for a while now (since 2009!) and by now we can say we’ve seen quite a bit of things about the SQL and Java languages. Some of our design decisions are particular in the way jOOQ thinks about programming with SQL. These include: Nullability (let’s stop fighting it) Value types (let’s … Continue reading 5 Things…

jooq-developmentsqldynamic sqlfunctional relational mappingjooq

9 Jun 2017

lukaseder 1 min read

It was hard to limit ourselves to 10 Nice Examples of Writing SQL in Kotlin With jOOQ, recently, because the Kotlin language has many nice little features that really help a lot when working with Java libraries. We’ve talked about the nice with() stdlib function, which allows to “import” a namespace for a local scope … Continue reading Using Kotlin’s…

kotlindynamic sqljavajooq

16 Jan 2017

lukaseder 1 min read

Typesafe embedded DSLs like jOOQ are extremely powerful for dynamic SQL, because the query you’re constructing with the jOOQ DSL is a dynamic query by nature. You’re constructing a query expression tree using a convenient API (the “DSL”), even if you think your SQL statement is static. For instance: The above query looks like a … Continue reading A Functional…

jooq-in-usedsldynamic sqlembedded dsljooq