current approach is to use the "creator" keyword to create_engine(),  
which references a callable that returns a connection.  you connect,  
and then issue whatever additional SQL on the connection before  
returning it.   however this means your URL is just "<drivername>://"  
and any additional portions of the URL are not used.

Jason will be adding some new hooks in 0.4 such that you can add a  
function that gets called after the connection is established, so you  
still connect via normal URL.

On Jul 24, 2007, at 5:01 AM, Paul Colomiets wrote:

>
> Hi,
>
> How can I place some initialization code for each connection in the  
> pool?
>
> Currently I do something like this:
>     engine.execute("SET collation_connection=utf8_general_ci")
>     engine.execute("SET names utf8")
>     engine.execute("SET character_set_client=utf8")
>     engine.execute("SET character_set_results=utf8")
> before processing each http-request. But it needs to be done
> only once per connection.
>
> --
> Paul.
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to