File tree Expand file tree Collapse file tree 8 files changed +494
-8
lines changed
Expand file tree Collapse file tree 8 files changed +494
-8
lines changed Original file line number Diff line number Diff line change @@ -49,15 +49,15 @@ https://demo.dbhub.ai/sse connects a [sample employee database](https://github.c
4949
5050| Tool | Command Name | PostgreSQL | MySQL | SQL Server | SQLite |
5151| --------------- | ----------------- | :--------: | :---: | :--------: | :----: |
52- | Execute Query | ` run_query ` | ✅ | ✅ | ✅ | ✅ |
53- | List Connectors | ` list_connectors ` | ✅ | ✅ | ✅ | ✅ |
52+ | Execute Query | ` run_query ` | ✅ | ✅ | ✅ | ✅ | ✅ |
53+ | List Connectors | ` list_connectors ` | ✅ | ✅ | ✅ | ✅ | ✅ |
5454
5555### Prompt Capabilities
5656
5757| Prompt | Command Name | PostgreSQL | MySQL | SQL Server | SQLite |
5858| ------------------- | -------------- | :--------: | :---: | :--------: | :----: |
59- | Generate SQL | ` generate_sql ` | ✅ | ✅ | ✅ | ✅ |
60- | Explain DB Elements | ` explain_db ` | ✅ | ✅ | ✅ | ✅ |
59+ | Generate SQL | ` generate_sql ` | ✅ | ✅ | ✅ | ✅ | ✅ |
60+ | Explain DB Elements | ` explain_db ` | ✅ | ✅ | ✅ | ✅ | ✅ |
6161
6262## Installation
6363
@@ -192,6 +192,7 @@ DBHub supports the following database connection string formats:
192192| SQLite | ` sqlite:///[path/to/file] ` or ` sqlite::memory: ` | ` sqlite:///path/to/database.db ` or ` sqlite::memory: ` |
193193| SQL Server | ` sqlserver://[user]:[password]@[host]:[port]/[database] ` | ` sqlserver://user:password@localhost:1433/dbname ` |
194194| MySQL | ` mysql://[user]:[password]@[host]:[port]/[database] ` | ` mysql://user:password@localhost:3306/dbname ` |
195+ | MariaDB | ` mariadb://[user]:[password]@[host]:[port]/[database] ` | ` mariadb://user:password@localhost:3306/dbname ` |
195196
196197### Transport
197198
Original file line number Diff line number Diff line change 2727 "dotenv" : " ^16.4.7" ,
2828 "express" : " ^4.18.2" ,
2929 "mssql" : " ^11.0.1" ,
30+ "mariadb" : " ^3.4.0" ,
3031 "mysql2" : " ^3.13.0" ,
3132 "pg" : " ^8.13.3" ,
3233 "zod" : " ^3.24.2"
Original file line number Diff line number Diff line change @@ -166,4 +166,28 @@ export function resolvePort(): { port: number; source: string } {
166166
167167 // 3. Default to 8080
168168 return { port : 8080 , source : 'default' } ;
169- }
169+ }
170+
171+ /**
172+ * Redact sensitive information from a DSN string
173+ * Replaces the password with asterisks
174+ * @param dsn - The DSN string to redact
175+ * @returns The sanitized DSN string
176+ */
177+ export function redactDSN ( dsn : string ) : string {
178+ try {
179+ // Create a URL object to parse the DSN
180+ const url = new URL ( dsn ) ;
181+
182+ // Replace the password with asterisks
183+ if ( url . password ) {
184+ url . password = '*******' ;
185+ }
186+
187+ // Return the sanitized DSN
188+ return url . toString ( ) ;
189+ } catch ( error ) {
190+ // If parsing fails, do basic redaction with regex
191+ return dsn . replace ( / \/ \/ ( [ ^ : ] + ) : ( [ ^ @ ] + ) @ / , '//$1:***@' ) ;
192+ }
193+ }
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ export interface DSNParser {
3939 * Parse a connection string into connector-specific configuration
4040 * Example DSN formats:
4141 * - PostgreSQL: "postgres://user:password@localhost:5432/dbname?sslmode=disable"
42+ * - MariaDB: "mariadb://user:password@localhost:3306/dbname"
4243 * - MySQL: "mysql://user:password@localhost:3306/dbname"
4344 * - SQLite: "sqlite:///path/to/database.db" or "sqlite::memory:"
4445 */
You can’t perform that action at this time.
0 commit comments