kopia lustrzana https://github.com/simonw/datasette
_memory database should not be mutable, closes #1917
rodzic
9f5321ff1e
commit
6b47734c04
|
@ -278,7 +278,9 @@ class Datasette:
|
||||||
self.crossdb = crossdb
|
self.crossdb = crossdb
|
||||||
self.nolock = nolock
|
self.nolock = nolock
|
||||||
if memory or crossdb or not self.files:
|
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
|
# 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
|
# unique in-memory named database - otherwise unit tests can fail with weird
|
||||||
# errors when different instances accidentally share an in-memory database
|
# errors when different instances accidentally share an in-memory database
|
||||||
|
|
|
@ -59,7 +59,7 @@ async def test_datasette_constructor():
|
||||||
"route": "_memory",
|
"route": "_memory",
|
||||||
"path": None,
|
"path": None,
|
||||||
"size": 0,
|
"size": 0,
|
||||||
"is_mutable": True,
|
"is_mutable": False,
|
||||||
"is_memory": True,
|
"is_memory": True,
|
||||||
"hash": None,
|
"hash": None,
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue