Repository navigation
Description
Problem
The iOS query editor has no autocomplete. Every table and column name is typed letter by letter on a phone keyboard, and a typo only shows up as a server error after Run.
What the editor offers today:
- A plain
UITextViewwith autocorrection and smart quotes off (apple/TableProMobile/TableProMobile/Views/Components/SQLHighlightTextView.swift:15). - A bar above the keyboard with 13 fixed keys:
SELECT,FROM,WHERE,JOIN,AND,OR,INSERT,UPDATE,DELETE,*,(,)and;(SQLHighlightTextView.swift:115). - A SELECT * FROM ... submenu in the Query menu that fills in one template per table (
apple/TableProMobile/TableProMobile/Views/QueryEditorView.swift:425).
The Mac completes keywords, tables, columns, aliases and functions from where the cursor sits (features/autocomplete.mdx). Its context analyzer, SQLContextAnalyzer (apple/Packages/TableProMacCore/Sources/TableProAutocomplete/SQLContextAnalyzer.swift:151), imports only Foundation, os and TableProSQLGrammar, and its package already declares iOS 17 (apple/Packages/TableProMacCore/Package.swift:15). The iOS project does not link that package: apple/TableProMobile/project.yml lists only TableProCore and TableProOracle.
Proposed solution
- Show suggestions in the bar above the keyboard, in front of the fixed keys, and update them as the user types.
- What is offered depends on the cursor: tables and views after
FROM,JOIN,INTOandUPDATE; the columns of the tables in the statement afterSELECT,WHERE,ON,SETand an alias with a dot; keywords elsewhere. - Tapping a suggestion replaces the word being typed and quotes the name the way the engine needs.
- Names come from the table list the connection already loads, and columns are read per table on first use and kept for the session.
- Reuse the Mac's analyzer by moving
TableProAutocompleteinto a package the iOS app links, so both apps complete the same way. - On an iPad with a hardware keyboard, the same suggestions are reachable without touching the screen.
Done means: typing SELECT * FROM or on a database with an orders table offers orders, and typing o. after FROM orders o offers its columns.
Alternatives considered
The SELECT * FROM ... templates and the fixed key bar cover the first words of a query and nothing after them.
Platform
iOS
Related database type
N/A / General
Activity