drawdb-io / drawdb Goto Github PK
View Code? Open in Web Editor NEWFree, simple, and intuitive online database design tool and SQL generator.
Home Page: https://drawdb.app
License: GNU Affero General Public License v3.0
Free, simple, and intuitive online database design tool and SQL generator.
Home Page: https://drawdb.app
License: GNU Affero General Public License v3.0
At present, I have found that the save function cannot be used well, and it is not possible to create isolation for multiple projects, so each time only import and export can be done.
Now the data is stored in the browser database. If the browser is accidentally cleaned and not exported in a timely manner, all data will be lost
file:///home/dongwook/Documents/drawdb/node_modules/vite/bin/vite.js:7
await import('source-map-support').then((r) => r.default.install())
^^^^^
SyntaxError: Unexpected reserved word
I just followed the installation process and when i run npm run dev it shows that message
Would be nice if there is a docker image for this tool so it can be more easily run and deployed.
Related to the issue #32, the button in Notes and Area is not rendered on the right position in Safari.
When importing the following SQL, the relationships between the tables are not imported:
CREATE TABLE `Pattern` (
`Id` INT NOT NULL AUTO_INCREMENT,
`Description` VARCHAR(255),
`IsFlexible` BOOLEAN DEFAULT (FALSE),
`IsInterpolated` BOOLEAN NOT NULL DEFAULT (FALSE),
`PatternType` INT NOT NULL,
`ScenarioId` INT NOT NULL,
CONSTRAINT `PK_Pattern` PRIMARY KEY(`Id`)
);
CREATE TABLE `PatternDateValue` (
`PatternId` INT NOT NULL,
`Date` DATETIME NOT NULL,
`Value` DOUBLE,
CONSTRAINT `PK_PatternDateValue` PRIMARY KEY(`PatternId`,`Date`),
CONSTRAINT `FK_PatternDateValue_Pattern_PatternId` FOREIGN KEY(`PatternId`) REFERENCES `Pattern`(`Id`) ON DELETE CASCADE
);
CREATE TABLE `PatternNumberValue` (
`PatternId` INT NOT NULL,
`Number` SMALLINT NOT NULL,
`Value` DOUBLE,
CONSTRAINT `PK_PatternNumberValue` PRIMARY KEY(`PatternId`,`Number`),
CONSTRAINT `FK_PatternNumberValue_Pattern_PatternId` FOREIGN KEY(`PatternId`) REFERENCES `Pattern`(`Id`) ON DELETE CASCADE
);
Other relationships work as expected though. I can't figure out why some work and some don't.
Here is one that is imported correctly:
CREATE TABLE `ScenarioGroup` (
`Id` INT NOT NULL AUTO_INCREMENT,
`Description` VARCHAR(255),
`Name` VARCHAR(255),
`DateCreated` DATETIME NOT NULL,
CONSTRAINT `PK_ScenarioGroup` PRIMARY KEY(`Id`)
);
CREATE TABLE `Scenario` (
`Id` INT NOT NULL AUTO_INCREMENT,
`ScenarioGroupId` INT NOT NULL,
`DateCreated` DATETIME NOT NULL,
`Name` VARCHAR(255),
`Description` VARCHAR(255),
`ActiveSimulationId` INT DEFAULT (0),
`IsUpdateActive` BOOLEAN DEFAULT (TRUE),
`OperationalInfo` VARCHAR(255),
CONSTRAINT `PK_Scenario` PRIMARY KEY(`Id`),
CONSTRAINT `FK_Scenario_ScenarioGroup_ScenarioGroupId` FOREIGN KEY(`ScenarioGroupId`) REFERENCES `ScenarioGroup`(`Id`) ON DELETE CASCADE
);
Can you customize whether you need to display comments on the table? table and field comments. Shown after type.
I need Chinese
For the relationship between objects, can we design an option to decide whether to create foreign keys when generating database statements. Sometimes, we need to clarify the relationship between objects when designing, but at the database level, we do not want to create foreign keys.
Enter value and click enter or enter comma separated values in batch and click enter
The values should look like tags and the input field should no longer give an error
Focus goes to comment input field and the enum values input still shows an error
Chrome
Android
Qwe
Guys, your code is amazing! Its really intresting to learn it) But I found a non-critical bug I think in the main App.js file in the RestoreScroll function at line 85, I think you should probably replace useEffect with useLayoutEffect because when you try to reload the page you get a little annoying page jerking)
now:
/* user table */
CREATE TABLE `table_user` (
`user_id` BIGINT NOT NULL AUTO_INCREMENT UNIQUE,
-- userName
`user_name` VARCHAR(255),
`dept_id` BIGINT,
PRIMARY KEY(`user_id`)
);
expect:
CREATE TABLE `table_user` (
`user_id` BIGINT NOT NULL AUTO_INCREMENT UNIQUE,
`user_name` VARCHAR(255) comment 'userName',
`dept_id` BIGINT,
PRIMARY KEY(`user_id`)
) comment 'user table';
tinyint
not found
An error occurs when executing sql import
error detail
index-zgz2iI-B.js:454 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'toString')
at index-zgz2iI-B.js:454:3962
at Array.forEach (<anonymous>)
at index-zgz2iI-B.js:454:3611
at Array.forEach (<anonymous>)
at OZe (index-zgz2iI-B.js:454:3429)
at Xn (index-zgz2iI-B.js:465:20027)
at Object.In [as onOk] (index-zgz2iI-B.js:465:20583)
at Object.notifyOk (index-zgz2iI-B.js:54:89260)
at k$e.handleOk (index-zgz2iI-B.js:54:72272)
at Uy.handleOk (index-zgz2iI-B.js:54:86078)
The sql script is as follows
CREATE TABLE `sssqc` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`station_name` varchar(30) NOT NULL ,
`rvnm` varchar(30) NOT NULL ,
`tm` datetime NOT NULL ,
`rz` float DEFAULT NULL ,
`otq` float DEFAULT NULL ,
`rwptn` varchar(10) DEFAULT NULL ,
`rwptn_name` varchar(10) DEFAULT NULL ,
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ,
`gmt_modify` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
PRIMARY KEY (`id`),
UNIQUE KEY `station_name` (`station_name`,`tm`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
Let's say I point to a database or create table as queries exported out of current database,
can it automatically create a ER diagram.
Fuctionality similar to this : https://gitlab.com/Screwtapello/sqlite-schema-diagram/-/tree/main
LLM can be used to autogenerate table for some standard use cases or can have a chat assistant to generate queries based on the db selected.
Alternatively, by providing plugins, you can add the corresponding database relationship SQL by yourself
Drawdb can be drawn directly in vscode
Hi. Would it be possible to have other databases supported here?
I want a bit bigger size of a table box. No settings found.
Hello,
I've tested your software earlier, and it's very nice.
Working with geodatabase using Postgis, one addition that could be very interesting, is support for Geometry data type.
Indeed, For now it's not possible to select this type, but it'll could be great.
Or maybe letting the user specify a custom column type.
I may look into it if I find the time.
Thansk in advance for any answer,
Regards, Clément.
I recently came across drawdb and it looks great. If it can be turned into a PWA it would be much better. We can install it like an app and will take full screen height without URL bar. Hope this will be considered.
The undo action seems unreliable. I was able to reproduce the issue below :
Steps :
Result :
table2.ID is restored, but it's relationship with table.ID is lost.
Expected result :
table2.ID is restored with it's relationship(s).
Hi, ok draw-db is incredible, I'm obsessed!
Is there an auto-layout for use after importing? It seems all tables import on-top of each other and have to be hand sorted.
Does some form of auto arrangement exist and or is it possible to add?
Since this only saves data in the browser there is no way to have 2 people working on the same diagram at the same time. But as a workaround it would be nice if I could save the diagram to a file in our repo, then when someone wants to edit / view it they can run a docker image locally that would read the file and load the diagram into the local instance. They would still need to export the file afterwords and commit unless there could be a feature to only read/write to a file instead of indexedDB.
Rendering the Diagram to an image would be helpful for automatically generating documentation.
Diagrams help us visualise those relationships and they can also be beneficial to non-developers.
Please consider adding a command to render the diagram to an image (png preferably with option to generate with or without background for nice embedding)
IF I create a table A with column id
, Table B with column id
and a_id
,
then A.id and B.a_id is a one to many relation
when i drag b.a_id to a.id the relation name is called B_a_id_fk, and A is primary and B is foreign, this is correct
but, when i drag a.id to b.a_id, the relation name is called A_id_fk, B is primary, A is foreign, this is not correct,
so, i can use swap function to adjust which is the primary, then A is primary and B is foreign, this is correct, but the foreign key name is also called A_id_fk
so can it autoamtically correct the fk name when swap?
Blank screen after import a db with many tables
It would be great if it were possible to export to "Django Models". In other words, generate the models automatically.
Can you double-click the line to edit the relationship? When I have many relationships, it is difficult to find it in the relationship list.
We propose adding a feature that allows users to create links to their database diagrams and share them with other participants. This will enable users to quickly and easily exchange their data models, facilitating collaboration and learning.
like how some ORMs automatically handle this, would reduce the hand drawn boilerplate.
Where to create table association relationships?
Thanks very much for this tool!
I am wondering if it would be possible to convert the Enum values in the field description from boxes to text on double click, so that I can copy the existing Enums (csv) to another place? Currently that is not possible, and I need to retype or jump into some text representation of the diagram.
I would love this to support DBML. Tools like dbdiagram.io are nice but not OSS and their editor is also not as pretty as yours. But the ability to compile DBML to schemas of many databases (postgresql, mysql, etc...) is a major benefit. I would love this tool to also be able to generate diagrams from DBML of generate DBML from diagrams.
Currently, DrawDB does not support the nvarchar datatype. This datatype is commonly used in SQL Server databases for storing variable-length Unicode string data.
We kindly request the DrawDB development team to prioritize the implementation of nvarchar datatype support in the upcoming releases. This enhancement will significantly improve the compatibility and user experience for SQL Server database users.
I just moved my project from DBDiagram.io to drawDB (since it is easier for newcomers, and it is awesome!)
After I use it for a while, I would like to provide feedback based on my use case. One feedback is already mentioned in #12. Another one is related to schema/table group support.
For me, my biggest feature that could improve my workflow drastically is to include schema support for each table. Before you may ask, yes, subject area is a workaround for that.
But I think it would be easier to select schema, then create table inside schema, and group them inside the same schema area.
I understand that this feature is quite complex, honestly. However, it should improve my existing workflow that involved with several schema and a ton of tables.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.