source-academy / stories-backend

Backend of Source Academy extension for Stories support.
0 stars 0 forks source link

Inject DB session to request context via middleware #43

Closed RichDom2185 closed 1 year ago

RichDom2185 commented 1 year ago

Part of #33.

This will allow controllers to access the current DB session (that is now unique for each request) from the request context.

This means that even if a session is closed, a subsequent request will still get a new DB session as the single source of generated sessions is never exposed (once the global variable is converted back to private).

github-actions[bot] commented 1 year ago

Coverage Status

coverage: 59.236% (-3.2%) from 62.416% when pulling 509ccb387515cb099e93a5b9ef4fd6f363924620 on inject-db-middleware into fa79eceb0d1f727d2b6392d650c18b24cc21ce65 on main.