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
-
I'm not quite sure whether to post this question within
starlette
or here, butdatabases
seems 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
starlette
that read and write data. The documentation on bothstarlette
anddatabases
pushes 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
databases
andstarlette
?Beta Was this translation helpful? Give feedback.
All reactions