@bytebase/dbhub 0.4.8 → 0.4.9
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/dist/index.js +13 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2893,15 +2893,26 @@ async function listConnectorsToolHandler(_args, _extra) {
|
|
|
2893
2893
|
}
|
|
2894
2894
|
|
|
2895
2895
|
// src/tools/index.ts
|
|
2896
|
+
function generateRandomString(length) {
|
|
2897
|
+
const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
2898
|
+
let result = "";
|
|
2899
|
+
const charactersLength = characters.length;
|
|
2900
|
+
for (let i = 0; i < length; i++) {
|
|
2901
|
+
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
2902
|
+
}
|
|
2903
|
+
return result;
|
|
2904
|
+
}
|
|
2905
|
+
var EXECUTE_SQL_TOOL_NAME = `execute_sql_${generateRandomString(4)}`;
|
|
2906
|
+
var LIST_CONNECTORS_TOOL_NAME = `list_connectors_${generateRandomString(4)}`;
|
|
2896
2907
|
function registerTools(server) {
|
|
2897
2908
|
server.tool(
|
|
2898
|
-
|
|
2909
|
+
EXECUTE_SQL_TOOL_NAME,
|
|
2899
2910
|
"Execute a SQL query on the current database",
|
|
2900
2911
|
executeSqlSchema,
|
|
2901
2912
|
executeSqlToolHandler
|
|
2902
2913
|
);
|
|
2903
2914
|
server.tool(
|
|
2904
|
-
|
|
2915
|
+
LIST_CONNECTORS_TOOL_NAME,
|
|
2905
2916
|
"List all available database connectors",
|
|
2906
2917
|
{},
|
|
2907
2918
|
listConnectorsToolHandler
|