@xuda.io/xuda-dbs-plugin-xuda 1.0.20 → 1.0.22
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 +1 -1
- package/test_connection.mjs +17 -0
package/package.json
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
import * as nano from "nano";
|
2
|
+
|
3
|
+
export const test_connection = async (params, setup_doc) => {
|
4
|
+
try {
|
5
|
+
debugger;
|
6
|
+
if (!setup_doc.db_connection_string) throw "db_connection_string missing";
|
7
|
+
// const nano = await import("nano")(setup_doc.db_connection_string);
|
8
|
+
|
9
|
+
if (!nano) {
|
10
|
+
return { code: -450, data: "connection error" };
|
11
|
+
}
|
12
|
+
await nano.get("_design/xuda");
|
13
|
+
return { code: 450, data: nano };
|
14
|
+
} catch (err) {
|
15
|
+
return { code: -450, data: err };
|
16
|
+
}
|
17
|
+
};
|