Skip to content

v1.2.1 - No default $DATABASE_URL

Compare
Choose a tag to compare
@tym-xqo tym-xqo released this 03 Oct 21:34
· 27 commits to main since this release
3532545

In its simplest configuration, sqla-raw gets a $DATABASE_URL from the local execution environment, and uses that as default connection string. In previous versions, the call to os.getenv() included in-memory SQLite database (sqlite:///) as a fallback default, in case the environment variable was not defined. This seemed handy and made some testing scenarios easier to provision, but could lead to confusing error messages in practice: an operator who hadn't realized that $DATABASE_URL was set to an expected postgresql://... value might be quite surprised to get SQLite syntax error exceptions when submitting SQL that's valid for Postgres but not supported in SQLite -- especially in the context of a larger program using sqla-raw as a library.

Better to have no default, and raise an exception specifically complaining that no database URL was specified when that's the case. That's the implementation from this release forward.

Calling this a minor update since the SQLite default was undocumented, it doesn't change the existing API meaningfully, and I doubt anyone is currently using it in a way that relies on the old default behavior.