Skip to content

exec-sql: query names, types, edit-sql, SheetsSheet query column#3020

Open
saulbert wants to merge 1 commit intodevelopfrom
fix-2136
Open

exec-sql: query names, types, edit-sql, SheetsSheet query column#3020
saulbert wants to merge 1 commit intodevelopfrom
fix-2136

Conversation

@saulbert
Copy link
Copy Markdown
Collaborator

@saulbert saulbert commented Mar 14, 2026

Summary

  • exec-sql now names sheets by the SQL query text instead of static "query"
  • New edit-sql command: edit the current sheet's query in place and reload
  • Query column added to SheetsSheet: view and edit queries, auto-reloads on edit
  • Column types (int/float) auto-detected from first result row in query sheets

Addresses all items from #2136.

@frosencrantz — would you mind trying this out and letting us know if it covers your workflow?

Test plan

  • Open a SQLite file, run exec-sql with different queries — each sheet gets a unique name
  • On a query sheet, run edit-sql — input pre-fills with current query, edits in place and reloads
  • Open SheetsSheet (S) — query column shows the SQL for query sheets
  • Edit the query column in SheetsSheet — sheet reloads with the new query
  • Run a query returning integers/floats — verify columns get typed (right-aligned)

🤖 Generated with Claude Code

… column #2136

- rawSql names sheets by the SQL query text instead of static "query"
- iterload_query detects column types (int/float) from first result row
- new edit-sql command edits current query in place and reloads
- query column on SheetsSheet shows/edits query with auto-reload

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@saulbert saulbert changed the title exec-sql: name sheets by query, add edit-sql exec-sql: query names, types, edit-sql, SheetsSheet query column Mar 14, 2026
@frosencrantz
Copy link
Copy Markdown
Contributor

I tried the suggested tests. One issue encountered:

I tried running edit-sql on a SqliteSheet for a table, like found via the SqliteIndexSheet and it allowed me to do that, and it renamed the sheet to the query. I don't think it should allow users to edit a SqliteSheet that represents a table. In this case the default query was already empty. Maybe the behavior should be to be fail or to call exec-sql and create a new sheet or tell user to run exec-sql

I guess if the sheet was a view it might be useful to allow me to edit the view query, and update the database, but I think that might be for another feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants