On 01/02/2017 07:05 AM, Jim Nasby wrote:
> On 1/1/17 2:11 AM, Daniele Varrazzo wrote:
>> sql.SQL("insert into %s values (%%s)") %
>> [sql.Identifier('mytable')],
>
> Since %s isn't standard parameter replacement anyway, I'm wondering if
> both considerations could just be handled by execute(), by using
> different replacement syntax. IE:
I thought it was?:
https://www.python.org/dev/peps/pep-0249/#paramstyle
format ANSI C printf format codes, e.g. ...WHERE name=%s
>
> execute('insert into %s values ($1)', [42], ['my table'])
>
> Obviously this would be backwards incompatible, but I think that's
> manageable.
--
Adrian Klaver
adrian.klaver@aklaver.com