Query data files in their own tab instead of overwriting the open one #7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/data-file-query-own-tab"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Double-clicking a data file (
.parquet,.csv,.tsv,.json,.jsonl,.ndjson) in the explorer, or using Query Data File (LIMIT 200) from its context menu, calledset_texton the active editor. That replaced whatever document was open with the generatedSELECT * FROM '<file>' LIMIT 200;query.Fix
QryDuckApp::query_data_fileopens the query in its own tab named after the file (e.g.sales.parquet.sql) and runs it from there. The open document isn't touched.SqlBuffer::generatedtreats the generated text as saved. The tab only becomes dirty once edited, so it doesn't trigger the unsaved-changes warning on close.data_file_query, which is shared by the double-click and context-menu paths.Testing
cargo testpasses (25 tests), including new tests for quote escaping indata_file_queryand forSqlBuffer::generatedstaying clean until edited.🤖 Generated with Claude Code