I hold good experience in working with Perl DBI module.The DBI module acts as single API for multiple databases like Oracle, Postgres, etc.
I have recently started working on Python and I noticed that there are separate API for each databases in Python.
Following are my questions: 1. Isn't there single DB API in Python? 2. If not, isn't this a disadvantage in Python?
There is no Python equivalent to Perl's DBI-centric ecosystem. Instead:
Python's lack of a proper DBI equivalent is less of a disadvantage than it would be in Perl due to the different module system. Assuming you are restricting yourself to a common SQL subset and to the DBAPI instead of using driver-specific extensions, switching to a different driver can be as simple as changing an import, and updating the connection information:
- import somedatabase as db
+ import differentdriver as db
In practice, neither Python's DBAPI nor Perl's DBI will enable you to switch databases at a whim. However, Perl's DBI makes it much easier to write software that works with multiple databases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With