If not --internal flag is passed but $DATASETTE_INTERNAL_DB_PATH is defined, then use that

This commit is contained in:
Alex Garcia 2023-09-06 09:02:50 -07:00
commit cfe90653ac

View file

@ -310,6 +310,9 @@ class Datasette:
Database(self, file, is_mutable=file not in self.immutables)
)
if internal is None and "DATASETTE_INTERNAL_DB_PATH" in os.environ:
internal = os.environ.get("DATASETTE_INTERNAL_DB_PATH")
self.internal_db_created = False
if internal is None:
self._internal_database = Database(self, memory_name=secrets.token_hex())