Reprinted from: http://ywu.iteye.com/blog/2315495
Next, we use Datagrip to complete the common operations of the database, including querying data, modifying data, creating databases, tables, and so on.
The upper-left area shows the current database connection, the expansion will show the database table and other information, if there is no information after the expansion, need to check the database connection, click on the rotation icon above to sync, there is a more schema option, click to switch different schemas.
Right-click the database connection and select Open Console to write the SQL statement in the console on the right.
Datagrip Smart Tips is very cool, whether it is the standard SQL keyword, table name, field name, or even database-specific fields, can be prompted, have to sigh that this smart hint is too powerful, Intellij idea's smart hint is the second kill eclipse.
After you finish writing the SQL statement, you can select the green arrow on the top left side of the electron to perform
You can also use the shortcut key Ctrl+enter, which, if selected, will execute the SQL directly, and if there are multiple SQL in the console, you will be prompted which SQL to execute. Previously accustomed to the operation in the Dbvisualizer, dbvisualizer the cursor on the current SQL (SQL with a semicolon end), press CTRL +. Shortcut will automatically execute the current SQL, in fact Datagrip can also set, in setting-> In Database-general
When the statement executes, the default is prompt, after changing to smallest statement, when the cursor rests on the current statement, pressing Ctrl+enter will execute the current statement directly.
The execution result of the statement is displayed at the bottom
If the width of a column is too narrow, you can click on any one of the columns, use the shortcut keys ctrl+shift+ the left and right arrows to adjust the width, if you want to adjust the width of all columns, you can click on the upper left corner of the red box, select all rows, use the shortcut key ctrl+shift+ left and right arrow adjustment
adding rows, deleting rows is also very convenient, the upper +,-buttons can directly add rows or delete the selected row, edit the column is also very convenient, double-click the column to modify, enter the modified value, the mouse in the other parts of the click to complete the modification
Sometimes we want to set a field to NULL, not an empty string "", Datagrip also provides a gradient operation, right-click on the column, select Set NULL
For a multi-window view of the results, that is, you want the query results in the new tab, you can click the Pin tab button, the new query will not be displayed in the current tab, but a new tab opened
The output console next to it shows the log information for the execution of SQL, and can see information such as the time of SQL execution
I asked this hanging tool, and who ...
To create a new table is also quite simple, smart, select the database connection, click the green + number under Select Table
In the newly opened window, you can fill in the table information
I asked you to see this window excited not excited ...
The top can fill in the table name, table comments, in the middle can click on the right side of the Green + number to add columns, column type is also auto-complete, the default right of the message box icon Click can add comments on the column, next to a few tabs can be set index and foreign key
The DDL for all of these operations is displayed directly at the bottom
I asked you to be afraid.
When the table is finished, you can open the table view by clicking the tables icon in the image below.
You can view the table's data, or you can view the DDL statements
These basic features of the design, experience, has been amazing to me, the next step is the data export.