Search code examples
jooq

Alias for RETURNING result in jooq


How can I denote the following PostgreSQL syntax with jooq?

WITH main AS
    (DELETE FROM maintable WHERE id = 1 RETURNING name)
INSERT INTO subtable (name) VALUES (main.name)

jooq's as function expects Select type as its argument, but returning function returns DeleteResultStep type?


Solution

  • It seems not yet supported, discussed in https://github.com/jOOQ/jOOQ/issues/4474