dbgate-api 4.8.8 → 5.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/env/portal/.env
CHANGED
|
@@ -38,7 +38,7 @@ SSH_LOGIN_mysqlssh=root
|
|
|
38
38
|
SSH_PASSWORD_mysqlssh=xxx
|
|
39
39
|
|
|
40
40
|
LABEL_sqlite=sqlite
|
|
41
|
-
FILE_sqlite=/home/jena
|
|
41
|
+
FILE_sqlite=/home/jena/.dbgate/files/sqlite/feeds.sqlite
|
|
42
42
|
ENGINE_sqlite=sqlite@dbgate-plugin-sqlite
|
|
43
43
|
|
|
44
44
|
# docker run -p 3000:3000 -e CONNECTIONS=mongo -e URL_mongo=mongodb://localhost:27017 -e ENGINE_mongo=mongo@dbgate-plugin-mongo -e LABEL_mongo=mongo dbgate/dbgate:beta
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dbgate-api",
|
|
3
3
|
"main": "src/index.js",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "5.0.0-alpha.1",
|
|
5
5
|
"homepage": "https://dbgate.org/",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"cors": "^2.8.5",
|
|
27
27
|
"cross-env": "^6.0.3",
|
|
28
28
|
"dbgate-query-splitter": "^4.9.0",
|
|
29
|
-
"dbgate-sqltree": "^
|
|
30
|
-
"dbgate-tools": "^
|
|
29
|
+
"dbgate-sqltree": "^5.0.0-alpha.1",
|
|
30
|
+
"dbgate-tools": "^5.0.0-alpha.1",
|
|
31
31
|
"diff": "^5.0.0",
|
|
32
32
|
"diff2html": "^3.4.13",
|
|
33
33
|
"eslint": "^6.8.0",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@types/fs-extra": "^9.0.11",
|
|
65
65
|
"@types/lodash": "^4.14.149",
|
|
66
|
-
"dbgate-types": "^
|
|
66
|
+
"dbgate-types": "^5.0.0-alpha.1",
|
|
67
67
|
"env-cmd": "^10.1.0",
|
|
68
68
|
"node-loader": "^1.0.2",
|
|
69
69
|
"nodemon": "^2.0.2",
|
package/src/controllers/files.js
CHANGED
|
@@ -99,6 +99,12 @@ module.exports = {
|
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
101
|
|
|
102
|
+
loadFrom_meta: true,
|
|
103
|
+
async loadFrom({ filePath, format }, req) {
|
|
104
|
+
const text = await fs.readFile(filePath, { encoding: 'utf-8' });
|
|
105
|
+
return deserialize(format, text);
|
|
106
|
+
},
|
|
107
|
+
|
|
102
108
|
save_meta: true,
|
|
103
109
|
async save({ folder, file, data, format }, req) {
|
|
104
110
|
if (folder.startsWith('archive:')) {
|
|
@@ -162,6 +162,7 @@ module.exports = {
|
|
|
162
162
|
authTypes_meta: true,
|
|
163
163
|
async authTypes({ engine }) {
|
|
164
164
|
const packageName = extractPackageName(engine);
|
|
165
|
+
if (!packageName) return null;
|
|
165
166
|
const content = requirePlugin(packageName);
|
|
166
167
|
const driver = content.drivers.find(x => x.engine == engine);
|
|
167
168
|
if (!driver || !driver.getAuthTypes) return null;
|
package/src/currentVersion.js
CHANGED
|
@@ -4,6 +4,7 @@ const fs = require('fs');
|
|
|
4
4
|
const cleanDirectory = require('./cleanDirectory');
|
|
5
5
|
const platformInfo = require('./platformInfo');
|
|
6
6
|
const processArgs = require('./processArgs');
|
|
7
|
+
const consoleObjectWriter = require('../shell/consoleObjectWriter');
|
|
7
8
|
|
|
8
9
|
const createDirectories = {};
|
|
9
10
|
const ensureDirectory = (dir, clean) => {
|
|
@@ -27,7 +28,7 @@ function datadirCore() {
|
|
|
27
28
|
if (processArgs.workspaceDir) {
|
|
28
29
|
return processArgs.workspaceDir;
|
|
29
30
|
}
|
|
30
|
-
return path.join(os.homedir(), 'dbgate
|
|
31
|
+
return path.join(os.homedir(), '.dbgate');
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
function datadir() {
|
|
@@ -112,6 +113,27 @@ function clearArchiveLinksCache() {
|
|
|
112
113
|
archiveLinksCache = {};
|
|
113
114
|
}
|
|
114
115
|
|
|
116
|
+
function migrateDataDir() {
|
|
117
|
+
if (process.env.WORKSPACE_DIR) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (processArgs.workspaceDir) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
try {
|
|
125
|
+
const oldDir = path.join(os.homedir(), 'dbgate-data');
|
|
126
|
+
const newDir = path.join(os.homedir(), '.dbgate');
|
|
127
|
+
if (fs.existsSync(oldDir) && !fs.existsSync(newDir)) {
|
|
128
|
+
fs.renameSync(oldDir, newDir);
|
|
129
|
+
}
|
|
130
|
+
} catch (e) {
|
|
131
|
+
console.log('Error migrating data dir:', e.message);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
migrateDataDir();
|
|
136
|
+
|
|
115
137
|
module.exports = {
|
|
116
138
|
datadir,
|
|
117
139
|
jsldir,
|