@bytebase/dbhub 0.1.2 → 0.2.3
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 +19 -12
- package/dist/index.js +1057 -155
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,24 +36,28 @@ https://demo.dbhub.ai/sse connects a [sample employee database](https://github.c
|
|
|
36
36
|
|
|
37
37
|
### Database Resources
|
|
38
38
|
|
|
39
|
-
| Resource |
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
39
|
+
| Resource Name | URI Format | PostgreSQL | MySQL | SQL Server | SQLite |
|
|
40
|
+
| --------------------------- | ------------------------------------------------------ | :--------: | :---: | :--------: | :----: |
|
|
41
|
+
| schemas | `db://schemas` | ✅ | ✅ | ✅ | ✅ |
|
|
42
|
+
| tables_in_schema | `db://schemas/{schemaName}/tables` | ✅ | ✅ | ✅ | ✅ |
|
|
43
|
+
| table_structure_in_schema | `db://schemas/{schemaName}/tables/{tableName}` | ✅ | ✅ | ✅ | ✅ |
|
|
44
|
+
| indexes_in_table | `db://schemas/{schemaName}/tables/{tableName}/indexes` | ✅ | ✅ | ✅ | ✅ |
|
|
45
|
+
| procedures_in_schema | `db://schemas/{schemaName}/procedures` | ✅ | ✅ | ✅ | ❌ |
|
|
46
|
+
| procedure_details_in_schema | `db://schemas/{schemaName}/procedures/{procedureName}` | ✅ | ✅ | ✅ | ❌ |
|
|
43
47
|
|
|
44
48
|
### Database Tools
|
|
45
49
|
|
|
46
|
-
| Tool |
|
|
47
|
-
| --------------- |
|
|
48
|
-
| Execute Query |
|
|
50
|
+
| Tool | Command Name | PostgreSQL | MySQL | SQL Server | SQLite |
|
|
51
|
+
| --------------- | ----------------- | :--------: | :---: | :--------: | :----: |
|
|
52
|
+
| Execute Query | `run_query` | ✅ | ✅ | ✅ | ✅ |
|
|
49
53
|
| List Connectors | `list_connectors` | ✅ | ✅ | ✅ | ✅ |
|
|
50
54
|
|
|
51
55
|
### Prompt Capabilities
|
|
52
56
|
|
|
53
|
-
| Prompt |
|
|
54
|
-
| ------------------- |
|
|
57
|
+
| Prompt | Command Name | PostgreSQL | MySQL | SQL Server | SQLite |
|
|
58
|
+
| ------------------- | -------------- | :--------: | :---: | :--------: | :----: |
|
|
55
59
|
| Generate SQL | `generate_sql` | ✅ | ✅ | ✅ | ✅ |
|
|
56
|
-
| Explain DB Elements |
|
|
60
|
+
| Explain DB Elements | `explain_db` | ✅ | ✅ | ✅ | ✅ |
|
|
57
61
|
|
|
58
62
|
## Installation
|
|
59
63
|
|
|
@@ -177,6 +181,9 @@ For real databases, a Database Source Name (DSN) is required. You can provide th
|
|
|
177
181
|
DSN=postgres://user:password@localhost:5432/dbname?sslmode=disable
|
|
178
182
|
```
|
|
179
183
|
|
|
184
|
+
> [!WARNING]
|
|
185
|
+
> When running in Docker, use `host.docker.internal` instead of `localhost` to connect to databases running on your host machine. For example: `mysql://user:password@host.docker.internal:3306/dbname`
|
|
186
|
+
|
|
180
187
|
DBHub supports the following database connection string formats:
|
|
181
188
|
|
|
182
189
|
| Database | DSN Format | Example |
|
|
@@ -202,13 +209,13 @@ DBHub supports the following database connection string formats:
|
|
|
202
209
|
### Command line options
|
|
203
210
|
|
|
204
211
|
| Option | Description | Default |
|
|
205
|
-
|
|
|
212
|
+
| --------- | --------------------------------------------------------------- | ---------------------------- |
|
|
206
213
|
| demo | Run in demo mode with sample employee database | `false` |
|
|
207
214
|
| dsn | Database connection string | Required if not in demo mode |
|
|
208
215
|
| transport | Transport mode: `stdio` or `sse` | `stdio` |
|
|
209
216
|
| port | HTTP server port (only applicable when using `--transport=sse`) | `8080` |
|
|
210
217
|
|
|
211
|
-
The demo mode uses an in-memory SQLite database loaded with the [sample employee database](https://github.com/bytebase/dbhub/tree/main/resources/employee-sqlite) that includes tables for employees, departments, titles, and
|
|
218
|
+
The demo mode uses an in-memory SQLite database loaded with the [sample employee database](https://github.com/bytebase/dbhub/tree/main/resources/employee-sqlite) that includes tables for employees, departments, titles, salaries, department employees, and department managers. The sample database includes SQL scripts for table creation, data loading, and testing.
|
|
212
219
|
|
|
213
220
|
## Development
|
|
214
221
|
|