头图
In order to quickly manage the database, we generally choose a convenient database management tool. Although Navicat and DataGrip are easy to use, they are all charged. Today I would like to recommend a free and powerful database management tool DBeaver , I hope it will help you!

SpringBoot actual combat e-commerce project mall (50k+star) address: https://github.com/macrozheng/mall

Introduction to DBeaver

DBeaver is an open source database management tool. There is already 22K+ Star on Github. Supports as many as 100 kinds of databases, whether it is a relational database or a non-relational database, it can basically support any database you can think of. Let's see if the databases it supports are enough!

Download and install

Next, let's download and install DBeaver, download the compressed package version directly, unzip it and use it.

  • After the download is complete, unzip it to the specified directory, and then double-click dbeaver.exe to run;

  • After running successfully, you can choose to create a test database (SQLite-based database) by default. Looking at the interface, it looks a bit like Eclipse. In fact, DBeaver is developed based on Eclipse.

Appearance configuration

After we install the tool, we will inevitably need some settings, such as setting the font size and so on. Next, we will set up DBeaver.
  • By default, the font of DBeaver is very small, we need to make it larger, choose window -> Preferences -> Appearance -> Color and font -> Basic -> Text font to set;

  • Then double-click to set the font size, for example, set the font size to 12 ;

  • If you want to quickly become familiar with DBeaver's shortcut keys, you can open Help -> Assistant Key Panel to view all shortcut keys;

  • If you are used to dark themes, you can also set DBeaver as a dark theme. You can set the theme in the window -> Preferences -> Appearance, just select Dark ;

  • After setting up, we look at the interface, it's still pretty cool!

Create data source

When using DBeaver to operate a database, we need to create a data source first.
  • We can choose upper left corner of the plus sign -> MySQL to create a MySQL data source;

  • After the creation is complete, enter the connection information to connect, if it is the first time to connect, it will prompt to download the JDBC driver;

  • After the connection is successful, you can see the database, table, view, index and other related information in the database on the left.

Management table related operations

After the database connection is created, we can operate on the tables in it. Next, let's check and create the following table to try.
  • Double-click a table, select attribute label, you can see the detailed column attributes of the table;

  • Select attribute -> DDL to view the detailed table creation statement;

  • Select the data label, you can view the data in the table by page;

  • where part of the SQL statement in the top filter box to directly filter the table data;

  • If we don't want to display some fields, we can right-click the header and select Filter -> Custom Filter, and then change the filter field [v] to [] ;

  • If you want to create a new table, right-click on the left side and select create a new table;

  • Then right-click and select Add Field. In DBeaver, the [v] symbol represents yes, and [] represents no. Here we create a primary key ID and select auto-increment;

  • It should be noted here that the primary key needs to be created in the constraint, choose to create the constraint, and then id as the primary key constraint.

SQL operation

After the introduction of database table operations, let's introduce how to perform SQL operations in DBeaver.
  • Right-click the database and select SQL editor to open the SQL interface for operations;

  • The SQL prompt function of DBeaver is quite powerful, and it supports SQL keywords, functions, database tables and fields;

  • Sometimes we need to create insert all fields of 0616f7f3c74d3c. At this time, handwriting is more troublesome. We can directly use DBeaver generate SQL function, right-click to select a record, and select generate SQL;

  • We can find that CRUD statements based on all fields can be generated basically, which is quite convenient. Let's try to insert

Other database support

Although DBeaver supports as many as 100 databases, the community version does not support many databases, and the commonly used NoSQL databases MongoDB and Redis are not supported.
  • Only the enterprise version can support Redis. After creating a Redis connection, you can manage the data in Redis;

  • After creating a MongoDB connection, you can also manage the data in MongoDB.

Summarize

DBeaver is indeed a very good open source database management tool, with complete hints and many functions, and it is basically enough for normal development. However, compared with those fee-based tools, there are still some shortcomings. Comparing Navicat, it does not have the database structure synchronization , nor the database design function. Compared with DataGrip , its prompt function is a bit weak, and the function does not prompt.

Reference

Project official website: https://github.com/dbeaver/dbeaver

This article GitHub https://github.com/macrozheng/mall-learning has been included, welcome to Star!

macrozheng
1.1k 声望1.3k 粉丝