@bytebase/dbhub 0.1.1 → 0.2.2
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 +23 -19
- package/dist/index.js +1038 -139
- 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
|
-
| ------------------- |
|
|
55
|
-
| Generate SQL | `generate_sql`
|
|
56
|
-
| Explain DB Elements |
|
|
57
|
+
| Prompt | Command Name | PostgreSQL | MySQL | SQL Server | SQLite |
|
|
58
|
+
| ------------------- | --------------- | :--------: | :---: | :--------: | :----: |
|
|
59
|
+
| Generate SQL | `generate_sql` | ✅ | ✅ | ✅ | ✅ |
|
|
60
|
+
| Explain DB Elements | `explain_db` | ✅ | ✅ | ✅ | ✅ |
|
|
57
61
|
|
|
58
62
|
## Installation
|
|
59
63
|
|
|
@@ -179,12 +183,12 @@ For real databases, a Database Source Name (DSN) is required. You can provide th
|
|
|
179
183
|
|
|
180
184
|
DBHub supports the following database connection string formats:
|
|
181
185
|
|
|
182
|
-
| Database | DSN Format | Example
|
|
183
|
-
| ---------- | -------------------------------------------------------- |
|
|
184
|
-
| PostgreSQL | `postgres://[user]:[password]@[host]:[port]/[database]` | `postgres://user:password@localhost:5432/dbname?sslmode=disable`
|
|
185
|
-
| SQLite | `sqlite:///[path/to/file]` or `sqlite::memory:` | `sqlite:///path/to/database.db` or `sqlite::memory:`
|
|
186
|
-
| SQL Server | `sqlserver://[user]:[password]@[host]:[port]/[database]` | `sqlserver://user:password@localhost:1433/dbname`
|
|
187
|
-
| MySQL | `mysql://[user]:[password]@[host]:[port]/[database]` | `mysql://user:password@localhost:3306/dbname`
|
|
186
|
+
| Database | DSN Format | Example |
|
|
187
|
+
| ---------- | -------------------------------------------------------- | ----------------------------------------------------------------- |
|
|
188
|
+
| PostgreSQL | `postgres://[user]:[password]@[host]:[port]/[database]` | `postgres://user:password@localhost:5432/dbname?sslmode=disable` |
|
|
189
|
+
| SQLite | `sqlite:///[path/to/file]` or `sqlite::memory:` | `sqlite:///path/to/database.db` or `sqlite::memory:` |
|
|
190
|
+
| SQL Server | `sqlserver://[user]:[password]@[host]:[port]/[database]` | `sqlserver://user:password@localhost:1433/dbname` |
|
|
191
|
+
| MySQL | `mysql://[user]:[password]@[host]:[port]/[database]` | `mysql://user:password@localhost:3306/dbname` |
|
|
188
192
|
|
|
189
193
|
### Transport
|
|
190
194
|
|
|
@@ -202,13 +206,13 @@ DBHub supports the following database connection string formats:
|
|
|
202
206
|
### Command line options
|
|
203
207
|
|
|
204
208
|
| Option | Description | Default |
|
|
205
|
-
|
|
|
209
|
+
| --------- | --------------------------------------------------------------- | ---------------------------- |
|
|
206
210
|
| demo | Run in demo mode with sample employee database | `false` |
|
|
207
211
|
| dsn | Database connection string | Required if not in demo mode |
|
|
208
212
|
| transport | Transport mode: `stdio` or `sse` | `stdio` |
|
|
209
213
|
| port | HTTP server port (only applicable when using `--transport=sse`) | `8080` |
|
|
210
214
|
|
|
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
|
|
215
|
+
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
216
|
|
|
213
217
|
## Development
|
|
214
218
|
|