[DB-SIG] Towards a single parameter style

Denis S. Otkidach ods@strana.ru
Tue, 25 Feb 2003 15:45:55 +0300 (MSK)


Here is another proposal for One Single Parameter Style: a mixed
sequence of query chunks and parameters. For instance:
('SELECT * FROM test WHERE field1>', Param(10),
 ' AND field2 LIKE ', Param('%value%'))
It can be easily converted to any existing style without serious
impact on performance.  And we need to know nothing about SQL
dialect used.  See quick-and-dirty implementation at
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ppa/misc/DBSingleStyle.py?rev=HEAD&content-type=text/vnd.viewcvs-markup

This style also can be adopted for prepared queries by replacing
parameters with slots.

-- 
Denis S. Otkidach
http://www.python.ru/      [ru]