[DB-SIG] create database in Python Database API 2.0

Marek Isalski python.db-sig@maz.nu
Tue, 12 Feb 2002 21:31:05 +0000


--ep0oHQY+/Gbo/zt0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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 executing
> > nontransaction oriented commands like that?
>
> 'create database' is one of those commands that some drivers cannot execu=
te
> at all.  What backend and driver are you having trouble with?  Also, most
> cursors can run commands like 'create/drop/alter table/index/view/etc'.

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...

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.

--=20
Maz

I'm going stir-crazy, and I've joined the ranks of the walking brain-
dead, but otherwise I'm just peachy.
    -- Lyta Hall on parenthood, in SANDMAN #40: "Parliament of
       Rooks"
--ep0oHQY+/Gbo/zt0
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8aYmZbTAIQacXP+URAlC8AKCnZrhHAzXyVrv/0LuCvRjHuKqA9QCfeF/5
6d/IWNItcmrY40DuEo0iHzQ=
=ibia
-----END PGP SIGNATURE-----

--ep0oHQY+/Gbo/zt0--