databases
databases copied to clipboard
Async database support for Python. 🗄
What title says.
Resolves #535. I generally don't have time for this during weekdays, so if anyone wants to help out - feel free to fork my fork, we will merge it and...
```python from contextlib import asynccontextmanager from databases import Database @asynccontextmanager async def async_sqlite_conn(db_name): database = Database(f'sqlite+aiosqlite:///example.db?mode=ro', uri=True) try: await database.connect() yield database finally: await database.disconnect() ``` when call this function...
Bumps [pymysql](https://github.com/PyMySQL/PyMySQL) from 1.1.0 to 1.1.1. Release notes Sourced from pymysql's releases. v1.1.1 [!WARNING] This release fixes a vulnerability (CVE-2024-36039). All users are recommended to update to this version. If...
Bumps [requests](https://github.com/psf/requests) from 2.31.0 to 2.32.0. Release notes Sourced from requests's releases. v2.32.0 2.32.0 (2024-05-20) 🐍 PYCON US 2024 EDITION 🐍 Security Fixed an issue where setting verify=False on the...
In a highly refactored codebase using the Database class from databases/core.py, I've encountered a "too many connections" error. While investigating, I found [comment](https://stackoverflow.com/questions/63270196/how-to-do-persistent-database-connection-in-fastapi#:~:text=Databases%20is%20not,using%20Databases%20wrapper.) on Stack Overflow suggesting that the library's...
## Context For `sqlite` backend, when inside a transaction, errors are raised at the execution of the `COMMIT` statement instead of the SQL that causes the error, for example ```sql...
Hello there. I am running into a strange error when using memoize type caching for db calls (to mariadb). I am trying to keep db connections down, so I am...
Hi, I have code an adapter for using psqlpy driver , as following code: ```python from databases.backends.postgres import PostgresBackend, ConnectionBackend from databases.core import DatabaseURL import psqlpy from typing import Any,...
The database [help](https://www.encode.io/databases/connections_and_transactions/) suggests the following way to use the low-level transaction API: ```Python transaction = await database.transaction() try: ... except: await transaction.rollback() else: await transaction.commit() ``` But if I...