Minor issue

Поиск
Список
Период
Сортировка
Искать
От
Frank Millman
Тема
Minor issue
Дата
в 11:42:56
Msg-id
92a25cd6-5b50-3074-0da6-7394db9e0f0a@chagford.com
Список
Дерево обсуждения
Minor issue Frank Millman <frank@chagford.com>
Re: Minor issue Rory Campbell-Lange <rory@campbell-lange.net>
Re: Minor issue Frank Millman <frank@chagford.com>
Re: Minor issue Daniele Varrazzo <daniele.varrazzo@gmail.com>
Re: Minor issue Frank Millman <frank@chagford.com>
Re: Minor issue Rory Campbell-Lange <rory@campbell-lange.net>
Re: Minor issue Frank Millman <frank@chagford.com>
Re: Minor issue Rory Campbell-Lange <rory@campbell-lange.net>
Hi all

This is very minor, but I thought I would mention it.

I have a function that returns a complex SQL query and a tuple of 
parameters. The query is stored inside the function as a triple-quoted 
string, and the parameters are derived depending on the input arguments.

Sometimes while testing I will comment out some of the SQL using '--'. 
If those lines happen to contain a parameter placeholder ('%s') I 
expected to remove the parameter from the tuple as well.

pyodbc and sqlite3 both work this way, but psycopg2 raises the exception 
'tuple index out of range'.

I can live with it, but it means that I have to adjust the parameter 
tuple differently depending on which database I am testing with.

If it can be fixed, that would be nice. If it can't, no problem.

Frank Millman


В списке psycopg по дате отправления
От: Daniele Varrazzo
Дата:
Сообщение: psycopg3 performance article
От: Rory Campbell-Lange
Дата:
Сообщение: Re: Minor issue
FAQ