connect_read_only installs a progress handler that interrupts statements
still running a given number of seconds (10 by default) after the
connection is opened. The providers open the connection right before
running the query and consume all rows in the same request, so the
limit covers both preparing the query and fetching its rows.
The three SQLite providers now share SQLiteQueryDataProvider, which
opens the connection with its query_timeout class attribute, maps
SQLite errors raised while preparing the query or fetching rows to
RequestParameterInvalidException, and reports an interrupted query as a
timeout.
The sqlite, sqlite-table and sqlite-dict dataproviders run a
user-supplied query against the dataset file. They used to classify the
query with sqlparse (or a regex when sqlparse was missing) and then run
it on a read-write connection to the dataset file.
They now open the file with mode=ro&immutable=1 and install an
authorizer that only allows SELECT, table reads, function calls and
recursive CTEs, so SQLite refuses to prepare writes, ATTACH, VACUUM
INTO, PRAGMA and transaction statements. immutable=1 skips locking, so a
WAL-mode dataset can be read without creating -wal/-shm files next to
it, including in a read-only directory. Galaxy datasets do not change
once they are ready, which is what immutable requires.
A refused or failing query now raises RequestParameterInvalidException
(HTTP 400 with SQLite's message) instead of yielding a single empty
item.