_memory database should not be mutable, closes #1917

pull/1930/head
Simon Willison 2022-11-29 21:05:47 -08:00
rodzic 9f5321ff1e
commit 6b47734c04
2 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -278,7 +278,9 @@ class Datasette:
self.crossdb = crossdb
self.nolock = nolock
if memory or crossdb or not self.files:
self.add_database(Database(self, is_memory=True), name="_memory")
self.add_database(
Database(self, is_mutable=False, is_memory=True), name="_memory"
)
# memory_name is a random string so that each Datasette instance gets its own
# unique in-memory named database - otherwise unit tests can fail with weird
# errors when different instances accidentally share an in-memory database

Wyświetl plik

@ -59,7 +59,7 @@ async def test_datasette_constructor():
"route": "_memory",
"path": None,
"size": 0,
"is_mutable": True,
"is_mutable": False,
"is_memory": True,
"hash": None,
}