Skip to content

Mechanism for executing "isolated" database operations without prepared connection stuff #2218

@simonw

Description

@simonw

This one is a bit complicated.

Datasette Cloud needs a way to prevent people with write access (via datasette-write) from dropping certain important tables.

I've been building https://github.com/datasette/datasette-sqlite-authorizer to handle this - it can now be used to make a table completely read-only such that it can't be dropped even by db.execute_write(...).

Then I found a problem: running VACUUM against a database needs permission to insert/update into tables that should otherwise be protected.

... and datasette-edit-schema runs a VACUUM after deleting a table.

So I need a way to run a SQL operation that doesn't get affected by the various things plugins may have done to the DB connection (such as installing authorization callbacks).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions