2013/6/24 Durchholz, Joachim <[email protected]>

> > As a matter of fact, I think that jOOQ should have a
> > new, generally applicable feature that would allow
> > for adding clauses at arbitrary positions in a SQL
> > statement.
>
> +1


Let's see how this goes. A first attempt of implementing this failed as I
have a choice between:

- Letting the API explode completely (including sql() methods before/after
AND, OR, IN, NOT, CASE, WHEN, THEN, etc. etc.
- Offering only few sql() methods e.g. before or after the SELECT statement
keywords, in case of which the usefulness of this feature is dubious...


> Another use case: Adding comments.
> I found them VERY helpful when identifying a query in the stream of SQL
> that my app spews out.


Yes, that's useful for various reasons. One of them is to enforce a
hard-parse in the database (at least in Oracle), and thus a new cursor and
a new execution plan. This can help prevent bind-value peeking issues.

jOOQ already supports a .hint() method, mainly aimed at Oracle users who
want to inject query hints:

select(a, b).hint("/*+ALL_ROWS*/").from(t)

You can use this for other purposes than hints of course.


> Also, I'm generating views. These are used by third parties, and I've been
> making a point of documenting them to people can see what the view does. It
> would be cool if I could do that via Jooq-generated views, too.


What do you consider a "jOOQ-generated view"?


> (Not sure whether comments are already in the DSL. Or whether making them
> part of this mechanism is a good idea in the first place - it's possible
> that they need to be handled specially.)


 As with any type of plain SQL, you're on your own. You'll risk to run
into syntax errors and SQL injection.

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


Reply via email to