Skip to content
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

DM-45281: Add Pydantic types for Postgres and Redis DSNs #270

Merged
merged 1 commit into from
Jul 18, 2024
Merged

Conversation

rra
Copy link
Member

@rra rra commented Jul 18, 2024

Add new types safir.pydantic.EnvAsyncPostgresDsn and safir.pydantic.EnvRedisDsn, which validate PostgreSQL and Redis DSNs but rewrite them based on the environment variables set by tox-docker. Programs using these types for their configuration will therefore automatically honor tox-docker environment variables when running the test suite. EnvAsyncPostgresDsn also enforces that the scheme of the DSN is compatible with asyncpg and the Safir database support.

@rra rra requested a review from jonathansick July 18, 2024 01:18
Add new types `safir.pydantic.EnvAsyncPostgresDsn` and
`safir.pydantic.EnvRedisDsn`, which validate PostgreSQL and Redis
DSNs but rewrite them based on the environment variables set by
tox-docker. Programs using these types for their configuration will
therefore automatically honor tox-docker environment variables when
running the test suite. `EnvAsyncPostgresDsn` also enforces that the
scheme of the DSN is compatible with asyncpg and the Safir database
support.
@rra rra force-pushed the tickets/DM-45281 branch from 57e2eb1 to 7c4a029 Compare July 18, 2024 15:40
Copy link
Member

@jonathansick jonathansick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! I like this solution to the tox-docker environment variable issue.

@rra rra merged commit f4f97b9 into main Jul 18, 2024
6 checks passed
@rra rra deleted the tickets/DM-45281 branch July 18, 2024 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants