Re:Show HN: Facata – Connect to SQL Databases from Python
by tlocke on Saturday August 21, 2021 @02:47PM
(#28259425)
You could do that, but Facata works at a lower level, so for example you can use prepared statements, which SQLAlchemy doesn't support. Also, Facata has better performance and fewer dependencies if you only want to use raw SQL.
[ Parent
| on HN ]
Re:Show HN: Facata – Connect to SQL Databases from Python
by BiteCode_dev on Saturday August 21, 2021 @07:17PM
(#28261443)
SQLA automatically creates prepared statements and cache them: https://docs.sqlalchemy.org/en/14/dialects/postgresql.html#p...
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?
Re:Show HN: Facata – Connect to SQL Databases from Python
by tlocke on Saturday August 21, 2021 @07:58PM
(#28261699)
That prepared statement caching is a feature of a particular DBAPI driver rather than SQLAlchemy itself. I take your point though, and I'd say that Facata is designed to be an alternative to DBAPI 2 rather than an alternative to SQLAlchemy.
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.
Re:Show HN: Facata – Connect to SQL Databases from Python
by tlocke on Sunday August 22, 2021 @04:47AM
(#28263887)
Actually, I retract my comment that Facata has better performance than SQLAlchemy with raw SQL.
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.