Hi Ryan, Thanks for your message. You can use DSLContext.meta(String) to get jOOQ to interpret the DDL for you and read the meta data using the org.jooq.Meta API. There isn't even an H2 database behind the scenes (and we'll try to remove the H2 dependency from DDLDatabase also in the future). Details here: https://www.jooq.org/doc/latest/manual/sql-building/sql-interpreter/
Does that help? On Wed, May 27, 2020 at 6:53 AM <[email protected]> wrote: > Hi all, > > I have a use case which I think should be easy for JOOQ but I can't seem > to figure out because of the heavy emphasis on code generation and my > newness to JOOQ. Basically, I'm trying to take arbitrary DDL (say, as read > from a file), turn it into a DDLDatabase, and then establish a JDBC or > other direct connection to the resulting H2 database in order to analyze it > - examine its column structure, primary and foreign keys, etc. However, > all of the examples I've run across do code generation, which is not > required in this scenario. > > On a related note, the reason I'm going through H2 / DDLDatabase at all is > simply to have access to a SQL grammar (i.e., classes I can write a visitor > over / process with structural recursion), and H2 has such classes. But if > JOOQ has a bonafide SQL grammar that all of its input dialects parse into, > I'd prefer to use that instead of H2's. However, in looking through the > JOOQ documentation it seems that the only functions one can really write > out of "JOOQ SQL" are those that pass through JOOQ code generation on the > way to a target SQL dialect. But in my use case, the target will not be > another SQL dialect. > > Any help greatly appreciated, > Ryan > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jooq-user/129508a9-e951-4c0d-b114-f4bb19e027f4%40googlegroups.com > <https://groups.google.com/d/msgid/jooq-user/129508a9-e951-4c0d-b114-f4bb19e027f4%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/CAB4ELO6hBSsKKL%2BFj39dDnPiKPSrPCB43-hK2htNRdQLevOEpQ%40mail.gmail.com.
