You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried run datasette in immutable and directory mode at the same time. The documentation on this is a little ambiguous, but I figured out that if my configuration directory contains a inspect-data.json, generated by datasette inspect my-immutable.db --inspect-file=inspect-data.json, my-immutable would be loaded in immutable mode.
However, datasette would always load the database in mutable mode.
Problem resolution
After digging through the code, I found the problem. datasette checks which databases to load immutably by comparing just the filename and not the full path:
But my inspect-data.json contained absolute paths, because I had run datasette inspect /not/my/cwd/*.db --inspect-file=/not/my/cwd/inspect-data.json with absolute paths.
Because the paths are used inconsistently without this being mentioned in the documentation, I couldn’t figure out why the database was loaded mutably. After I changed the path to just the filename, the problem disappeared.
Problem description
I tried run datasette in immutable and directory mode at the same time. The documentation on this is a little ambiguous, but I figured out that if my configuration directory contains a
inspect-data.json
, generated bydatasette inspect my-immutable.db --inspect-file=inspect-data.json
,my-immutable
would be loaded in immutable mode.However, datasette would always load the database in mutable mode.
Problem resolution
After digging through the code, I found the problem. datasette checks which databases to load immutably by comparing just the filename and not the full path:
datasette/datasette/app.py
Lines 287 to 291 in 832f76c
But my
inspect-data.json
contained absolute paths, because I had rundatasette inspect /not/my/cwd/*.db --inspect-file=/not/my/cwd/inspect-data.json
with absolute paths.Because the paths are used inconsistently without this being mentioned in the documentation, I couldn’t figure out why the database was loaded mutably. After I changed the path to just the filename, the problem disappeared.
My specific configs can be found at https://github.com/tweaselORG/data.tweasel.org/tree/main/datasette.
/-/versions:
The text was updated successfully, but these errors were encountered: