"MySQL Inspector" tab
The "MySQL Inspector" tab is used to work on the MySQL server. It allows you to create new tables, enter and read data from the database, and significantly facilitate the creation of queries in edited documents. You can turn on the MySQL Inspector tab using the panel on the left, as well as from the menu under the button shown above or from the Main Menu / View . The tab consists of three main parts. There is a list of databases at the top. Below there is a tree showing the structure of the current database (arrangement of tables and their fields), on the right side of the tree there is a bar of the most frequently used commands. At the bottom, there is an inspector, which can present detailed information and structure of the selected table, or its content, as well as the result of a query to the database.
Database toolbar and list
Database selection list
Select the database you currently want to work with from the list. Spider will automatically connect to the server and display the structure in the tree below. Grouping of databases
It is possible to group databases. Groups are listed above ungrouped databases. Clicking on the group name will expand the list of databases collected in it. This is particularly useful if you use many different databases. You can specify the group to which a database is assigned in the MySQL Properties window.
"Database server settings" button
To the left of the list described above, you will find a button that launches the MySQL Database Server Settings window, where you can add new databases to work with or modify the settings of existing ones. Abort current operation" button
This button allows you to abort the operation currently being performed on the server. Vertical display
The table tree will be displayed on the left side of the tab, the table structure and content inspector on the right. Horizontal display
The table tree will be displayed at the top of the tab page, the table structure and content inspector at the bottom. Help button
Displaying help for the MySQL Inspector tab. Database structure tree
The tree displays the structure of the tables existing in the current database. It consists of three hierarchical types of branches, each of which has a separate popup menu: - Database server name (database name)
- Database table name
- Name of the field in the table
If you select a table or a table field in the tree (with a single click), the selected element will be highlighted in blue. Now just press Enter to paste the name of the selected item into the editor. This way, it was easier to build database queries in your scripts.
Database server name (database name)The main ( root) branch of the tree is the name of the server and the selected database. This branch has a pop-up menu, which you can display by clicking on it with the right mouse button:Create a new database
Displays a window to enter the name of the new database. Once accepted, the new database is created, provided the current user has the appropriate permissions on the server. Create a new table
Displays the Create New Table window. Refresh the list of tables
Refreshes the list of tables of the current database on the tree. This command is particularly useful when changes to the database tables have been made bypassing the Spider tools. Execute a SQL command
Opens the Execute SQL command window to allow you to manually enter your own database query. Execute SQL statements from the current document
Executes a SQL query from the current document open in the editor. Execute SQL statements from a file
Opens a window to select a file with SQL queries to be executed. Export content
Launches the Database Export Wizard, which enables the generation of a finished document based on the data retrieved from the database. Server properties
Displays the Database Server Properties window.
Database table nameThe next element of the tree is the name of the table in the database. All table names that exist in the database are listed in the tree. Each such branch has its own context menu containing commands for handling this table.Out of all the tables, one can be active, which means that its content and structure will be presented at the bottom of the "MySQL Inspector" tab. The active table is marked with its name in bold. To "activate" a table, double-click on its name. Another way is to select its name from the FavoritesTables and Queries list.
Show table content
Sets the current table as the active table and switches the lower part of the tab to the table content view. To make this command even faster, simply click on the table name while holding down the Alt (left) key. Show table structure
Sets the current table as the active table and switches the lower part of the tab to the Table Structure view. To make this command even faster, simply click on the table name while holding down the Ctrl key. SQL Query Builder
Opens the SQL Query Wizard with the default table selected and clicked to display the pop-up menu. Export content
Launches the Database Export Wizard, which allows you to generate a finished document based on the data retrieved from the database. By default, it will be set to export data from the table that was clicked. Administrative commands
Displays a submenu containing commands for the following operations to be performed on the selected table:
- Optimize table (implements the query OPTIMIZE TABLE name)
- Analyze table (implements the query ANALYZE TABLE name)
- Check for table errors (implements the query CHECK TABLE_name)
- Check for table errors (implements the query CHECK TABLE_name)
- Reload the table (implements the query FLUSH TABLE name)
The output of the commands can be displayed in the table content inspector. Paste the table name into the editor
Pastes the name of the table into the editor where the cursor is placed. This way, you don't have to remember the exact names of multiple tables from different databases, or type them in when manually creating database queries. You can also paste the table name into the query by dragging it from the tree into the document, or by pressing Enter when the table name on the tree has focus. Add table to favorites
Adds a table to the list of Favorite tables and database queries. This will give you quick access to it even when there are dozens or hundreds of tables in the database. Rename table
Allow table renaming Delete table
Deletes the table and all the data it contains. The deletion is preceded by a confirmation dialog. Please note that deleted tables and data can no longer be recovered! Clear table content
Deletes data from the table. The deletion is preceded by a confirmation dialog. Please note that deleted data can no longer be recovered! Table properties
Displays the Table Properties window, where you can edit the structure of the table(add and remove fields, create indexes, etc.).
Field name in the tableThe last, most nested elements of the tree are branches representing the names of table fields. Next to the field name, there is an icon that means:
- Normal table field
- Table field with superimposed index of type PRIMARY
There is only one command in the table field pop-up menu:
Paste the field name into the editor
Pastes the name of a table field into the editor where the cursor is placed. This way, you don't have to remember the exact names of many fields, or type them in when manually creating a database query. You can also paste a table field name into a query by dragging it from the tree into the document, or by pressing Enter when the table field name on the tree has focus. Toolbar
On the right side of the tree, there is a button bar with the most frequently used commands:
Database server settings
Displays the Database Server Settings window. Create a new table
Displays the Create New Table window. Rename table
Allow table renaming Delete table
Deletes the table and all the data it contains. The deletion is preceded by a confirmation dialog. Please note that deleted tables and data can no longer be recovered! Refresh the list of tables
Refreshes the list of tables of the current database on the tree. This command is particularly useful when changes to the database tables have been made bypassing the Spider tools. Show table content
Sets the current table as active and switches the lower part of the tab to the table content view. Show table structure
Sets the current table as active and switches the lower part of the tab to the Table structure view. SQL Query Builder
Opens the SQL Query Wizard with the default table selected (highlighted in blue). If you have not indicated any table, the active table is selected (bold). Execute SQL command
Expands the menu containing the following commands:
- Execute SQL command
- Opens the Execute SQL command window to allow you to manually enter your own database query.
- Execute SQL statements from the current document
- Executes an SQL query from the current document opened in the editor.
- Execute SQL statements from a file
- Opens a window for selecting a file with SQL queries to be executed.
Export content
Launches the Database Export Wizard, which enables the generation of a finished document based on the data retrieved from the database. File list help
This button displays this help page.
Detailed table structure
In the lower part of the tab, there are two tabs displaying alternately the structure of the current (active) table or its content. You can choose which of the tabs is to be displayed using the buttons at the bottom.
To quickly display the structure inspector of a selected table, you can click its name in the tree above while holding down the Ctrl button. You can display the contents of the table by clicking on it while holding down the Alt (left) key.
The table structure inspector contains basic information about the fields that make up the table. They are presented in four columns:
Field name
Name of field in table Data type Represents the type of data that can be stored in the field, e.g. varchar(100), enum('y', 'n') Empty
Displays whether a field can be empty (contain NULL value) Default value
Displays the default value as it will be entered into this field. Other
Displays other information about the table field, e.g. whether it has 'auto_increment' enabled. The table structure inspector has a pop-up menu containing three commands:
Paste the field name into the editor
Pastes the name of the field you clicked on to display the menu into the editor (this field is highlighted in blue when the menu is displayed). Refresh
Refreshes the inspector view by retrieving the table information again from the database. Edit table structure
Displays the Table Properties window, where you can edit the structure of the table (add and remove fields, create indexes, etc.). You can also open the Table Properties window by double-clicking anywhere in the Table Structure inspector. Table contents
The second tab displays the content of the current table (marked in bold in the tree above). The structure is more complicated - it has two buttonbars that allow you to control the content of the inspector, and the context menu for the record that is clicked is also richer.
The data is displayed in the form of a table, where each row is a consecutive record, and the individual fields are displayed as columns.
The records downloaded from the database can be sorted by left-clicking on the header with the field name. Right-clicking on any field header will display a list of all table fields, which allows you to select the field to sort by.
The tab has two button bars. The first - mini bar - has commands to define the range of data that will be displayed. There are buttons on it:
View all records
Click this button to display all records from the current table. Display 20 records
Click this button to display a group of 20 records from the current table. At the same time, the buttons shown below for navigating through successive groups of records will become active: Go to first record
Previous 20 records
Next 20 records
The tab has its own status bar, which displays information about the current view, the query, such as the name of the table, the number of displayed records, etc.
However, displaying data is not all that can be done with this tab. Data can also be added, edited and deleted. This is possible thanks to the buttons on the second bar on the right.
Editing existing data is very easy. Just put the cursor on the selected field to start typing. The existing data in this field will be deleted and replaced with the new ones. If you do not want to delete data, but only change it, click on it again after selecting the field. This will allow you to edit its contents directly. An alternative way to change the content of a field is to press the F2 key after selecting the field. You can also use property editors that make it easy to edit more complex fields, such as TEXT or TIMESTAMP fields. Just select a field and click the ellipsis button that appears inside the field.
To enter a new record, you can use the plus button in the bar on the right. Here again is an alternative. If the last record is indicated, you can quickly create a new one by pressing the down arrow key on your keyboard. You can do it even faster by pressing the Insert key.
To delete a record, just press Delete on the keyboard, or use the minus button on the bar on the right.
Initially, changes are made only locally on the inspector. After editing the records, you must approve the changes, which will save them to the database, or discard them. It is also possible to undo the last operation performed locally. The appropriate buttons are placed on the bar on the right:
Confirm replacements
Click to approve the changes and enter them into the database. Cancel changes
Click to cancel changes made locally. The button is active until the changes are made to the database. Add record
Click to add a new record locally. Delete record
Click to delete the locally indicated record. Undo last operation
Click to undo the last operation performed locally. The button is active until changes are made to the database. Refresh the view
Click to refresh the view of the database contents. If any changes have been made locally, you will be hinted to either save them to the database or discard them. Add to Favorite Tables and Queries
Click to add the current table to your Favorite Tables and Queries list. List of Favorite Tables and Queries
click for a list of Favorite Tables and Queries . Remove from Favorite Tables and Queries
click to view the Favorite Tables and Queries list to select from there to be removed. Sorting method
Click to select the sorting method. You will see a list with the same content as in the pop-up menu when you click on a field heading. Export content
Click to launch the Database Export Wizard. The default setting will be to export the current table. Insert the current query into the editor
Click to paste the query used to display the current data list into the editor. You can choose the format for pasting the query according to the templates defined in the Program Settings - MySQL Database Servers window
Favorite tables and queries
There can be many, even hundreds of tables in a database. So it can become annoying to keep looking for them in the tree. That is why the "Favorite tables and queries" list was created, which allows you to quickly reach selected items.
The list is composed of two groups. Favorite tables (if added) are at the top, and favorite queries at the bottom, created with the SQL Query Wizard .
After clicking the table, it is set as current, and its content will be displayed in the inspector according to the current settings (i.e. if the option to show only 20 records on the mini bar is selected, this number will be retrieved from the database). On the other hand, clicking on your favorite query will execute it and display the result in the "Contents" tab.
|