Formatting query result into different types

34 views
Skip to first unread message

ry...@monoicon.com

unread,
Sep 25, 2023, 9:35:11 AM9/25/23
to jOOQ User Group
Hi

We're looking to use the ...fetch().formatCSV() type methods for formatting query results directly to OutputStreams. My question is, is it possible for us to define our own format types? We have the requirement to allow query results to be written to Excel and would love to use the same approach. I've struggled to see how we could add on our own formatter in this case.

Ryan

Lukas Eder

unread,
Sep 25, 2023, 9:39:36 AM9/25/23
to jooq...@googlegroups.com
Hi Ryan,

There's this feature request here, which would allow for registering Converter<T, String> specific to data import/export formats:

Other than that, you can obviously convert your data to the appropriate format yourself, directly in the query, e.g. using ad-hoc converters:

You would do this *prior* to calling the formatCSV() method.

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 on the web visit https://groups.google.com/d/msgid/jooq-user/dde7b09e-6d64-465f-9601-18b817cb60b5n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages