[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-dev] Make sql logging with bind parameters more readable

Hello,

Could you please take a look at this request?

On Wed, Jun 26, 2019 at 2:56 PM Vitaly Gorbunov <vit.gorbunov@xxxxxxxxx> wrote:
Hi,

We have a question related to sql logging withÂsession.getPlatform().setShouldBindAllParameters(true);

It's logging sql like this.
INSERT INTO SOME_TABLE VALUES(?, ?)
   Âbind => [value1, value2]


2 problems here
1) not convenient for troubleshooting/analysis. We can't just take sql from log and execute it against db
2) parameters not enveloped, so if value contains commas - we can't automatically match parameter to value

We considering the following solutions
* Log sql in unprepared style (without ? and bind =>)
* envelop parameters in quotes (also we would like to remove newline before bind, since it simplifies logs processing)

We can work on this and submit PR to eclipselink - what are your thoughts on possible solutions?