Skip to content

Refactor DB connection to be asynchronous #659

@Syzygicality

Description

@Syzygicality

Background

Our web API is supposed to be fully asynchronous, but the PostgreSQL database connection found in gs/backend/data/database/engine.py is currently configured as synchronous. Modify the database connection to be asynchronous, and refactor where necessary. Avoid endpoint functions, as that responsibility is governed by separate task

Requirements

Describe the requirements that this feature must meet.

  • Change psql driver to use asyncpg instead of psycopg2
  • Refactor engine.py, data wrappers, and tests
  • Replace all Session typehinting with AsyncSession

Important Information

A good resource for async/await in FastAPI: https://fastapi.tiangolo.com/async/

Metadata

Metadata

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions