[DB-SIG] Re: Towards a single parameter style

Federico Di Gregorio fog@initd.org
03 Mar 2003 10:06:24 +0100

Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Il lun, 2003-03-03 alle 09:38, Denis S. Otkidach ha scritto:
> On 1 Mar 2003, Federico Di Gregorio wrote:
> FDG> thank you very much for the explanation. i think (but is
> FDG> just IMHO,
> FDG> obviously) that you choosed a complicated and error prone
> FDG> style (mixing
> FDG> query and argument) and to avoid error you just made it
> FDG> heavier
> FDG> (mandatory Param()). i don't see any benefits over the
> FDG> standard way of
> FDG> binding variables.
> You already must use explicit wrapping for parameters of type
> Date, DateTime, Binary, so requirement to wrap all parameters
> doesn't make it mach havier.  Inlined definition is much easier
> to read and expressed this way can be applied to any database
> (can be converted to any existing DB API parameters style).
> There is _no_ standard way (I mean one working with all
> databases) to bind parameters, so it's not an option.

this is utopia. dbapi should provide a standard API, *not* a database
compatbility layer. if i use "LIMIT 5 OFFSET 10" in my SQL query, no
database other than postgresql will accept it. i bet 95% of the SQL code
out there is already tied to a specific backend.

also, building lists and/or dictionaries of variables is so usefull
(think about passing obj.__dict__ to execute) that makes nonsense to
force splitting the query.

Federico Di Gregorio
Debian GNU/Linux Developer                                fog@debian.org
INIT.D Developer                                           fog@initd.org
  The devil speaks truth much oftener than he's deemed.
   He has an ignorant audience. -- Byron (suggested by Alice Fontana)

Content-Type: application/pgp-signature; name=signature.asc

Version: GnuPG v1.2.1 (GNU/Linux)