-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reuse the sqlalchemy engine once it's created (#4493)
* Reuse the sqlalchemy engine once it's created * Implement `rx.asession` for async database support Requires setting `async_db_url` to the same database as `db_url`, except using an async driver; this will vary by database. * resolve the url first, so the key into _ENGINE is correct * Ping db connections before returning them from pool Move connect engine kwargs to a separate function * the param is `echo` * sanity check that config db_url and async_db_url are the same throw a warning if the part following the `://` differs between these two * create_async_engine: use sqlalchemy async API update types * redact ASYNC_DB_URL similarly to DB_URL when overridden in config * update rx.asession docstring * use async_sessionmaker * Redact sensitive env vars instead of hiding them
- Loading branch information
Showing
4 changed files
with
141 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters