mirror of
https://github.com/simonw/datasette.git
synced 2026-09-27 12:24:07 +02:00
Pass defaultTable to the SQL editor from table-scoped pages
The table page's 'View and edit SQL' link now carries ?_table=<name>; QueryView validates it against the actor-visible tables/views for the database before exposing it as default_table, so the editor completes that table's columns unprefixed. Stored/canned queries are unaffected. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
49f1660dcd
commit
cc1a24fb4f
5 changed files with 69 additions and 1 deletions
|
|
@ -168,6 +168,9 @@ The page for arbitrary SQL queries (/database/-/query?sql=...) and stored querie
|
|||
``db_is_immutable`` - ``bool``
|
||||
Boolean indicating if this database is immutable
|
||||
|
||||
``default_table`` - ``str``
|
||||
Name of the focal table for this query, if any - set when the query page was reached from a table-scoped context (such as the table page's 'View and edit SQL' link) so the SQL editor can complete that table's columns unprefixed. ``None`` otherwise, including for stored/canned queries.
|
||||
|
||||
``display_rows`` - ``list``
|
||||
List of result rows formatted for HTML display. Each row is a list of rendered cell values in the same order as ``columns``.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue