Generating Postgres Enums when going through an XML information-schema.xml

7 views
Skip to first unread message

Daniel Einspanjer

unread,
Jan 7, 2017, 1:35:16 PM1/7/17
to jOOQ User Group
I've been trying to figure out why I'm not getting any enum types in my generated code, and I suspect it might be because I am caching the schema by outputting it to XML then generating the code from the XML schema.

I've been doing this because it is much more difficult to connect to the database, and I could check in the schema file then still include the java generator in the maven build which also allows me to quickly iterate and tweak the style of java generation.

In the information_schema.xml, I see the following references to the enum type:

<column>
<table_catalog></table_catalog>
<table_schema>x</table_schema>
<table_name>y</table_name>
<column_name>datasource</column_name>
<data_type>USER-DEFINED</data_type>
<character_maximum_length>0</character_maximum_length>
<numeric_precision>0</numeric_precision>
<numeric_scale>0</numeric_scale>
<ordinal_position>2</ordinal_position>
</column>

Should that be anything different?  I looked for the definition of the enum and couldn't find it in the generated information_schema.xml.  Maybe I did something that caused it not to capture that type?

-Daniel

Lukas Eder

unread,
Jan 9, 2017, 9:43:54 AM1/9/17
to jooq...@googlegroups.com
Hi Daniel,

Unfortunately, there are still some limitations to the XMLDatabase, e.g. currently, there's no support for routines / user-defined types. This is on the roadmap, and I've increased the priority for jOOQ 3.10:

In the meantime, you could extend the org.jooq.util.xml.XMLDatabase class and implement the getEnums0() method. Of course, you'd have to make some assumptions about how this will work in 3.10.

Let me know if you need any help with this,
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages