-
Notifications
You must be signed in to change notification settings - Fork 229
Allow passing a config dictionary to LMFDBDatabase constructor #6653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: edgarcosta <322822+edgarcosta@users.noreply.github.com>
|
@copilot Can we factor out |
Co-authored-by: edgarcosta <322822+edgarcosta@users.noreply.github.com>
Done! I've factored out the The functionality remains identical - all tests pass and the refactoring maintains full backward compatibility. Changes in commit a7b2096. |
|
@copilot Great! now move the |
Co-authored-by: edgarcosta <322822+edgarcosta@users.noreply.github.com>
Done! I've moved the Changes in commit 16e52ad. |
|
@havarddj would this make your life easier? |
The
LMFDBDatabaseconstructor now accepts an optionalconfigparameter, enabling flexible database configuration without requiring a fullConfigurationobject.Changes
configparameter toLMFDBDatabase.__init__()None(default): Creates standardConfiguration()object (preserves existing behavior)dict: Dictionary with optional keyspostgresql_options,flask_options,logging_optionsConfigurationobject: Used directly without modificationUsage Examples
Implementation Details
When a config dictionary is provided, the constructor creates a
ConfigWrapperclass that provides the same interface as theConfigurationclass, ensuring compatibility with the underlyingPostgresDatabaseparent class.The change maintains full backward compatibility - all existing code using
LMFDBDatabase()continues to work without modification.Fixes #6652.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.