thank you very much
Michael Bayer wrote:
> im not sure if the "use" statement is really valid to use on a MySQLDB
> connection. alternatively, if it *does* work, since you are not using
I use this for years now. so I would be astonished if it was not permitted :)
how else would you use a database you just created by executing "create
database xyz"?
robert
> explicit connections, its possible that the "use" works on the
> particular connection that you happen to pull from the pool, but your
> subsequent statement is on a different pooled connection which did not
> have the "use" statement executed (youd be pulling a second connection
> because the result from the first insert has not yet been garbage
> collected, and the connection is still pending).
>
> cant you just connect to the correct database directly with your
> create_engine url ?
>
> if not, at the very least you'd have to specify a custom connect
> function to your engine which does the "use" on every new connection
> created:
>
> def connect():
> conn = mysqldb.connect(**kwargs)
> conn.cursor().execute("use mydb")
> return conn
>
> engine = create_engine('mysql://', creator=connect)
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---
begin:vcard
fn:robert rottermann
n:rottermann;robert
email;internet:[EMAIL PROTECTED]
tel;work:031 333 10 20
tel;fax:031 333 10 23
tel;home:031 333 36 03
x-mozilla-html:FALSE
version:2.1
end:vcard