Async Database¶
The fluid.db
module provides a simple asynchronous interface to interact with postgres databases. It is built on top of the sqlalchemy and asyncpg libraries.
Database¶
Create a database container with the Database
class:
from fluid.db import Database
db = Database("postgresql+asyncpg://postgres:postgres@localhost:5432/fluid")
Note the use of the postgresql+asyncpg
driver in the connection string. This is required to use the asyncpg driver.