jOOQ
jOOQ copied to clipboard
jOOQ is the best way to write SQL in Java
Most `JSON` and `JSONB` functions are identical in API and functionality. They differ only in terms of data type. In most RDBMS, people will just use `JSON` (in text format,...
It appears that this functionality is soon ready: https://github.com/cockroachdb/cockroach/issues/58356#issuecomment-1234581911 So, we should support UDFs: - [ ] In code generation - [ ] At runtime - [ ] As `CREATE...
We already support `JSON_VALUE`, which can be used to extract a string value from a `JSON` document. With `JSON_QUERY`, it's possibly to extract a `JSON` subdocument. There are multiple internal...
Given the [sakila](https://www.jooq.org/sakila) schema: ```sql CREATE TABLE address (address_id bigint primary key); CREATE TABLE actor (..., address_id bigint references address); CREATE TABLE customer (..., address_id bigint references address); CREATE TABLE...
### Your question We ran into a timezone issue when migrating our database from PostgreSQL to MS SQL Server. We use `DSL.currentOffsetDateTime()` which in SQL Server does not necessarily return...
It is possible to write: ```java ctx.select(TABLE.as("t")) .from(TABLE) .fetch(); ``` And to intend aliasing only the table *projection* to produce this semantics in PostgreSQL: ```sql SELECT table AS t FROM...
https://github.com/jOOQ/jOOQ/issues/13843 addresses an issue where this query: ```java val subquery = context.select(EXAMPLE_TABLE).from(EXAMPLE_TABLE) context.selectFrom(subquery).execute() ``` Produces illegal SQL in PostgreSQL, e.g. ```sql SELECT alias_118559696.example_table FROM ( SELECT cast (ROW (example_table.*) AS...
This idea has last been seen here: https://github.com/jOOQ/jOOQ/issues/13849 There's a historic feature where you could name your columns like this: ```java List result = ctx.select(BOOK.ID.as("x.y.id")) .from(BOOK) .fetchInto(P.class); ``` And define:...
The manuals have a `` section where we can write e.g. `floor(1.7)` and that would produce a nice translation section like this:  See: https://www.jooq.org/doc/latest/manual/sql-building/column-expressions/numeric-functions/floor-function/ There are other types of...
All `Named` subtypes should offer API that allows for creating a new instance of the same object under a different name. So far, we have generated `Table.rename(Name)` methods that allow...