Does there exist, or is there an intention to create, a universal database frontend for Python li开发者_运维问答ke Perl's DBI? I am aware of Python's DB-API, but all the separate packages are leaving me somewhat aggravated.
AFAIK there is no one Python module that implements the DB-API to multiple databases and that's pretty much by design: why bring in unneeded functionality and possibly require the underlying database libraries to be installed if you are not going to use them? You can argue with that design decision but that's the way it is. On the other hand, the DB-API attempts to ensure that the API presented by the individual DB adapters is the same (or very close to the same). And then there are ORM modules, like SQLAlchemy that provide a much higher-level abstraction layer. They still require the lower-level DB-API modules, though.
Note, as of 2.5, the Python standard library does include an SQLite3 DB-API, i.e. batteries included.
Well...DBAPI is that frontend:
This API has been defined to encourage similarity between the Python modules that are used to access databases. By doing this, we hope to achieve a consistency leading to more easily understood modules, code that is generally more portable across databases, and a broader reach of database connectivity from Python.
It has always worked great for me atleast, care to elaborate the problems you are facing?
精彩评论