@xuda.io/xuda-dbs-plugin-xuda 1.0.6 → 1.0.8
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/index.mjs +18 -18
- package/package.json +1 -1
- package/test_connection.js +16 -0
package/index.mjs
CHANGED
@@ -1025,21 +1025,21 @@ export const Restore = async (e, db, table_obj) => {
|
|
1025
1025
|
}
|
1026
1026
|
};
|
1027
1027
|
|
1028
|
-
export const test_connection = async (node_modules_path, setup_doc) => {
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
};
|
1028
|
+
// export const test_connection = async (node_modules_path, setup_doc) => {
|
1029
|
+
// try {
|
1030
|
+
// if (!setup_doc.db_connection_string) throw "db_connection_string missing";
|
1031
|
+
// const nano = require(node_modules_path + "/nano")(
|
1032
|
+
// setup_doc.db_connection_string
|
1033
|
+
// );
|
1034
|
+
// // const nano = await import(node_modules_path + "/nano")(
|
1035
|
+
// // setup_doc.db_connection_string
|
1036
|
+
// // );
|
1037
|
+
// if (!nano) {
|
1038
|
+
// return { code: -450, data: "connection error" };
|
1039
|
+
// }
|
1040
|
+
// await nano.get("_design");
|
1041
|
+
// return { code: 450, data: nano };
|
1042
|
+
// } catch (err) {
|
1043
|
+
// return { code: -450, data: err };
|
1044
|
+
// }
|
1045
|
+
// };
|
package/package.json
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
export const test_connection = async (node_modules_path, setup_doc) => {
|
2
|
+
try {
|
3
|
+
if (!setup_doc.db_connection_string) throw "db_connection_string missing";
|
4
|
+
const nano = require(node_modules_path + "/nano")(
|
5
|
+
setup_doc.db_connection_string
|
6
|
+
);
|
7
|
+
|
8
|
+
if (!nano) {
|
9
|
+
return { code: -450, data: "connection error" };
|
10
|
+
}
|
11
|
+
await nano.get("_design");
|
12
|
+
return { code: 450, data: nano };
|
13
|
+
} catch (err) {
|
14
|
+
return { code: -450, data: err };
|
15
|
+
}
|
16
|
+
};
|