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

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


--=-U+zDc/SrRvtnVJQunhTy
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:
>=20
> 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.
>=20
> 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.

--=20
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)

--=-U+zDc/SrRvtnVJQunhTy
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQA+YxsQvcCgrgZGjesRAvqvAJ9s5v4t7UalNLv8QBk/1lut4vNTjgCfepOa
fms/lOUFl0A+GatLX6f4n0Y=
=DWGT
-----END PGP SIGNATURE-----

--=-U+zDc/SrRvtnVJQunhTy--