You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.
In the current implementation the database manager .get() method handles both load and open functions.
This isn't ideal because:
Increases the difficulty of implementing new features
Non-intuitive behaviour - HTTP GET requests to the api will actually attempt to open the database that are not already opened rather than throw an error. HTTP standards discourage GET requests having side effects, the api should be designed to use POST instead.
Solution
Separately implement .load(), and remove loading functionality from .get()
Modify api routes to use the appropriate manager methods
Resultant breaking api changes
GET /db routes with a would instead throw a HTTP 40X error if the database is not opened
POST /db would throw a 400 error if a database is already opened
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Problem
In the current implementation the database manager
.get()
method handles both load and open functions.This isn't ideal because:
GET
requests to the api will actually attempt to open the database that are not already opened rather than throw an error. HTTP standards discourageGET
requests having side effects, the api should be designed to usePOST
instead.Solution
.load()
, and remove loading functionality from.get()
Resultant breaking api changes
GET /db
routes with a would instead throw a HTTP 40X error if the database is not openedPOST /db
would throw a 400 error if a database is already openedBeta Was this translation helpful? Give feedback.
All reactions