-
-
Notifications
You must be signed in to change notification settings - Fork 653
Tips_&_Tricks
When working in a data grid (viewing table data or query results), you can press the Delete key to delete all rows included in the current selection. Alternatively, press Backspace to clear the contents of the selected cells (that is, set their values to NULL).
You can organize your databases into groups (virtual directories) in the database list. To manage groups, right-click anywhere in the list and use the group management options from the context menu.
Databases can be moved between groups using drag and drop.
When a group is deleted, all databases it contains are moved to the parent group. If the group has no parent, the databases are moved to the top level of the list.
You can change the order of columns in a table by opening the Table Window (simply double-click the table) and using drag and drop in the Structure tab.
Alternatively, you can select a column and use the Move Column Up or Move Column Down buttons on the toolbar (blue icons with up/down arrows).
You can easily move or copy tables (and views) between databases, even across SQLite 2 and SQLite 3 versions. Simply drag and drop them.
If Letos detects a problem that makes a table or view impossible to copy or move, it will explain the issue. Letos will also notify you about any minor changes required when transferring objects between SQLite 2 and SQLite 3. For example, SQLite 2 does not support the AUTOINCREMENT keyword. Letos automatically detects and fixes such compatibility issues, while informing you about the changes it makes.
The same can be achieved using the Copy and Paste entries in the context menu (right-click a table or view). However, this method only supports copying, not moving. This is intended to prevent accidental deletion of objects from the source database.
When typing a query in the SQL Editor, the editor can assist you with SQL syntax as well as database object names (tables, columns, and so on). Code completion is triggered automatically in many situations. For example, when you type a table alias followed by a dot:
SELECT * FROM tab WHERE tab.You can also trigger code completion manually by pressing Ctrl+Space. This is the default keyboard shortcut, but it can be changed in the configuration dialog.
When browsing table data (or SQL query results), hover the mouse pointer over a cell to display a tooltip containing all information that Letos knows about that cell. This includes column details and the row's ROWID.
If the tooltip does not contain a ROWID, it means that Letos was unable to determine it for that row. This can happen, for example, in SQL query results when a cell contains the result of an expression rather than data directly retrieved from a table.
Letos can display images directly in the Grid View. However, depending on the size and type of the data, it may sometimes be more convenient to use a dedicated viewer or editor.
For images, XML documents, and other supported formats, you can either switch to the Form View tab or right-click a cell and select "Open in Editor". This allows you to view and edit the data using tools tailored to its format, such as an image viewer or an editor with syntax highlighting.
By default, the SQL Editor executes only the query in which the cursor is currently placed. You can change this behavior in the configuration dialog and choose to always execute the entire contents of the SQL Editor.
Regardless of this setting, you can always select a portion of SQL code and press Execute. In that case, only the selected code will be executed.
- When a data cell is selected and you press Backspace, the cell value is set to NULL.
- When a data cell is selected and you press Delete, the entire row is marked for deletion (the row is not deleted immediately; the change must still be committed).
- When a data cell is selected, press Enter to start editing the cell. If you then remove its contents and confirm the edit, the cell value is set to an empty string.
When a query in the SQL Editor contains references to database objects such as tables, views, indexes, or triggers, hold Ctrl and those object names will become underlined. While holding Ctrl, click an object name to open it, just as if you had double-clicked it in the database list on the left.
You can also right-click such an object name in the SQL Editor to display the same context menu that would appear if you right-clicked the object in the database list.
SQLite does not support stored procedures, but Letos provides two features that can cover some similar use cases.
You can define your own SQL functions and use them directly in SQL queries. This is useful when you need reusable logic that can be called from many queries.
Custom SQL functions can be managed from their dedicated editor window. You can open it from the toolbar or from the Tools menu.
Code snippets let you save reusable pieces of SQL code and insert them quickly when writing queries. They are useful for common query templates, repeated statements, or larger SQL blocks that you do not want to type manually every time.
A code snippet can be inserted into the SQL editor in two ways:
- Drag and drop it from the snippets side panel into the editor.
- Invoke SQL code completion twice. The first invocation shows standard completion suggestions, while the second switches the assistant to code snippet mode.
Code snippets can be managed from their dedicated editor window, available from the toolbar and from the Tools menu.