dbgate-api 5.5.7-alpha.27 → 5.5.7-alpha.28

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dbgate-api",
3
3
  "main": "src/index.js",
4
- "version": "5.5.7-alpha.27",
4
+ "version": "5.5.7-alpha.28",
5
5
  "homepage": "https://dbgate.org/",
6
6
  "repository": {
7
7
  "type": "git",
@@ -27,10 +27,10 @@
27
27
  "compare-versions": "^3.6.0",
28
28
  "cors": "^2.8.5",
29
29
  "cross-env": "^6.0.3",
30
- "dbgate-datalib": "^5.5.7-alpha.27",
30
+ "dbgate-datalib": "^5.5.7-alpha.28",
31
31
  "dbgate-query-splitter": "^4.11.2",
32
- "dbgate-sqltree": "^5.5.7-alpha.27",
33
- "dbgate-tools": "^5.5.7-alpha.27",
32
+ "dbgate-sqltree": "^5.5.7-alpha.28",
33
+ "dbgate-tools": "^5.5.7-alpha.28",
34
34
  "debug": "^4.3.4",
35
35
  "diff": "^5.0.0",
36
36
  "diff2html": "^3.4.13",
@@ -78,7 +78,7 @@
78
78
  "devDependencies": {
79
79
  "@types/fs-extra": "^9.0.11",
80
80
  "@types/lodash": "^4.14.149",
81
- "dbgate-types": "^5.5.7-alpha.27",
81
+ "dbgate-types": "^5.5.7-alpha.28",
82
82
  "env-cmd": "^10.1.0",
83
83
  "node-loader": "^1.0.2",
84
84
  "nodemon": "^2.0.2",
@@ -1,5 +1,5 @@
1
1
 
2
2
  module.exports = {
3
- version: '5.5.7-alpha.27',
4
- buildTime: '2024-11-12T07:28:52.564Z'
3
+ version: '5.5.7-alpha.28',
4
+ buildTime: '2024-11-12T07:52:42.134Z'
5
5
  };
@@ -12,6 +12,7 @@ const { resolveArchiveFolder } = require('../utility/directories');
12
12
  async function dataDuplicator({
13
13
  connection,
14
14
  archive,
15
+ folder,
15
16
  items,
16
17
  options,
17
18
  analysedStructure = null,
@@ -19,7 +20,7 @@ async function dataDuplicator({
19
20
  systemConnection,
20
21
  }) {
21
22
  if (!driver) driver = requireEngineDriver(connection);
22
-
23
+
23
24
  const dbhan = systemConnection || (await connectUtility(driver, connection, 'write'));
24
25
 
25
26
  try {
@@ -29,6 +30,12 @@ async function dataDuplicator({
29
30
  analysedStructure = await driver.analyseFull(dbhan);
30
31
  }
31
32
 
33
+ const sourceDir = archive
34
+ ? resolveArchiveFolder(archive)
35
+ : folder?.startsWith('archive:')
36
+ ? resolveArchiveFolder(folder.substring('archive:'.length))
37
+ : folder;
38
+
32
39
  const dupl = new DataDuplicator(
33
40
  dbhan,
34
41
  driver,
@@ -38,8 +45,7 @@ async function dataDuplicator({
38
45
  operation: item.operation,
39
46
  matchColumns: item.matchColumns,
40
47
  openStream:
41
- item.openStream ||
42
- (() => jsonLinesReader({ fileName: path.join(resolveArchiveFolder(archive), `${item.name}.jsonl`) })),
48
+ item.openStream || (() => jsonLinesReader({ fileName: path.join(sourceDir, `${item.name}.jsonl`) })),
43
49
  })),
44
50
  stream,
45
51
  copyStream,