4 ms·
The things you have described as differences between the DBs are differences in Python libraries.
by greggyb 3y ago
The things you have described as differences between the DBs are differences in Python libraries.
- amluto 3y agoThe Python SQL ecosystem is IMO pretty bad, and the root cause seems to be that DB-API (PEP 249) is really quite awful. As my least favorite example, DB-API has two transaction modes, both of which are unnecessarily error prone: autocommit on, and autocommit off. Autocommit on makes transactions useless (intentionally), but it still allows commit() and rollback(), so one can write code that thinks transactions are enabled, have it appear to work, and end up with all manner of corruption. Autocommit off has a bad interface. The begin() function is entirely missing, so you can’t pass it arguments. Worse, since there is no explicit start of a transaction, the library can’t catch misuse of a transaction. As a result, every SQL library for Python of any reasonable quality implements its own special API, and nothing is particularly interoperable. This is all sort of fine if the database is only accessed through a higher level library like SQLAlchemy. But sometimes a developer just wants to execute raw SQL against a database, and the situation in Python is not very nice.
- patmorgan23 3y agoDoesn't SQL alchemy make it pretty easy to use raw SQL?
- amluto 3y agoYes, but how many people use SQLAlchemy just as a database API? I think the real problem is that DB-API exists and is bad — its existence comes with the automatic imprimatur of being an official standard and this seeming desirable to use.