kennethreitz / records

SQL for Humans™
https://pypi.python.org/pypi/records/
ISC License
7.14k stars 570 forks source link

Failure to acquire `DATABASE_URL` when set after import #179

Open fritz-clicktripz opened 5 years ago

fritz-clicktripz commented 5 years ago

Records extracts DATABASE_URL from the environment at the module level, at import time.

If the environment changes in between the import, and the instantiation, this change is not reflected.

Proposal to move https://github.com/kennethreitz/records/blob/master/records.py#L13, into the initialization step, conditionally if the value is null at initialization time.