jooq migrations from another dialect?

9 views
Skip to first unread message

Joaquin

unread,
Sep 4, 2025, 7:56:19 AM (2 days ago) Sep 4
to jOOQ User Group
Hello!

I'm trying to create "migrations"(there's no much documentation atm) from an existent DB into a testcontainer one in another dialect without success, @Lukas it's maybe not an intended use case, but would be an interesting one.

don't know if I'm doing something wrong but I would appreciate any help!

What I'm doing is:
- starting a test with spring (@JooqTest) + @Testcontainers
- jooq (for now) is using a real oracle database so let's call it "DSL"
- I'm creating a postgres container with testcontainers and creating a DSLContext
with the jdbc url etc, let's call it postgresDsl

so when the start up is ready I'm running:

final Meta oracleMeta = dsl.meta(DefaultSchema.DEFAULT_SCHEMA);
final DDLExportConfiguration configuration = new DDLExportConfiguration();
final Queries ddl = oracleMeta.ddl(configuration);
postgresDsl.meta().apply(ddl);


the apply method files miserably ( same thing when  trying:
 postgresDsl.meta().migrateTo(oracleMeta);

some errors:

org.jooq.impl.DDL                        : Cannot parse view source (to skip parsing, use Settings.parseMetaViewSources): CREATE VIEW "pg_timezone_abbrevs" AS  SELECT abbrev,
    utc_offset,
    is_dst
   FROM pg_timezone_abbrevs() pg_timezone_abbrevs(abbrev, utc_offset, is_dst);

org.jooq.impl.ParserException: Keyword 'SELECT' expected: [4:29] ...tc_offset,
    is_dst
   FROM pg_timezone_abbrevs([*]) pg_timezone_abbrevs(abbrev, utc_offset, is_dst);

Lukas Eder

unread,
Sep 4, 2025, 10:30:52 AM (2 days ago) Sep 4
to jooq...@googlegroups.com
Hi Joaquin,

Thanks for your message. You shouldn't expect 100% coverage of all database specific SQL. jOOQ will implement more and more of these things, but you'll always run into limitations. For example, pg_timezone_abbrevs() is simply not supported, and I don't think that's something worth adding support for.

You can try to extend the parser using a ParseListener:

Or you could try your luck requesting new features in the parser or in jOOQ in general, if you think this is a generic enough vendor-specific feature whose translation / emulation could make sense:

I hope this helps,
Lukas

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/jooq-user/9c35d75c-aa4a-4814-b7f6-3e6df29a14dfn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages