erhosen-libs / pydjantic

Use Pydantic Settings in your Django application.
MIT License
36 stars 9 forks source link

Support conn_max_age & ssl_require in BaseDBConfig #7

Closed estahn closed 2 years ago

estahn commented 2 years ago

We should be able to set conn_max_age & ssl_require in BaseDBConfig.

erhosen commented 2 years ago

Done #8 👍🏻

estahn commented 2 years ago

Thanks @ErhoSen

How would I specify this as part of an environment variable?

erhosen commented 2 years ago

Hm, didn't think about that.

erhosen commented 2 years ago

U wanna something like this postgres://user:password@hostname:5432/database_name?conn_max_age=60&ssl_require=True?

estahn commented 2 years ago

Yes, that looks exactly what I was thinking of.

There is also Django's ATOMIC_REQUESTS, not sure if that is supported by the parser lib though.

erhosen commented 2 years ago

@estahn I've updated Readme, take a look

image

I believe it's your case. See tests for usage