Show HN: Facata – Connect to SQL Databases from Python
github.com
github.com
* DBAPI 2 has five ways of writing parameters in SQL, but Facata has just one.
* In DAPI 2 parameter values can be provided as a sequence or mapping, but in Facata parameter values are provided as keyword arguments.
* DBAPI 2 has four levels of threadsafety, but Facata just has one.
* DBAPI 2 has a 'cursor' object, but in Facata there is no cursor object and statements are executed using the connection.
* DBAPI 2 overrides the autocommit mode of the underlying database by silently sending START TRANSACTION statements if a transaction isn’t already in progress. Facata never silently sends SQL statements.
All feedback gratefully received :-)
I get that Facata is a smaller dependency chain. I'm also curioujs about the performance side, what areas is Facata more performant in, and how was it measure?
On the performance, I'm basing this on the fact that SQLAlchemy does a lot more than Facata. You're right though, actual measurements would be interesting.
Really, the only reason I can think of for using Facata over SQLAlchemy is if you don't want the extra functionality that SQLAlchemy gives you.
You should consider writing a full abstract implementation so that it's easy to implement this API for new DBs, Python's abstract base classes are great. I did something similar with the DB API PEP: https://github.com/thesketh/pep249
Thanks for pointing me in the direction of psycopg2.sql, it looks interesting and I'll give it some thought.