Re: [Dbix-class] Escaping placeholders

2014-12-20 Thread Tim Bunce
On Fri, Dec 19, 2014 at 01:12:16PM +0100, Alexander Foken wrote: > Hello all, > > this reminds me of a similar problem I had in 2000 with DBI, > DBD::Oracle, and Oracle. See > , > . > > Problem was u

Re: [Dbix-class] Escaping placeholders

2014-12-20 Thread Peter Rabbitson
On 12/20/2014 03:38 PM, Tim Bunce wrote: On Fri, Dec 19, 2014 at 01:12:16PM +0100, Alexander Foken wrote: Hello all, this reminds me of a similar problem I had in 2000 with DBI, DBD::Oracle, and Oracle. See ,

Re: [Dbix-class] Escaping placeholders

2014-12-20 Thread Tim Bunce
On Sat, Dec 20, 2014 at 05:35:55PM +0100, Alexander Foken wrote: > On 20.12.2014 15:38, Tim Bunce wrote: > >Can you, or anyone else, think of any situation where a backslash before > >a ? or :foo (or even $1) style placeholder might be valid SQL? > > I found two situations for PostgreSQL: > > (1)

Re: [Dbix-class] Escaping placeholders

2014-12-20 Thread Tim Bunce
On Sat, Dec 20, 2014 at 01:14:29PM -0800, Jonathan Leffler wrote: >Many, many years ago, DBD::Informix had to give up on the DBI-provided > parsing for placeholders because >there were too many contexts in which it was wrong for Informix. It may > have improved since then, but: > >

Re: [Dbix-class] Escaping placeholders

2014-12-21 Thread Tim Bunce
On Sat, Dec 20, 2014 at 02:23:43PM -0800, Jonathan Leffler wrote: > > INSERT INTO SomeTable(DateTimeCol) > VALUES(DATETIME[1](2014-12-31 23\:59\:59) YEAR TO SECOND); > >I really won't want people have to futz with their legitimate Informix SQL > in order to pass it thro

Re: [Dbix-class] Escaping placeholders

2014-12-21 Thread Tim Bunce
On Sun, Dec 21, 2014 at 10:27:18AM +0100, pe...@vanroose.be wrote: > On 20.12.2014 15:38, Tim Bunce wrote: > > [...] > > Can you, or anyone else, think of any situation where a backslash before > > a ? or :foo (or even $1) style placeholder might be valid SQL? > > Inside quoted text: of course, ye

Re: [Dbix-class] Escaping placeholders

2014-12-21 Thread Darren Duncan
I agree with Greg's counter-proposal, from which I derive my own words here. 1. I propose that there be no modification to the DBI spec related to new escaping whether optional or not, so leave things the way they are here, SQL continues to be interpreted the way it long has by default. 2.

[Dbix-class] Escaping placeholders, take 2

2014-12-28 Thread Tim Bunce
Wherein I attempt to summarize the requirements, the background, the options, the risks, and the counter-proposal ... ** Background Drivers that support placeholders parse the SQL statement to find them. The parsing is really just simple tokenization that only knows how to skip over quoted string

Re: [Dbix-class] Escaping placeholders, take 2

2014-12-28 Thread Darren Duncan
Thank you for this post Tim, it seemed to lay out the issues well and make a lot of things clear. I'm now inclined to support your backslash-escape proposal at the DBI driver level in principle. (I also agree that the doubling method is nasty.) Or alternately I suggest variation on that prop

[Dbix-class] Escaping placeholders (was: Using Postgres JSONB operators in queries)

2014-12-19 Thread Tim Bunce
Hello Augustus. On Thu, Dec 04, 2014 at 03:38:14PM -0800, Augustus Saunders wrote: >Hi all, I have been unable to find a way to use some of the new >JSONB operators in Postgres 9.4 with DBIx::Class. A quick search >for JSONB on the email archive site didn't turn up any results, so >

Re: [Dbix-class] Escaping placeholders (was: Using Postgres JSONB operators in queries)

2014-12-19 Thread Augustus Saunders
Tim, thanks for the detailed response. One other poster had suggested I use the dollar only placeholder setting, but as you pointed out, DBIx::Class (I guess due to SQL::Abstract) is using ?, so I got errors about mixing the two. I'm happy to contribute any discussion on the ramifications, but i

Re: [Dbix-class] Escaping placeholders (was: Using Postgres JSONB operators in queries)

2014-12-20 Thread Tim Bunce
There'll need to be a change to DBD::Pg before \? will work. I've opened a case for it https://rt.cpan.org/Ticket/Display.html?id=101030 Once implemented you'd use the usual SQL::Abstract way of specifying operators: https://metacpan.org/pod/SQL::Abstract#Specific-comparison-operators Tim. On F

Re: [Dbix-class] Escaping placeholders (was: Using Postgres JSONB operators in queries)

2014-12-24 Thread Tim Bunce
Sometime over the holiday period I hope to write up a summary of the arguments for and against and suggest ways forwards. Tim. ___ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.p