This repository was archived by the owner on Aug 19, 2025. It is now read-only.
Replies: 1 comment 1 reply
-
|
@shawnwall Did you found any solution for this? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm not quite sure whether to post this question within
starletteor here, butdatabasesseems to be at the core of the issue.My db setup involves a RDS (aws mariadb/mysql) cluster with a writer (master) and various readers (slaves). I'm attempting to write some services in
starlettethat read and write data. The documentation on bothstarletteanddatabasespushes us to try to use the startup and shutdown events forconnect()anddisconnect()to a singleDatabase. Given I want to sometimes read, and sometimes write, always having connections around does not work unless I were to always connect and disconnect to both a reader and a writer.I attempted to use the context manager approach instead in an endpoint via:
without even trying to use the writer yet, and I'm getting the following errors spitting out:
AssertionError: Already disconnected....when running under any type of local testing volume. So... my general question is, how should we approach this with
databasesandstarlette?Beta Was this translation helpful? Give feedback.
All reactions