Skip to content

Rename settings to default_allow_facet, default_allow_download, default_allow_stream - #3072

Merged
simonw merged 2 commits into
mainfrom
default-allow-settings
Nov 15, 2026
Merged

simonw merged 2 commits into
mainfrom
default-allow-settings

Conversation

@simonw

@simonw simonw commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Renames three settings so they match default_allow_sql, using the SETTING_ALIASES mechanism so the names that shipped keep working.

Previous name New name Alias kept
allow_facet default_allow_facet Yes
allow_download default_allow_download Yes
allow_csv_stream default_allow_stream Yes
allow_stream default_allow_stream No

allow_stream was introduced after 1.0a42 and has never been in a release, so it gets no alias. allow_csv_stream, the name that did ship, now points at default_allow_stream.

Claude Fable 5.2 Medium

Details

  • Previous names work in config files, the settings= parameter, --setting, datasette.setting() and the settings dictionary passed to templates. They are not listed in --help-settings or /-/settings.json.
  • Breaking change: the datasette_allow_facet template variable is removed. table.html now sets DATASETTE_ALLOW_FACET from settings.default_allow_facet|tojson. Custom table.html templates that used the variable need the same change. The changelog says so.
  • The allow_download template variable is unchanged. It is not the setting's value: it also requires the database to be immutable and not in-memory.
  • Docs sections and :ref: labels are renamed, for example setting_default_allow_facet.
  • Changelog: the unreleased entry for the stream rename now names default_allow_stream, plus a new entry for the other two.

Not included

#1410 also floats adding these as permissions with allow_x metadata blocks. This PR only does the renames.

Testing

  • Full non-browser suite passes locally (3174 passed).
  • New alias tests cover each previous name, including that allow_facet: false still returns a 400 for ?_facet= and allow_download: false still returns a 403 for the .db download.
  • The Chromium Playwright suite was still running locally when this was opened.

Closes #1410

🤖 Generated with Claude Code

…lt_allow_stream

allow_facet and allow_download become default_allow_facet and
default_allow_download, matching default_allow_sql. The previous names
keep working everywhere a setting can be set or read, using
SETTING_ALIASES.

allow_stream becomes default_allow_stream. allow_stream was never in a
release so it has no alias. allow_csv_stream, the name that did ship,
now points at default_allow_stream.

The template context variables allow_download and datasette_allow_facet
are unchanged.

Closes #1410

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (fc67ea9) to head (54d53d2).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
datasette/views/base.py 0.00% 1 Missing ⚠️
datasette/views/database.py 0.00% 1 Missing ⚠️
datasette/views/table.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #3072   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files         80      80           
  Lines      14000   13999    -1     
=====================================
+ Misses     14000   13999    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

table.html now sets DATASETTE_ALLOW_FACET from
settings.default_allow_facet, so the table page no longer needs a
separate context variable that repeated the setting as a string.

Custom table.html templates that used datasette_allow_facet need to
switch to settings.default_allow_facet|tojson.

Refs #1410

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@simonw
simonw merged commit 2d5e496 into main Nov 15, 2026
7 of 13 checks passed
@simonw
simonw deleted the default-allow-settings branch November 15, 2026 21:59
@simonw simonw added this to the Datasette 1.0 stable milestone Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename settings to default_allow_facet and default_allow_download and default_allow_csv_stream

1 participant