The editor now has context aware completions

This commit is contained in:
eelke 2026-10-22 17:52:37 +02:00
parent 1a1bbd0838
commit 960967c8a6
18 changed files with 1984 additions and 0 deletions

View file

@ -25,6 +25,28 @@ and opened with :kbd:`Ctrl+O` or :menuselection:`File --> Open query`. You can a
drag and drop a bunch of files onto the window and they will be opened in
seperate query tabs.
Completion
==========
The query editor proposes names while you type, or when you press :kbd:`Ctrl+Space`.
After ``FROM``, ``JOIN`` and ``UPDATE`` schemas and tables are proposed,
and after ``schema.`` the relations of that schema. In other places the columns of the
tables in the query are proposed, also when the ``FROM`` clause comes after the cursor.
Type ``alias.`` or ``table.`` to only see the columns of that relation.
Use :kbd:`Up`/:kbd:`Down` to select, :kbd:`Enter` or :kbd:`Tab` to accept and :kbd:`Esc` to close the list.
Names that need quotes, for instance reserved words or names with capitals, are inserted
quoted. When a column name occurs in more than one table of the query, every
occurrence is listed with its table or alias in bold and accepting it inserts the
name qualified, for example ``o.id``.
After ``JOIN`` the list starts with complete join clauses such as
``customers c ON o.customer_id = c.id``, deduced from the foreign keys of the
tables already in the query. Both directions and multi-column keys are supported
and the generated alias never clashes with a name already in use.
Functions are proposed once you have typed the start of their name.
Explain
=======