Don't run prepare_connection() on internal database, closes #2468

This commit is contained in:
Simon Willison 2025-02-18 10:23:23 -08:00
commit 209bdee0e8
3 changed files with 13 additions and 3 deletions

View file

@ -59,6 +59,11 @@ async def test_hook_plugin_prepare_connection_arguments(ds_client):
"database=fixtures, datasette.plugin_config(\"name-of-plugin\")={'depth': 'root'}"
] == response.json()
# Function should not be available on the internal database
db = ds_client.ds.get_internal_database()
with pytest.raises(sqlite3.OperationalError):
await db.execute("select prepare_connection_args()")
@pytest.mark.asyncio
@pytest.mark.parametrize(