Session Handling for SQLAlchemy backend.
Add REGEXP function to sqlite connections.
Return a debug version of MySQLdb.cursors._do_query
Return a SQLAlchemy engine.
Return a SQLAlchemy sessionmaker using the given engine.
Return a SQLAlchemy session.
Return True if error in connecting to db.
Ensures that MySQL connections checked out of the pool are alive.
Borrowed from: http://groups.google.com/group/sqlalchemy/msg/a4ce563d802c929f
Switch sqlite connections to non-synchronous mode