* Add test for #4810: getQueryInfo() fails to detect 'from ' correctly
This test demonstrates that getQueryInfo("from ") incorrectly returns
EditingTable = false when it should return true. This prevents autocomplete
from suggesting tables after users type "from ".
The test currently fails as expected, proving the bug exists.
Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix#4810: Correct getQueryInfo() 'from ' detection for autocomplete
This commit fixes a bug where getQueryInfo("from ") incorrectly returned
EditingTable = false, preventing autocomplete from suggesting tables after
users type "from ".
The fix involves two changes:
1. Modified getPreviousWord() to correctly return "from" when the input is
"from " (single word followed by space). Previously, it returned an empty
string because it couldn't find a space before "from".
2. Modified isEditingTable() to check that the text ends with a space. This
ensures we only enable table suggestions when the user has typed "from "
(ready for a table name), not when they're in the middle of typing "from"
or after they've already started typing a table name like "from my_table".
The combination of these changes ensures:
- "from " → EditingTable = true (autocomplete shows tables)
- "from my_table" → EditingTable = false (autocomplete doesn't interfere)
- "from" → EditingTable = false (no space yet, not ready for table name)
All existing tests pass, and the new test from the previous commit now passes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
- Execute RefreshConnections asyncronously
- Add connection_state table to indicate the loading state of connections
- Optimise RefreshConnections by cloning connection schemas
- Add locking to ensure only a single instance of RefreshConnections runs
- Start executing queries without waiting for connections to load, add smart error handling to wait for required connection
- Optimise autocomplete for high connection count
- Autocomplete and inspect data available before all conections are refreshed
- Update file watcher to respond to CHMOD, so thaat it pickes up deletion of file contents
Closes#3394Closes#3267