Allow SQL functions in SQL write queries

Closes #2751
This commit is contained in:
Simon Willison 2026-05-28 10:22:16 -07:00
commit 51dab16149
6 changed files with 91 additions and 15 deletions

View file

@ -82,9 +82,7 @@ def decision_for_write_sql_operation(
"Writes to shadow tables are not allowed in user-supplied SQL"
)
if operation.operation == "function":
# SQL functions currently have no Datasette permission mapping. They are
# rejected by the user-supplied write SQL allow-list as unsupported.
return UnsupportedWriteSqlOperation(unsupported_message)
return IgnoreWriteSqlOperation("SQL function")
if (
operation.operation == "read"
and operation.target_type == "table"