Re: Postgres param binding marker

2021-03-23 Thread Lukas Eder
An update on R2DBC matters. This was really much simpler than I thought. The DSLContext.parsingConnectionFactory() is now implemented for jOOQ 3.15.0-SNAPSHOT for all jOOQ editions, including the jOOQ Open Source Edition. It works just like the DSLContext.parsingConnection(), and profits from t

Re: Postgres param binding marker

2021-03-22 Thread Lukas Eder
This really doesn't seem too hard! Here's a quick draft leveraging the translation capabilities from the jOOQ 3.15.0-SNAPSHOT Professional Edition to translate Teradata QUALIFY to PostgreSQL (I marked the interesting stuff in yellow): package org.jooq.r2dbc; import static org.jooq.impl.DSL.val;

Re: Postgres param binding marker

2021-03-22 Thread Lukas Eder
Here we go. As I said, I think we should offer this out of the box, and integration test it: https://github.com/jOOQ/jOOQ/issues/11700. It's a rather low hanging fruit, much lower than executing jOOQ queries on R2DBC. I'll look into this later this week. On Mon, Mar 22, 2021 at 9:08 PM Lukas Eder

Re: Postgres param binding marker

2021-03-22 Thread Lukas Eder
Search "(?: > It almost gets me all the way :) > > The input sql has named parameters, as in "SELECT c1, c2 FROM foo WHERE > bar = :baz OR quz = :qux". I would like to have that rendered as "SELECT > c1, c2 FROM foo WHERE bar = $1 OR quz = $2". The intention is to use jooq > as an sql parser and e

Re: Postgres param binding marker

2021-03-22 Thread Magnus Persson
It almost gets me all the way :) The input sql has named parameters, as in "SELECT c1, c2 FROM foo WHERE bar = :baz OR quz = :qux". I would like to have that rendered as "SELECT c1, c2 FROM foo WHERE bar = $1 OR quz = $2". The intention is to use jooq as an sql parser and executing it with r2db

Re: Postgres param binding marker

2021-03-22 Thread Lukas Eder
Hi Magnus, You can set Settings.paramType = ParamType.NAMED (this would produce :1, :2 if you don't actually provide any named parameters), and then Settings.renderNamedParamPrefix = "$" to replace the default prefix ":" by "$". I hope this helps, Lukas On Sat, Mar 20, 2021 at 5:01 PM Magnus Per

Postgres param binding marker

2021-03-20 Thread Magnus Persson
I'm using the jooq sql parser with the intention of outputting sql and bind values. Unfortunatly the sql coming out of jooq has either named ":param" or indexed by "?". How would I go about having jooq output sequenced index markers such as "$1", "$2" etc? -- You received this message because