Is there some module to allow for easy DB provider configuration via connection string, similar to PHP's PDO开发者_高级运维 where I can nicely say "psql://" or "mysql://" or, in this python project, am I just going to have to code some factory classes that use MySQLdb, psycopg2, etc?
http://www.sqlalchemy.org/docs/core/connections.html
There's something not quite as nice in logilab.database, but which works quite well (http://www.logilab.org/project/logilab-database). Supports sqlite, mysql, postgresql and some versions of mssql, and some abstraction mechanisms on the SQL understood by the different backend engines.
精彩评论