Add DB integration
jacopofar opened this issue · comments
Jacopo Farina commented
Once the scaffolding in #2 is present, the backend should be able to use a DB containing the quiz data.
Create an endpoint which retrieves a random card for a language pair. The DB connection string should be passed an environment variable, and the connection pool started with the app, then a new connection is retrieved when needed in the endpoint code using the pool.
acceptance criteria:
- given an initialized DB the endpoint works
- an integration test can check this behavior
- the CI pipeline can run an integration test using sample data (see https://github.com/MagicStack/asyncpg for an example implementation)