datasette/datasette
Claude fecbed82b4
Keep JSON parameter types for stored write queries and execute-write, refs #2946
Stored write queries converted every JSON value with str(), so null was
stored as 'None', true as 'True' and lists as Python repr. execute-write
kept JSON types but rejected arrays and objects and silently bound
missing parameters as empty strings.

Both endpoints now share one function for JSON parameters:

- strings, numbers and null pass through, true/false become 1/0, and
  arrays and objects are stored as JSON text, matching the insert API
- missing parameters return a 400 listing them
- unknown parameters return a 400

Stored write queries keep their top-level body shape, with _json and
csrftoken as the only reserved keys. Parameters declared in "params"
are accepted, magic parameters are not required, and a body wrapped in
{"params": ...} gets an error explaining the difference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012CXYAsBaNidHVk4GipkDjs
2026-10-06 13:52:44 +00:00
..
default_permissions Deny SQLite statistics table access through a default hook 2026-09-10 16:52:25 -07:00
publish Upgrade to ruff>=0.16.0 (#2857) 2026-07-25 15:47:08 -07:00
static Unify app, database, table, and column menus (#2984) 2026-10-05 11:14:19 -07:00
templates Show about metadata even without source or license, closes #512 2026-10-05 14:38:57 -07:00
utils Fix for GHSA-h547-rmjf-5m2m 2026-09-16 16:43:34 -07:00
views Keep JSON parameter types for stored write queries and execute-write, refs #2946 2026-10-06 13:52:44 +00:00
__init__.py Add datasette.add_background_task() with supervised launch after startup (#2889) 2026-09-15 10:55:54 -07:00
__main__.py Add support for running datasette as a module (#556) 2019-07-11 09:07:44 -07:00
_pytest_plugin.py Upgrade to ruff>=0.16.0 (#2857) 2026-07-25 15:47:08 -07:00
actor_auth_cookie.py Upgrade to ruff>=0.16.0 (#2857) 2026-07-25 15:47:08 -07:00
app.py Unify app, database, table, and column menus (#2984) 2026-10-05 11:14:19 -07:00
background_tasks.py Add /-/tasks introspection endpoint for supervised background tasks (#2892) 2026-09-15 11:56:53 -07:00
blob_renderer.py Upgrade to ruff>=0.16.0 (#2857) 2026-07-25 15:47:08 -07:00
cli.py OpenTelemetry tracing for the database layer (#2862) 2026-09-24 09:11:08 -07:00
column_types.py Upgrade to ruff>=0.16.0 (#2857) 2026-07-25 15:47:08 -07:00
csrf.py Upgrade to ruff>=0.16.0 (#2857) 2026-07-25 15:47:08 -07:00
database.py Simplify code comments added since 1.0a40 (#2957) 2026-09-24 13:52:29 -07:00
default_actions.py Upgrade to ruff>=0.16.0 (#2857) 2026-07-25 15:47:08 -07:00
default_column_types.py Normalize URL column schemes consistently 2026-09-08 21:16:35 -07:00
default_database_actions.py No execute-write on immutable databases 2026-05-25 12:46:21 -07:00
default_debug_menu.py Autocomplete widget and /-/debug/autocomplete test page 2026-06-13 22:59:37 -07:00
default_jump_items.py Remove source and source_key columns from JumpSQL 2026-05-23 20:41:32 -07:00
default_magic_parameters.py Upgrade to ruff>=0.16.0 (#2857) 2026-07-25 15:47:08 -07:00
default_query_actions.py Web UI to edit and delete stored queries (#2764) 2026-06-08 20:19:47 -07:00
default_table_actions.py Upgrade to ruff>=0.16.0 (#2857) 2026-07-25 15:47:08 -07:00
events.py Upgrade to ruff>=0.16.0 (#2857) 2026-07-25 15:47:08 -07:00
extras.py Return 400 for unknown _extra names on data formats 2026-07-04 16:16:02 +00:00
facets.py Don't 500 on ?_facets=x 2026-09-24 11:34:45 -07:00
filters.py Fix float coercion for numeric filter parameters (#2876) 2026-09-15 13:14:29 -07:00
fixtures.py Upgrade to ruff>=0.16.0 (#2857) 2026-07-25 15:47:08 -07:00
forbidden.py Upgrade to ruff>=0.16.0 (#2857) 2026-07-25 15:47:08 -07:00
handle_exception.py Return CSV errors as plain text, closes #2129 2026-09-15 15:53:10 -07:00
hookspecs.py Allow extra_template_vars to resolve to None 2026-09-16 10:30:11 -07:00
inspect.py Upgrade to ruff>=0.16.0 (#2857) 2026-07-25 15:47:08 -07:00
jump.py Upgrade to ruff>=0.16.0 (#2857) 2026-07-25 15:47:08 -07:00
permissions.py Match table permission identities using SQLite case semantics 2026-09-09 08:39:03 -07:00
plugins.py Deny SQLite statistics table access through a default hook 2026-09-10 16:52:25 -07:00
renderer.py Upgrade to ruff>=0.16.0 (#2857) 2026-07-25 15:47:08 -07:00
resources.py Match table permission identities using SQLite case semantics 2026-09-09 08:39:03 -07:00
sql_functions.py _search= queries now correctly escaped, fixes #651 2019-12-29 18:48:30 +00:00
stored_queries.py Upgrade to ruff>=0.16.0 (#2857) 2026-07-25 15:47:08 -07:00
telemetry.py Simplify code comments added since 1.0a40 (#2957) 2026-09-24 13:52:29 -07:00
telemetry_registry.py Simplify code comments added since 1.0a40 (#2957) 2026-09-24 13:52:29 -07:00
telemetry_testing.py Simplify code comments added since 1.0a40 (#2957) 2026-09-24 13:52:29 -07:00
template_contexts.py Clarify template context metadata names 2026-06-23 11:30:30 -07:00
tokens.py Upgrade to ruff>=0.16.0 (#2857) 2026-07-25 15:47:08 -07:00
tracer.py Upgrade to ruff>=0.16.0 (#2857) 2026-07-25 15:47:08 -07:00
url_builder.py Upgrade to ruff>=0.16.0 (#2857) 2026-07-25 15:47:08 -07:00
version.py Release 1.0a41 2026-09-24 11:58:30 -07:00
write_sql.py Reject untrusted table-valued PRAGMA reads 2026-09-08 21:16:35 -07:00