Never Again Forget to Call .execute() in jOOQ

jOOQ's DSL, like any fluent API, has one big caveat. It's very easy to forget to call .execute(). And when you do, chances are, you're going to be staring at your code for minutes, because everything looks perfect: ctx.insertInto(T) .columns(T.A, T.B) .values(1, 2); Staring... staring... staring... Why is it not inserting that row? "Aaaah, not … Continue reading Never Again Forget to Call .execute() in jOOQ

Calculating Pagination Metadata Without Extra Roundtrips in SQL

When paginating results in SQL, we use standard SQL OFFSET .. FETCH or a vendor specific version of it, such as LIMIT .. OFFSET. For example: SELECT first_name, last_name FROM actor ORDER BY actor_id OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY As always, we're using the Sakila database for this example. This is rather … Continue reading Calculating Pagination Metadata Without Extra Roundtrips in SQL