7. Writing SQL Queries

The most common kind of inner tab is the Query Tab, containing the following elements:

Once executed, the tabs are also saved in OmniDB user database (title and contents), so the next time you open OmniDB, you will see them all open. Also, every command you execute in a Query Tab is saved to your Query History and to the omnidb.log file too.

SQL Autocomplete

The SQL editor has a feature that helps a lot when creating new queries: SQL code completion. With this feature it is possible to autocomplete columns contained in a table referenced by an alias. To open the autocomplete interface you just have to type the alias, the character . and then hit Ctrl-Space:

If the user does not start the autocomplete with the cursor close to a table alias, the component will show multiple categories of data. By typing in the filter textbox, elements in all categories will be filtered:

The autocomplete component is also able to identify some contextual information. For example, if you type a name of a schema, then type the character ., then hit Ctrl-Space, you will be able to filter among objects contained only in that schema:

Please note that for RDBMS other than PostgreSQL, the autocomplete component only works for table columns.