====== SQL Editor - Left Side Panel Help ====== The Left Side Panel (or Navigator) of Valentina SQL Editor assists in writing queries. It allows you to access several different tabs including: Schema Tab, Queries Tab, Templates Tab and Snippets Tab. Click on each tab within the navigator to display the objects of the tab. ===== Schema Tab ===== The Schema tab-panel displays the schema tree of the current database to help you write SQL query more effectively. {{:valentina:products:vstudio:picts:vs_sql_editor_schema.png}} You can filter the tree using the filter field located at the bottom of the tab. ==== Double-Click Object ==== Double-click a Schema object in the Schema tab to add a reference into the SQL Editor at the current cursor position. {{:valentina:products:vstudio:picts:vs_sql_editor_left_dblclick.png|}} The addition to your code is appropriate to the type of Schema object. ==== Drag and Drop Database Objects ==== You can drag objects from the navigator into the main edit area. When objects are dropped into the edit area, Valentina Studio displays a dialog for editing options for the SQL command. If you drag a Table into the main edit area, you will see: {{:valentina:products:vstudio:picts:vs_sql_editor_drag_tbl_select.png|}} ==== Drag Container of Database Objects ==== You can drag entire folders with database objects, e.g. Tables or Fields. After dropping the objects, you get comma-separated list with names of all its elements: For Tables: "actor", "address", "category", "city", "country", "customer", "film", "film_actor", "film_category", "film_text", "inventory", "language", "payment", "rental", "staff", "store", "T1" For fields: "actor"."actor_id", "actor"."first_name", "actor"."last_name", "actor"."last_update" ==== Schema Tab Contextual Menu ==== Each object of the tree has the context menu: {{:valentina:products:vstudio:picts:vs_sql_editor_schema_menu.png}} ===== Queries Tab ===== The Queries tab-panel shows all queries, saved or created in the [[valentina:products:vstudio:help:query_editor | Valentina Studio Query Editor]]. {{:valentina:products:vstudio:picts:vs_sql_editor_queries.png}} Double-click a query to set its text within the [[valentina:products:vstudio:help:sql_editor:sql_editor | SQL Editor]]. ==== Queries Tab Toolbar ==== The Queries Tab toolbar is located at the bottom of the tab: * "Add" button opens the Query Editor to create a new query; * "Delete" button deletes the selected query; * Filter field to filter queries by name. ===== Templates Tab ===== On the SQL Editor Templates Tab are predefined templates of SQL commands. Templates differ depending on the database engine used. {{:valentina:products:vstudio:picts:vs_sql_editor_templates.png}} Double-click the template to add the text of the template to the SQL Editor. ==== Templates Tab Context Menu ==== {{:valentina:products:vstudio:picts:vs_sql_editor_snippet_template_menu.png}} You can copy to clipboard or send the template text to the editor. ===== Snippets Tab ===== The Snippets tab-panel lets you create, edit and save your own named code snippets. {{:valentina:products:vstudio:picts:vs_sql_editor_snippets.png}} Double-click the snippet to add it at the current position of the text cursor or drag snippet text to an arbitrary place. ==== Snippets Tab Toolbar ==== The Snippets Tab toolbar is located at the bottom of the tab: * "Add" button opens the dialog to create a new snippet; {{:valentina:products:vstudio:picts:vs_sql_editor_snippet_add.png}} * "Delete" button deletes the selected snippets; * Filter field to filter snippets by name. ==== Snippet Object Contextual Menu ==== {{:valentina:products:vstudio:picts:vs_sql_editor_snippet_menu.png}} You can: * Copy to Clipboard -- Copies the snippet text to the clipboard; * Send to SQL Editor -- Appends the snippet text to the query in SQL Editor; * Update from SQL Editor -- Updates the snippet text with the query in SQL Editor; * Edit... -- Opens dialog to edit snippet; * Delete... -- Deletes selected snippet; * Show For All Databases -- If ON, this snippet is shown for all databases. If OFF -- only for databases allowed with **Show For Current Database** option; * Show For Current Database -- If ON, this snippet will be shown for the current database. If OFF -- only if the snippet has **Show For All Databases** option. The list of snippets supports multiple selection. For the multiple snippets the context menu will look like: {{:valentina:products:vstudio:picts:vs_sql_editor_snippet_menu_multi.png}} ==== Snippet Navigator Contextual Menu ==== Click in the empty space of the tab to view actions that can be performed over all created snippets. {{:valentina:products:vstudio:picts:vs_sql_editor_snippets_user_menu.png}} * Add Snippet... -- Opens a dialog to create a new snippet; * Import... -- Import snippets from file on disk. After the import, you may need to allow the imported snippets to be shown for the current database if necessary; * Export... -- Export snippets to file on disk; * Show Snippets For All Databases -- If ON, this list shows all created snippets. If OFF -- only snippets allowed for the current database.