2013/10/8 Eric Schwarzenbach <[email protected]>

> I meant to get back to this when I got back to my JOOQ code...sorry to let
> so much time pass. To answer your question, I generate my SQL by creating a
> Query object using a DSLContext created using a null connection and a
> dialect, and in this case the select fields were a Collection of
> Field<Object> (passed into select()) generated by a bit of code getting the
> list of desired attributes and aliases from another source and performing a
> DSL.fieldByName() to create them. Only after constructing the entire Query
> object am I calling getSQL() on it.
>
> Would it really be better to render the various parts of my query to
> separate strings and patch them together after? That strikes me as taking a
> certain element of the knowledge of how to construct SQL  syntax and
> putting it into my code rather than having JOOQ do it for me. Though I
> perhaps since my code has to "know how" put together the JOOQ syntax calls,
> perhaps this is an illusary distinction. What is the reason you think I
> should prefer rendering unattached QueryParts?
>

I guess I was misunderstanding the way you used DSLContext. With no
Configuration / Connection attached, except for the SQLDialect, you're fine.


> I should note that this code is working fine so far, other than this one
> unimportant encounter with a very old PostgreSQL server...and I've since
> eliminated the "alias all columns" bit which was convenient for reasons too
> convoluted to explain but which became undesirable for other reasons. But
> more complexity will likely be going into my code and the SQL that it
> generates as I develop it, so if something about my current approach will
> make that prone to breaking I'd certainly like to head that off...
>

-- 
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].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to