dbgate package

This commit is contained in:
Jan Prochazka
2021-02-01 18:09:57 +01:00
parent bd3c18d883
commit fdf60b5267
3 changed files with 54 additions and 1 deletions

24
app/README.md Normal file
View File

@@ -0,0 +1,24 @@
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![Donate](https://img.shields.io/badge/donate-paypal-blue.svg)](https://paypal.me/JanProchazkaCz/30eur)
[![NPM version](https://img.shields.io/npm/v/dbgate.svg)](https://www.npmjs.com/package/dbgate)
# DbGate - database administration tool
DbGate is fast and easy to use database administration tool for MySQL, PostgreSQL, SQL Server.
## Install using npm
```sh
npm install -g dbgate
```
Then run <code>dbgate</code> from commandline.
You can also download binary packages from https://dbgate.org
## Other dbgate packages
You can use some functionality of dbgate from your JavaScript code. See [dbgate-api](https://npmjs.com/dbgate-api) package.
## Screenshot
![Screenshot](https://raw.githubusercontent.com/dbshell/dbgate/master/screenshot.png)

View File

@@ -11,7 +11,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/dbshell/dbgate.git"
"url": "https://github.com/dbgate/dbgate.git"
},
"build": {
"appId": "org.dbgate",
@@ -58,12 +58,16 @@
"scripts": {
"start": "cross-env ELECTRON_START_URL=http://localhost:5000 electron .",
"start:local": "cross-env electron .",
"start:dbgate": "dbgate",
"dist": "electron-builder",
"build": "cd ../packages/api && yarn build && cd ../web && yarn build:app && cd ../../app && yarn dist",
"build:local": "cd ../packages/api && yarn build && cd ../web && yarn build:app && cd ../../app && yarn predist",
"postinstall": "electron-builder install-app-deps",
"predist": "copyfiles ../packages/api/dist/* packages && copyfiles \"../packages/web/build/*\" packages && copyfiles \"../packages/web/build/**/*\" packages"
},
"bin": {
"dbgate": "./src/dbgate"
},
"main": "src/electron.js",
"devDependencies": {
"copyfiles": "^2.2.0",

25
app/src/dbgate.js Normal file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env node
var electron = require('electron');
var proc = require('child_process');
var child = proc.spawn(electron, ['.'], { stdio: 'inherit', windowsHide: false });
child.on('close', function (code, signal) {
if (code === null) {
console.error(electron, 'exited with signal', signal);
process.exit(1);
}
process.exit(code);
});
const handleTerminationSignal = function (signal) {
process.on(signal, function signalHandler() {
if (!child.killed) {
child.kill(signal);
}
});
};
handleTerminationSignal('SIGINT');
handleTerminationSignal('SIGTERM');