Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate API with database #35

Merged
merged 1 commit into from
May 6, 2024
Merged

Integrate API with database #35

merged 1 commit into from
May 6, 2024

Conversation

jmaupetit
Copy link
Member

@jmaupetit jmaupetit commented Apr 23, 2024

Purpose

API calls should create and fetch database entries for statique and dynamique data. Let's start implementing the database integration logic.

Proposal

  • add models / schemas utilities so that we separate business logic from the API
  • save Statique model to database
  • fetch Statique model from database
  • handle database updates from Statique object
  • update the CHANGELOG

@jmaupetit jmaupetit marked this pull request as draft April 23, 2024 18:31
@jmaupetit jmaupetit self-assigned this Apr 23, 2024
@jmaupetit jmaupetit marked this pull request as ready for review May 6, 2024 10:35
Current work adds helpers to create database entries from `Statique`
objects. It allows to separate the business logic from API endpoints
implementation.

Two possible improvements concerning the current implementation:

- the /bulk endpoint performances should not depend on the number of
  submitted statiques.
- Statique update can lead to orphan entries as we might create new
  related entries instead of patching them. Since we do not rely on
  object ids on this part, it's a fair trade-off for now.
@jmaupetit jmaupetit merged commit 69afedb into main May 6, 2024
8 checks passed
@jmaupetit jmaupetit deleted the api-db-calls branch May 6, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant