[DB-SIG] create database in Python Database API 2.0
Federico Di Gregorio
fog@debian.org
13 Feb 2002 01:37:29 +0100
--=-qEP0Anzi+tzjkzdzjR8b
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
Il mar, 2002-02-12 alle 22:31, Marek Isalski ha scritto:
> Kevin Jacobs [jacobs@penguin.theopalgroup.com] wrote:
> > On Tue, 12 Feb 2002, Dennis Sacks wrote:
> > > I want to execute something like "create database" from python, yet I
> > > cannot do it with a cursor.execute. What is the mechanism for executi=
ng
> > > nontransaction oriented commands like that?
> >
> > 'create database' is one of those commands that some drivers cannot exe=
cute
> > at all. What backend and driver are you having trouble with? Also, mo=
st
> > cursors can run commands like 'create/drop/alter table/index/view/etc'.
>=20
> Speaking for KInterbasDB (Firebird/Interbase bindings that I'm involved
> in), we've provided an execute_immediate() function in the module which
> gets around this problem. It's a bit of a kludge, I admit...
>=20
> Should it really matter that some drivers cannot execute this command?
> After all, the DB-API specifies rollback() as optional. Perhaps a formal
> specification of a function like execute_immediate() could help here?
> Optional for backends that support it.
some drivers (at least three) already support the autocommit() call,
that switches a connection to autocommit (i.e., immediate) mode. don't
know if making it a standard would be usefull though.
--=20
Federico Di Gregorio
Debian GNU/Linux Developer & Italian Press Contact fog@debian.org
INIT.D Developer fog@initd.org
Abandon the search for Truth; settle for a good fantasy. -- Anonymous
--=-qEP0Anzi+tzjkzdzjR8b
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Per informazioni si veda http://www.gnupg.org
iEYEABECAAYFAjxptUkACgkQvcCgrgZGjevELQCfQ0xPSIbgdhVcixnUv5ZdxjHH
ylsAoKpN061uaDpAl8LrHvzDd3le7gBP
=oifu
-----END PGP SIGNATURE-----
--=-qEP0Anzi+tzjkzdzjR8b--