头图
When we are in the early stage of project development, we often need to design a large number of tables. At this time, using database design tools will be more efficient! Today I would like to recommend a Chinese open source database design tool chiner with beautiful interface and powerful functions. I hope it will be helpful to everyone!

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

Talk about PowerDesigner

The previous mall project used PowerDesigner to design the database. I feel that the interface of this tool is a bit old, and sometimes it is more heavy to use. Let’s see the effect of using it to design the database before.

I recently experienced a chiner. Designing a database is indeed very convenient and the interface is also beautiful. Let us see the effect of using it to design a database. It is really a lightweight and modern database design tool!

Introduction to chiner

Chiner is a database relational model design tool that supports multiple databases and is independent of specific databases. It is implemented using React+Electron+Java technology stack.

Chiner's development process is relatively bumpy, and the project authors put its development process in the most conspicuous position of the README, which shows how difficult it is to develop a useful open source tool! Let's take a look at its development process.

Install

Chiner is a cross-platform database design tool that supports Windows, Mac, and Linux. Let's install it below.

  • After the download is complete, unzip it to the specified directory, double-click exe execute the program to open;

  • After opening the interface, you can find that the operation manual and the reference template are provided very intimately.

Basic use

As a database design tool, the function of chiner is quite powerful. Let's experience its basic functions through the official e-commerce reference template.

basic concept

  • Since chiner needs to support multiple databases and generate entity code, there is the data type, which is used to map data types in chiner to various databases and codes. For example, let’s look at the string This data type;

  • Remember that when we use other tools to design a database, we often need to set the length for setting characters, and the length and decimal places for setting the amount. As long as the data field is set in the chiner, it can be automatically generated. Let's take a look at the data field;

  • It should be noted here that the data field needs to be bound to the data type;

  • For the enumeration type of some fields, chiner also provides a data dictionary function. For example, we can set the user status 0->freeze, 1->normal.

Data sheet management

  • When designing a database, there are often some common fields, such as creation time, creator, update time, update person, etc. These fields can be automatically generated using chiner, click Settings -> New Table Default Fields;

  • Next, we add a test table, you can find that all the public fields have been added;

  • Careful friends can find that the current fields are all set in uppercase, we are used to lowercase, select the field code, click the uppercase and lowercase button to convert with one key;

  • When we add fields, as long as you directly select the data field, you can automatically set the data type and length, such as commonly used primary keys, names, strings, etc., which is very convenient;

  • Of course, we can also directly select the data dictionary, and you can also directly view the data dictionary after selection.

Diagram management

  • It is also more convenient to use chiner to create a relationship diagram. Click add a relationship diagram and select the connection object as the field;

  • Then drag the database table to the relationship diagram;

  • You can create a connection by connecting the fields with a relationship, and right-click the connection to edit the relationship;

  • Take a look at a complete relationship diagram, the effect is still good, the operation is also very convenient;

  • Before using PowerDesigner, you can directly use foreign keys to generate relationship graphs, but chiner does not support it. However, it is mentioned in the Alibaba Java Development Manual that must not use foreign keys. Since foreign keys are not used, the relationship is extracted from the database. It's understandable to leave the design tool.

Import and export use

Chiner also supports database reverse analysis, importing PowerDesigner files, exporting DDL scripts and Word documents, let's experience it below.
  • Before importing from the database, we need to configure the database connection information;

  • Then choose to import from the database;

  • Then select the table that needs to be imported;

  • Of course chiner also supports importing from PowerDesigner files;

  • After we design the database, we can use the export DDL function of chiner to synchronize the table to the database;

  • Sometimes you may need database documentation, just use chiner's exporting Word document function directly, without handwriting.

Summarize

Chiner is indeed a database design tool with beautiful interface and powerful functions. Compared with PowerDesigner, it is more lightweight and has a much taller interface. I feel that the only shortcoming is that the relationship diagram cannot be generated through foreign keys, which is more troublesome for some projects that use foreign keys.

Reference

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

macrozheng
1.1k 声望1.3k 粉丝