mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
ensure immutable databses when starting in configuration directory mode with (#1229)
* check if immutables is empty list of None * update docs on how to create the inspect-data.json
This commit is contained in:
parent
e72397d65b
commit
f92d823766
2 changed files with 2 additions and 2 deletions
|
|
@ -213,7 +213,7 @@ class Datasette:
|
|||
and not inspect_data
|
||||
):
|
||||
inspect_data = json.loads((config_dir / "inspect-data.json").read_text())
|
||||
if immutables is None:
|
||||
if not immutables:
|
||||
immutable_filenames = [i["file"] for i in inspect_data.values()]
|
||||
immutables = [
|
||||
f for f in self.files if Path(f).name in immutable_filenames
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ The files that can be included in this directory are as follows. All are optiona
|
|||
|
||||
* ``*.db`` - SQLite database files that will be served by Datasette
|
||||
* ``metadata.json`` - :ref:`metadata` for those databases - ``metadata.yaml`` or ``metadata.yml`` can be used as well
|
||||
* ``inspect-data.json`` - the result of running ``datasette inspect`` - any database files listed here will be treated as immutable, so they should not be changed while Datasette is running
|
||||
* ``inspect-data.json`` - the result of running ``datasette inspect *.db --inspect-file=inspect-data.json`` from the configuration directory - any database files listed here will be treated as immutable, so they should not be changed while Datasette is running
|
||||
* ``settings.json`` - settings that would normally be passed using ``--setting`` - here they should be stored as a JSON object of key/value pairs
|
||||
* ``templates/`` - a directory containing :ref:`customization_custom_templates`
|
||||
* ``plugins/`` - a directory containing plugins, see :ref:`writing_plugins_one_off`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue