drawdb
Applicationdrawdb-io/drawdb
Free in-browser database ERD editor and SQL generator.
Overview
DrawDB is a free, simple and intuitive database entity relationship diagram editor that runs entirely in the browser. Users can build diagrams, generate SQL scripts, and export migrations without creating an account. It supports multiple database systems like PostgreSQL, MySQL, SQLite, and more.
README Preview
\n Special thanks to:\n \n \n \n \n Next-gen AI-powered intelligent terminal for all platforms\n \n\n\n\n\n\n\n \n drawDB\n\n\nFree, simple, and intuitive database schema editor and SQL generator.\n\n\n \n \n \n \n \n \n \n \n \n\n\n\n\nDrawDB is a robust and user-friendly database entity relationship diagram (ERD) editor right in your browser. Build diagrams with a few clicks, export and import SQL scripts, generate migrations, customize your editor, and more without creating an account. See the full set of features on [here](https://drawdb.app/).\n\n## Getting Started\n\n### Local Development\n\n```bash\ngit clone https://github.com/drawdb-io/drawdb\ncd drawdb\nnpm install\nnpm run dev\n```\n\n### Build\n\n```bash\ngit clone https://github.com/drawdb-io/drawdb\ncd drawdb\nnpm install\nnpm run build\n```\n\n### Docker Build\n\n```bash\ndocker build -t drawdb .\ndocker run -p 3000:80 drawdb\n```\n\nIf you want to enable sharing, set up the [server](https://github.com/drawdb-io/drawdb-server) and environment variables according to `.env.sample`. This is optional unless you need to share files.\n\n## Contributing\n\nPlease see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to contribute to this project.\n\n## Support\n- Join discussions: [Discord](https://discord.gg/BrjZgNrmR6)\n
FAQ (4)
TroubleshootingWhy does DrawDB Docker ignore VITE_BACKEND_URL and post to /diagrams/undefined/gists?
Vite replaces import.meta.env.VITE_BACKEND_URL at build time, so older DrawDB images cannot read -e VITE_BACKEND_URL=... with docker run. Update to an image containing the runtime-configuration fix, then start a new container:
docker pull ghcr.io/drawdb-io/drawdb:latest
docker run -d --name drawdb \
-p 3024:80 \
-e VITE_BACKEND_URL=https://api.example.com \
ghcr.io/drawdb-io/drawdb:latest
Use the backend origin without a trailing slash. After starting it, hard-refresh the browser (Ctrl+Shift+R) to avoid cached configuration. In DevTools, the Share/Gist request should go to https://api.example.com/diagrams/.../gists instead of http://localhost:3024/editor/diagrams/undefined/gists.
Docker Compose equivalent:
services:
drawdb:
image: ghcr.io/drawdb-io/drawdb:latest
ports:
- "3024:80"
environment:
VITE_BACKEND_URL: https://api.example.com
On older images without the fix, the variable must be present during the image build—for example by adding it to .env before running docker build—because setting it only at container runtime has no effect.
TroubleshootingHow to fix a color picker closing when the cursor moves outside its boundary?
Remove the onMouseLeave event handler from the outer ColorPicker wrapper. For example, delete onMouseLeave={handleColorPick} from the wrapper div. The picker should close only on an actual outside click, not when the mouse temporarily leaves its boundary while selecting a color.
TroubleshootingWhy do all imported PostgreSQL enums change when I rename or edit only one enum in drawDB?
This happens because imported PostgreSQL enum objects did not receive unique IDs, so drawDB treated them as the same object during edits. It is fixed by adding a unique ID when each enum is created in the fromPostgres import function, for example: enums.push({ id: nanoid(), name, values }). Update drawDB to a release containing the fix for issue #1141. If self-hosting, patch the PostgreSQL enum creation step in fromPostgres to call nanoid() for every imported enum.
TroubleshootingHow do I fix drawdb.app showing a blank homepage with 'TypeError: n is not iterable'?
This was a production JavaScript bug in drawdb, not a browser-specific issue; it affected Chrome, Firefox, Edge, Safari, and Vivaldi. The maintainer deployed a fix. If the site is still blank, force-reload the latest assets with Ctrl+F5 (Windows/Linux) or Cmd+Shift+R (macOS), clear cached site data, or try an incognito/private window. For a self-hosted instance, update to the latest drawdb release/image and rebuild or restart it, for example: docker compose pull && docker compose up -d.