Allow Postgres in addition to SQLite #3
Draft
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.
Allow for Postgres as a backend through setting environment variables:
BW_DATA_POSTGRES: Should be truthyBW_DATA_POSTGRES_DATABASE: Postgres database nameBW_DATA_POSTGRES_USER: Postgres usernameBW_DATA_POSTGRES_PASSWORD: Postgres password for usernameBW_DATA_POSTGRES_PORT: Port, default is 5432BW_DATA_POSTGRES_URL: Host URL, default is "localhost"Current test implementation uses testcontainers, and tests on both Postgres and SQLite. The implementation isn't ideal as the container is rebuilt on each test, making them much slower than the SQLite tests. However, there are enough differences in the Peewee implementation that tests against Postgres are necessary, even in development.
Under Postgres there is no difference between projects, as we don't have separate database per project. This can be addressed later.
Only the tests in
tests/database.pyhave been adapted - the switch from a decorator to a pytest fixture means either manual adaptation or some clever regex function needs to be applied.bw2dataparameterization #2