Settings

Theme

Show HN: An asynchronous database connection manager for Python

github.com

1 points by impoppy 3 months ago · 1 comment · 1 min read

Reader

Hello HN! I made this library because there doesn't seem to be one good way to manage database connections in Python. Functions provided by SQLAlchemy and database drivers are either very bare-bone or outdated ux (dx?) wise.

I used to really love databases[1], but its code is a mess[2], adding new backends is difficult and now it's archived. I wanted to have a similarly simple API and ability to create force rollback connections for tests so you don't have to call your DB clean-up callbacks in each test that uses a database connection, everything will be done in a transaction that will then be cancelled.

[1] - https://github.com/encode/databases [2] - I think the a reason why its code is so bad is mypy. Use type hints, provide them where they help, but don't go overboard.

No comments yet.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection