Adjust to provide for a generic database engine type#5
Draft
realtyem wants to merge 4 commits into
Draft
Conversation
Provide a new key in the database config of "driver" to be specific of the driver to use, which allows "name" to be a more generic "postgres" allowing swaping of the driver transparently to admins. Default to "psycopg2", if "name" is set to "postgres". Allow for "name" to remain "psycopg2" for backwards compatibility.
Author
|
I chose not to add to |
Author
|
I am not completely confident I regenerated the configuration docs correctly. The new script for such does not appear to be documented anywhere I could find |
realtyem
commented
Nov 27, 2025
| | `total_users` | int | The number of registered users on the homeserver. | | ||
| | `total_nonbridged_users` | int | The number of users, excluding those created by an Application Service. | | ||
| | `daily_user_type_native` | int | The number of native, non-guest users created in the last 24 hours. | | ||
| | `daily_user_type_native` | int | The number of native, non-guest users created in the last 24 hours. | |
Author
There was a problem hiding this comment.
I did not purposely change anything here, I suspect some kind of automated whitespace adjustment
realtyem
commented
Nov 27, 2025
| raise ConfigError("Unsupported database type %r" % (db_engine,)) | ||
|
|
||
| if db_engine == "sqlite3": | ||
| db_config["driver"] = "sqlite3" |
Author
There was a problem hiding this comment.
This is guarding against trying to use, for example, aiosqlite or something. No spoilers!
…nly used psycopg2, fixed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Provide a new key in the database config of "driver" to be specific of the driver to use, which allows "name" to be a more generic "postgres" allowing swaping of the driver transparently to admins.
Default to "psycopg2", if "name" is set to "postgres". Allow for "name" to remain "psycopg2" for backwards compatibility.
This can easily be extended for sqlite3 as well
Per conversation in element-hq#14586 (comment)