dbgate/README.md

182 lines
8.3 KiB
Markdown
Raw Normal View History

2022-03-24 13:09:34 +00:00
[![NPM version](https://img.shields.io/npm/v/dbgate-serve.svg)](https://www.npmjs.com/package/dbgate-serve)
2021-05-05 18:05:09 +00:00
![GitHub All Releases](https://img.shields.io/github/downloads/dbgate/dbgate/total)
2021-02-04 15:23:11 +00:00
[![dbgate](https://snapcraft.io/dbgate/badge.svg)](https://snapcraft.io/dbgate)
[![dbgate](https://snapcraft.io/dbgate/trending.svg?name=0)](https://snapcraft.io/dbgate)
2020-01-29 19:58:42 +00:00
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
2021-12-15 16:33:05 +00:00
<img src="https://raw.githubusercontent.com/dbgate/dbgate/master/app/icon.png" width="64" align="right"/>
2019-12-24 16:48:25 +00:00
2021-12-15 16:33:05 +00:00
# DbGate - (no)SQL database client
DbGate is cross-platform database manager.
2021-12-11 17:51:10 +00:00
It's designed to be simple to use and effective, when working with more databases simultaneously.
But there are also many advanced features like schema compare, visual query designer, chart visualisation or batch export and import.
2020-05-18 18:52:52 +00:00
2024-06-25 19:55:43 +00:00
DbGate is licensed under GPL-3.0 license and is free to use for any purpose.
2021-12-15 16:33:05 +00:00
2021-01-31 07:00:37 +00:00
* Try it online - [demo.dbgate.org](https://demo.dbgate.org) - online demo application
2021-12-15 16:41:42 +00:00
* **Download** application for Windows, Linux or Mac from [dbgate.org](https://dbgate.org/download/)
2022-03-24 13:09:34 +00:00
* Run web version as [NPM package](https://www.npmjs.com/package/dbgate-serve) or as [docker image](https://hub.docker.com/r/dbgate/dbgate)
2021-01-31 06:51:20 +00:00
## Supported databases
* MySQL
* PostgreSQL
* SQL Server
2024-06-01 12:36:57 +00:00
* Oracle
* MongoDB
2022-03-28 17:11:22 +00:00
* Redis
* SQLite
* Amazon Redshift
* CockroachDB
* MariaDB
2024-09-03 13:17:58 +00:00
* CosmosDB (Premium)
<!-- Learn more about DbGate features at the [DbGate website](https://dbgate.org/), or try our online [demo application](https://demo.dbgate.org) -->
2021-12-15 16:35:30 +00:00
2021-12-15 16:33:05 +00:00
<a href="https://raw.githubusercontent.com/dbgate/dbgate/master/img/screenshot1.png">
<img src="https://raw.githubusercontent.com/dbgate/dbgate/master/img/screenshot1.png" width="400"/>
</a>
<a href="https://raw.githubusercontent.com/dbgate/dbgate/master/img/screenshot2.png">
<img src="https://raw.githubusercontent.com/dbgate/dbgate/master/img/screenshot2.png" width="400"/>
</a>
<a href="https://raw.githubusercontent.com/dbgate/dbgate/master/img/screenshot4.png">
<img src="https://raw.githubusercontent.com/dbgate/dbgate/master/img/screenshot4.png" width="400"/>
</a>
2021-12-15 16:35:30 +00:00
<a href="https://raw.githubusercontent.com/dbgate/dbgate/master/img/screenshot3.png">
<img src="https://raw.githubusercontent.com/dbgate/dbgate/master/img/screenshot3.png" width="400"/>
</a>
2021-12-15 16:33:05 +00:00
<!-- ![Screenshot](https://raw.githubusercontent.com/dbgate/dbgate/master/screenshot.png) -->
2019-12-24 16:48:25 +00:00
2020-11-16 19:18:49 +00:00
## Features
2021-01-31 06:51:20 +00:00
* Table data editing, with SQL change script preview
2021-10-14 06:06:13 +00:00
* Edit table schema, indexes, primary and foreign keys
2021-12-12 08:23:09 +00:00
* Compare and synchronize database structure
2022-01-26 17:21:58 +00:00
* ER diagram
2021-05-22 06:32:32 +00:00
* Light and dark theme
2021-11-15 18:12:24 +00:00
* Master/detail views, foreign key lookups
2021-01-23 08:32:53 +00:00
* Query designer
* Form view for comfortable work with tables with many columns
2021-04-22 15:06:07 +00:00
* JSON view on MongoDB collections
2021-04-12 19:19:25 +00:00
* Explore tables, views, procedures, functions, MongoDB collections
2021-05-22 06:32:32 +00:00
* SQL editor
* execute SQL script
* SQL code formatter
* SQL code completion
* Add SQL LEFT/INNER/RIGHT join utility
2021-04-12 19:19:25 +00:00
* Mongo JavaScript editor, execute Mongo script (with NodeJs syntax)
2022-03-28 17:11:22 +00:00
* Redis tree view, generate script from keys, run Redis script
2020-05-18 18:52:52 +00:00
* Runs as application for Windows, Linux and Mac. Or in Docker container on server and in web Browser on client.
2022-12-26 08:34:50 +00:00
* Import, export from/to CSV, Excel, JSON, NDJSON, XML
2020-11-16 19:18:49 +00:00
* Free table editor - quick table data editing (cleanup data after import/before export, prototype tables etc.)
2022-12-26 08:34:50 +00:00
* Archives - backup your data in NDJSON files on local filesystem (or on DbGate server, when using web application)
2021-11-15 18:12:24 +00:00
* Charts, export chart to HTML page
2020-05-18 18:52:52 +00:00
* For detailed info, how to run DbGate in docker container, visit [docker hub](https://hub.docker.com/r/dbgate/dbgate)
2021-12-12 08:23:09 +00:00
* Extensible plugin architecture
2022-12-26 08:34:50 +00:00
* Perspectives - nested table view over complex relational data, query designer on MongoDB databases
2020-05-18 18:52:52 +00:00
2021-05-22 06:32:32 +00:00
## How to contribute
Any contributions are welcome. If you want to contribute without coding, consider following:
2021-12-10 19:55:44 +00:00
2021-05-22 06:32:32 +00:00
* Tell your friends about DbGate or share on social networks - when more people will use DbGate, it will grow to be better
2021-12-10 19:42:35 +00:00
* Write review on [Slant.co](https://www.slant.co/improve/options/41086/~dbgate-review) or [G2](https://www.g2.com/products/dbgate/reviews)
2023-09-17 14:45:57 +00:00
* Create issue, if you find problem in app, or you have idea to new feature. If issue already exists, you could leave comment on it, to prioritise most wanted issues
2022-09-25 09:42:30 +00:00
* Create some tutorial video on [youtube](https://www.youtube.com/playlist?list=PLCo7KjCVXhr0RfUSjM9wJMsp_ShL1q61A)
2022-09-23 19:36:24 +00:00
* Become a backer on [GitHub sponsors](https://github.com/sponsors/dbgate) or [Open collective](https://opencollective.com/dbgate)
2023-09-17 14:45:57 +00:00
* Where a small coding is acceptable for you, you could [create plugin](https://dbgate.org/docs/plugin-development.html). Plugins for new themes can be created actually without JS coding
2021-05-22 06:32:32 +00:00
2021-12-10 19:55:44 +00:00
Thank you!
2021-01-31 06:51:20 +00:00
## Why is DbGate different
There are many database managers now, so why DbGate?
* Works everywhere - Windows, Linux, Mac, Web browser (+mobile web is planned), without compromises in features
* Based on standalone NPM packages, scripts can be run without DbGate (example - [CSV export](https://www.npmjs.com/package/dbgate-plugin-csv) )
2021-12-10 19:42:35 +00:00
* Many data browsing functions based using foreign keys - master/detail, expand columns, expandable form view
2019-12-24 16:48:25 +00:00
2020-01-21 06:58:19 +00:00
## Design goals
2023-09-28 07:28:15 +00:00
* Application simplicity - DbGate takes the best and only the best from old DbGate, [DatAdmin](https://www.softpedia.com/get/Internet/Servers/Database-Utils/DatAdmin-Personal.shtml), [DbMouse](https://www.softpedia.com/get/Internet/Servers/Database-Utils/DbMouse.shtml) and [SQL Database Studio](https://en.wikipedia.org/wiki/SQL_Database_Studio)
2020-11-16 19:18:49 +00:00
* Minimal dependencies
2022-05-19 11:43:07 +00:00
* Frontend - Svelte
* Backend - NodeJs, ExpressJs, database connection drivers
2020-03-13 21:42:09 +00:00
* JavaScript + TypeScript
2020-04-13 19:04:24 +00:00
* App - electron
2021-12-10 19:55:44 +00:00
* Platform independent - runs as web application in single docker container on server, or as application using Electron platform on Linux, Windows and Mac
2019-12-24 16:48:25 +00:00
2021-12-10 19:42:35 +00:00
<!-- ## Plugins
2020-11-30 20:18:56 +00:00
Plugins are standard NPM packages published on [npmjs.com](https://www.npmjs.com).
See all [existing DbGate plugins](https://www.npmjs.com/search?q=keywords:dbgateplugin).
2021-01-31 06:51:20 +00:00
Visit [dbgate generator homepage](https://github.com/dbgate/generator-dbgate) to see, how to create your own plugin.
2020-11-30 20:18:56 +00:00
Currently following extensions can be implemented using plugins:
- File format parsers/writers
- Database engine connectors
2021-12-10 19:42:35 +00:00
Basic set of plugins is part of DbGate git repository and is installed with app. Additional plugins pust be downloaded from NPM (this task is handled by DbGate) -->
2021-04-15 18:16:52 +00:00
2020-01-21 06:58:19 +00:00
## How to run development environment
2019-12-24 16:48:25 +00:00
2021-12-30 10:16:38 +00:00
Simple variant - runs WEB application:
2020-01-21 06:58:19 +00:00
```sh
yarn
yarn start
```
2019-12-24 16:48:25 +00:00
2021-12-30 10:16:38 +00:00
If you want more control, run WEB application:
2020-01-21 06:58:19 +00:00
```sh
2021-12-30 10:16:38 +00:00
yarn # install NPM packages
2020-01-21 06:58:19 +00:00
```
2019-12-24 16:48:25 +00:00
2021-12-30 10:18:37 +00:00
And than run following 3 commands concurrently in 3 terminals:
2021-12-30 10:16:38 +00:00
```
yarn start:api # run API on port 3000
2022-05-19 23:08:04 +00:00
yarn start:web # run web on port 5001
2021-12-30 10:16:38 +00:00
yarn lib # watch typescript libraries and plugins modifications
```
2022-05-19 23:08:04 +00:00
This runs API on port 3000 and web application on port 5001
Open http://localhost:5001 in your browser
2020-03-13 21:42:09 +00:00
2021-12-30 10:16:38 +00:00
If you want to run electron app:
2020-04-13 18:53:44 +00:00
```sh
2021-12-30 10:16:38 +00:00
yarn # install NPM packages
2020-04-13 18:53:44 +00:00
cd app
2021-12-30 10:16:38 +00:00
yarn # install NPM packages for electron
```
2021-12-30 10:18:37 +00:00
And than run following 3 commands concurrently in 3 terminals:
2021-12-30 10:16:38 +00:00
```
2022-05-21 05:51:30 +00:00
yarn start:web # run web on port 5001 (only static JS and HTML files)
2021-12-30 10:18:37 +00:00
yarn lib # watch typescript libraries and plugins modifications
2021-12-30 10:16:38 +00:00
yarn start:app # run electron app
2020-04-13 18:53:44 +00:00
```
## How to run built electron app locally
2022-05-19 23:08:04 +00:00
This mode is very similar to production run of electron app. Electron doesn't use localhost:5001.
2020-04-13 18:53:44 +00:00
```sh
cd app
yarn
```
```sh
yarn
yarn build:app:local
yarn start:app:local
```
2022-01-29 19:15:30 +00:00
## How to create plugin
Creating plugin is described in [documentation](https://github.com/dbgate/dbgate/wiki/Plugin-development)
But it is very simple:
```sh
npm install -g yo # install yeoman
npm install -g generator-dbgate # install dbgate generator
2022-01-29 19:19:52 +00:00
cd dbgate-plugin-my-new-plugin # this directory is created by wizard, edit, what you need to change
2022-01-29 19:15:30 +00:00
yarn plugin # this compiles plugin and copies it into existing DbGate installation
```
2023-01-22 11:12:56 +00:00
After restarting DbGate, you could use your new plugin from DbGate.
## Logging
2023-09-17 14:45:57 +00:00
DbGate uses [pinomin logger](https://github.com/dbgate/pinomin). So by default, it produces JSON log messages into console and log files. If you want to see formatted logs, please use [pino-pretty](https://github.com/pinojs/pino-pretty) log formatter.