When we are in the early stages of a project, when we need to design a large number of tables, it is more efficient to use database design tools! Today I recommend a Chinese open source database design tool chiner, beautiful interface, powerful function, I hope to help you!
SpringBoot e-commerce project mall (50K + STAR) address: github.com/macrozheng/…
Talk about PowerDesigner
The Mall project used PowerDesigner to design the database before. I feel that the interface of this tool is a little old and sometimes heavy to use. Let’s take a look at the effect of using it to design the database before.
Recently experienced a chiner, database design is really very convenient, the interface is beautiful, let us look at the effect of using it to design the database, really is a lightweight, modern database design tool!
Introduction of 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 has had a rough ride, and the authors of the project put it prominently on README, which shows how difficult it is to develop a useful open source tool. Let’s take a look at how it’s developed.
The installation
Chiner is a cross-platform database design tool that supports Windows, Mac, and Linux.
- We need to pay attention to download the installation package, use the right click, select
Save the link as
To download:Gitee.com/robergroup/…
- After the download is complete, decompress to the specified directory and double-click
exe
Execute the program can be opened;
- When you open up the interface, you’ll find that it’s very thoughtfully provided
Operation manual
andRefer to the template
.
The basic use
As a database design tool, Chiner’s functions are quite powerful. Let’s experience its basic functions through the official e-commerce reference template.
The basic concept
- Since Chiner needs to support multiple databases and be able to generate entity class code, this is it
The data type
This concept is used to map data types in Chiner to various databases and code, for examplestring
This data type;
- Remember that when we use other tools to design the database, we often need to set the length of characters, set the amount of money need to set the length and decimal number, in chiner as long as it is set well
Data fields
, will automatically generate, let’s look at the data field;
- The thing to notice here
Data fields
Need to bindThe data type
;
- Chiner also provides data dictionary functionality for enumeration types of fields, such as setting user status
0 - > freeze
.1 - > normal
.
Data sheet management
- When designing a database, there are often some common fields, such as
Creation time
,founder
,Update time
,Update one
This kind of field, using chiner can be automatically generated, clickSettings -> New table default field
Can;
- Next we add a new test table and see that all the public fields have been added;
- Careful friends can see that the current field is set
A capital
We are used to itlowercase
So let’s do that. SelectField code
, click on thecase
Button can be converted by one key;
- When we add a field, just select it
Data fields
, can automatically set the data type and length, such as the common primary key, name, string, etc., very convenient;
- Of course, we can also choose directly
The data dictionary
, you can also view the data dictionary directly.
Diagram management
- Use Chiner to create a diagram is also more convenient, click
New diagram
Then select the wire object asfield
Can;
- Next, drag the database table into the diagram.
- Connect related fields to create a line, right-click the line can edit the relationship;
- To see a complete diagram, the effect is still good, the operation is also very convenient;
- Chiner does not support the use of foreign keys to generate diagrams, but it is mentioned in the Java development manual of Alibaba
Foreign keys are not allowed
Since foreign keys are no longer used, it makes sense to pull relationships out of the database and into the designer.
Import and Export
Chiner also supports database reverse parsing, importing PowerDesigner files, exporting DDL scripts and Word documents.
- Before importing from the database, we need to configure the database connection information.
- Then select import from database;
- Then select the table to import;
- Of course, Chiner also supports importing from PowerDesigner files;
- When we have designed the database, we can use chiner’s export DDL function to synchronize the table to the database.
- Sometimes you may need database documentation, so you can use chiner to export Word documents without writing them by hand.
conclusion
Chiner is indeed a beautiful and powerful database design tool. It is much more lightweight and has a much higher interface than PowerDesigner. The only drawback is the inability to generate diagrams from foreign keys, which can be a hassle for some projects that use foreign keys.
The resources
- Project address: gitee.com/robergroup/…
- Operation manual: www.yuque.com/chiner/docs…
In this paper, making github.com/macrozheng/… Already included, welcome everyone Star!