Giter Site home page Giter Site logo

drawdb-io / drawdb Goto Github PK

View Code? Open in Web Editor NEW
9.2K 43.0 593.0 3.88 MB

Free, simple, and intuitive online database design tool and SQL generator.

Home Page: https://drawdb.vercel.app

License: MIT License

HTML 0.44% JavaScript 97.48% CSS 1.98% Dockerfile 0.10%
database-schema editor mariadb postgresql sql sql-server sqlite svg react indexeddb

drawdb's Introduction

drawdb logo

Free, simple, and intuitive database design tool and SQL generator.

drawDB · Discord

demo

drawDB

DrawDB is a robust and user-friendly database entity relationship (DBER) editor right in your browser. Build diagrams with a few clicks, export sql scripts, customize your editor, and more without creating an account. See the full set of features here.

Getting Started

Local Development

git clone https://github.com/drawdb-io/drawdb
cd drawdb
npm install
npm run dev

Build

git clone https://github.com/drawdb-io/drawdb
cd drawdb
npm install
npm run build

Docker Build

docker build -t drawdb .
docker run -p 3000:80 drawdb

Set up the server and environment variables according to .env.sample for the survey and bug report forms.

drawdb's People

Contributors

1ilit avatar clapalo avatar dott1e avatar gautamkrishnar avatar haecheonlee avatar imhalid avatar jonas-grgt avatar santilapi13 avatar yash-chudasama avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

drawdb's Issues

DBML support

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.

Field Circle Icons

Blue circle icons next to fields show out of position on Safari:

image

Looks fine on Google Chrome:

image

[Feature][Suggestion]Geometry Support

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.

[Feature] Copyable `Enum`

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.

Auto layout

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?

show comment

Can you customize whether you need to display comments on the table? table and field comments. Shown after type.

Render to image

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)

Add Support for nvarchar Datatype

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.

image

An error occurs when executing sql import

An error occurs when executing sql import
image

page error
image

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 ;

[Proposal] Add an option whether to create foreign keys.

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.

edit relationship

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.

[Feature] Make drawdb a PWA

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.

Auto generating Table

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.

Change the order of the fields in a table

The style of this tool is exceptionally elegant, enhancing the experience of database design. Gratitude to all contributors!

But i want it include a feature that can change the order of the fields in a table.

image

Relationships are not always imported correctly from source

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
);

Issue with RestoreScroll.

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)

[Suggestion] Schema/Table Group Support

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.

[Feature] Have a way to collaborate

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.

[Feature] Docker image

Would be nice if there is a docker image for this tool so it can be more easily run and deployed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.