datasette/datasette/utils
Simon Willison b311f735f9 Fix schema mismatch in empty result query
When no permission rules exist, the query was returning 2 columns (parent, child)
but the function contract specifies 3 columns (parent, child, reason). This could
cause schema mismatches in consuming code.

Added 'NULL AS reason' to match the documented 3-column schema.

Added regression test that verifies the schema has 3 columns even when no
permission rules are returned. The test fails without the fix (showing only
2 columns) and passes with it.

Thanks to @asg017 for catching this
2025-10-24 10:32:18 -07:00
..
__init__.py Test improvements and fixed deprecation warnings (#2464) 2025-02-04 14:49:52 -08:00
actions_sql.py Fix schema mismatch in empty result query 2025-10-24 10:32:18 -07:00
asgi.py Fix for RowNotFound, refs #2359 2024-06-21 16:10:16 -07:00
baseconv.py Rename to_decimal/from_decimal to decode/encode, refs #1734 2022-05-02 12:44:09 -07:00
check_callable.py Fix for asyncio.iscoroutinefunction deprecation warnings 2025-10-08 20:32:16 -07:00
internal_db.py catalog_views table, closes #2495 2025-07-15 10:22:56 -07:00
permissions.py Ensure :actor, :actor_id and :action are all available to permissions SQL, closes #2520 2025-10-24 10:32:18 -07:00
shutil_backport.py Upgrade to latest Black, closes #2239 2024-01-30 19:55:26 -08:00
sqlite.py Show pysqlite3 version on /-/versions, if installed - #1125 2020-12-03 14:08:50 -08:00
testing.py Fixed bug with ?_trace=1 and large responses, closes #2404 2024-08-21 10:58:17 -07:00