databases
databases copied to clipboard
Async database support for Python. 🗄
when use databases and aiomysql I get `Task got Future attached to a different loop` detail: ``` Traceback (most recent call last): File "/app/services/currency.py", line 120, in update_currency_ticker_by_id return await...
When the connection is abnormal, due to local network problems, etc., it will not work when the network is restored. #Fix self._connection.acquire() Failed **FilePath : core.py - > Line :...
This PR implements usage of column defaults from SQLAlchemy. In regular SQLAlchemy the default column values are fetched using `ExecutionContext._exec_default`. However, we don't use the `ExecutionContext` here, so a function...
Hello, Could you tell me please, why I can't add application_name via DSN? My DSN looks like: ``` from databases import Database dsn = ( f'postgresql://{user_name}:{password}' f'@{host}:{port}/{my_db_name}' f'?application_name=my_app_name' ) db...
## Background In sqlite3, if you [set `uri=True`](https://docs.python.org/3/library/sqlite3.html#sqlite3.connect), you can pass query param arguments to the underlying database, including [options like `cache=shared` and `mode=memory`](https://www.sqlite.org/inmemorydb.html#sharedmemdb), which are useful for unit testing...
Hi I found an issue when selecting from a table with an [`Interval`](https://docs.sqlalchemy.org/en/13/core/type_basics.html#sqlalchemy.types.Interval) column, this should parse to a `timedelta` object. When used with databases, sqlalchemy raises a `TypeError` when...
#!/usr/bin/env python # -*- coding: utf-8 -*- import asyncio import uvicorn from fastapi import FastAPI import databases from databases import Database from asyncio import gather from pydantic import BaseModel from...
Hello! We are trying to activate foreign_keys option on sqlite through a PRAGMA query but it is not being activated. The following code should print `Set foreign_keys: (1,)` but it...
SQLAlchemy queries containing `bindparam(expanding=True)` need additional preprocessing at execution time. Relevant documentation: [method sqlalchemy.sql.operators.ColumnOperators.in_](https://docs.sqlalchemy.org/en/13/core/sqlelement.html?highlight=bindparam#sqlalchemy.sql.operators.ColumnOperators.in_), [attribute sqlalchemy.sql.compiler.SQLCompiler.contains_expanding_parameters](https://docs.sqlalchemy.org/en/13/core/internals.html#sqlalchemy.sql.compiler.SQLCompiler.contains_expanding_parameters). Self-contained sample: ```python import asyncio from databases import Database import sqlalchemy DB_URI = 'sqlite:///example.db')...
https://github.com/encode/databases/blob/45519d7ea1183d8d1ce24de21836ccb7c2174039/databases/backends/postgres.py#L107 This code is not in [build](https://pypi.org/project/databases/0.3.2/#files)