@bytebase/dbhub 0.4.9 → 0.4.11
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/README.md +6 -6
- package/dist/index.js +4 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,15 +14,15 @@ DBHub is a universal database gateway implementing the Model Context Protocol (M
|
|
|
14
14
|
| | | | | |
|
|
15
15
|
| Claude Desktop +--->+ +--->+ PostgreSQL |
|
|
16
16
|
| | | | | |
|
|
17
|
-
|
|
|
17
|
+
| Cursor +--->+ DBHub +--->+ SQL Server |
|
|
18
18
|
| | | | | |
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
| | | +--->+
|
|
19
|
+
| Other Clients +--->+ +--->+ SQLite |
|
|
20
|
+
| | | | | |
|
|
21
|
+
| | | +--->+ MySQL |
|
|
22
22
|
| | | | | |
|
|
23
23
|
| | | +--->+ MariaDB |
|
|
24
24
|
| | | | | |
|
|
25
|
-
| | | +--->+
|
|
25
|
+
| | | +--->+ Oracle |
|
|
26
26
|
| | | | | |
|
|
27
27
|
+------------------+ +--------------+ +------------------+
|
|
28
28
|
MCP Clients MCP Server Databases
|
|
@@ -261,7 +261,7 @@ DBHub supports the following database connection string formats:
|
|
|
261
261
|
| MariaDB | `mariadb://[user]:[password]@[host]:[port]/[database]` | `mariadb://user:password@localhost:3306/dbname?sslmode=disable` |
|
|
262
262
|
| PostgreSQL | `postgres://[user]:[password]@[host]:[port]/[database]` | `postgres://user:password@localhost:5432/dbname?sslmode=disable` |
|
|
263
263
|
| SQL Server | `sqlserver://[user]:[password]@[host]:[port]/[database]` | `sqlserver://user:password@localhost:1433/dbname?sslmode=disable` |
|
|
264
|
-
| SQLite | `sqlite:///[path/to/file]` or `sqlite
|
|
264
|
+
| SQLite | `sqlite:///[path/to/file]` or `sqlite:///:memory:` | `sqlite:///path/to/database.db`, `sqlite:C:/Users/YourName/data/database.db (windows)` or `sqlite:///:memory:` |
|
|
265
265
|
| Oracle | `oracle://[user]:[password]@[host]:[port]/[service_name]` | `oracle://username:password@localhost:1521/service_name?sslmode=disable` |
|
|
266
266
|
|
|
267
267
|
#### Oracle
|
package/dist/index.js
CHANGED
|
@@ -822,7 +822,7 @@ var SQLiteDSNParser = class {
|
|
|
822
822
|
try {
|
|
823
823
|
const url = new SafeURL(dsn);
|
|
824
824
|
let dbPath;
|
|
825
|
-
if (url.hostname === "" && url.pathname === "
|
|
825
|
+
if (url.hostname === "" && url.pathname === "/:memory:") {
|
|
826
826
|
dbPath = ":memory:";
|
|
827
827
|
} else {
|
|
828
828
|
if (url.pathname.startsWith("//")) {
|
|
@@ -2385,7 +2385,7 @@ function resolveDSN() {
|
|
|
2385
2385
|
const args = parseCommandLineArgs();
|
|
2386
2386
|
if (isDemoMode()) {
|
|
2387
2387
|
return {
|
|
2388
|
-
dsn: "sqlite
|
|
2388
|
+
dsn: "sqlite:///:memory:",
|
|
2389
2389
|
source: "demo mode",
|
|
2390
2390
|
isDemo: true
|
|
2391
2391
|
};
|
|
@@ -2893,26 +2893,15 @@ 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)}`;
|
|
2907
2896
|
function registerTools(server) {
|
|
2908
2897
|
server.tool(
|
|
2909
|
-
|
|
2898
|
+
"execute_sql",
|
|
2910
2899
|
"Execute a SQL query on the current database",
|
|
2911
2900
|
executeSqlSchema,
|
|
2912
2901
|
executeSqlToolHandler
|
|
2913
2902
|
);
|
|
2914
2903
|
server.tool(
|
|
2915
|
-
|
|
2904
|
+
"list_connectors",
|
|
2916
2905
|
"List all available database connectors",
|
|
2917
2906
|
{},
|
|
2918
2907
|
listConnectorsToolHandler
|