refactor(workspace): split SQL and database driver crates

This commit is contained in:
t8y2 committed 2026-09-25 15:51:58 +08:00
1 parent b99c60aff6
commit e0da2d09d3
180 files changed
+1422 -538

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@
- `app`, `tabs`, `sidebar`, `connection`: shell, navigation, and connection UI state helpers.
- `database`, `metadata`, `schema`, `table`: relational database metadata, capabilities, DDL, and table-object helpers.
- `sql`, `sql/semantic`, `editor`, `query`, `history`, `savedSql`: SQL editing, execution, diagnostics, history, and saved SQL behavior.
Keep fixed SQL completion statements and their database-specific variants in `sql/sqlSnippetTemplates.ts`; cross-check row-limiting families against `crates/dbx-sql/src/sql_dialect/capabilities.rs` and authoritative dialect documentation, and never replace a user-customized built-in body with a generated default.
Keep fixed SQL completion statements and their database-specific variants in `sql/sqlSnippetTemplates.ts`; cross-check row-limiting families against `crates/dbx-sql-dialect/src/sql_dialect/capabilities.rs` and authoritative dialect documentation, and never replace a user-customized built-in body with a generated default.
- `dataGrid`: result/grid rendering, editing, previews, pagination, and export helpers tied to the grid.
- `ai`, `mcp`: AI assistant and MCP configuration helpers.
- `redis`, `mongo`, `elasticsearch`, `etcd`, `kv`, `mq`, `nacos`, `zookeeper`, `webdav`: non-relational or service-specific helpers.
@@ -69,7 +69,7 @@ describe("databaseObjectCapabilities", () => {
it("exposes materialized views for StarRocks only", () => {
// StarRocks has a dedicated MV listing/classification path in
// crates/dbx-drivers/src/db/mysql.rs (`list_starrocks_tables` +
// crates/dbx-driver-mysql/src/mysql.rs (`list_starrocks_tables` +
// `classify_starrocks_materialized_views`).
expect(sidebarObjectKindsForDatabase("starrocks")).toContain("MATERIALIZED_VIEW");
@@ -2,7 +2,7 @@
* Read/write classification for Elasticsearch-compatible REST requests.
*
* Mirrors `classify_search_engine_query_risk` in
* `crates/dbx-sql/src/query_execution_sql.rs` so the desktop guards (read-only
* `crates/dbx-sql-core/src/query_execution_sql.rs` so the desktop guards (read-only
* unlock, production safety) agree with the backend read-only gate instead of
* treating every `GET`/`POST` request as an unrecognized — and therefore
* unsafe — statement.
@@ -1,4 +1,4 @@
// Mirrors dbx-core `redis_database_index()` (crates/dbx-drivers/src/db/redis_driver.rs):
// Mirrors dbx-core `redis_database_index()` (crates/dbx-driver-redis/src/lib.rs):
// a Redis database is a numeric index. Anything else (e.g. redis-cli flags like
// "0 --tls --insecure" pasted into the field or imported from a dirty URL) fails
// to parse on the backend and silently falls back to db 0, so every frontend
+1 -1
View File
@@ -1,7 +1,7 @@
/**
* Read/write classification for Apache Solr REST requests.
*
* Mirrors `classify_solr_query_risk` in `crates/dbx-sql/src/query_execution_sql.rs`
* Mirrors `classify_solr_query_risk` in `crates/dbx-sql-core/src/query_execution_sql.rs`
* so the desktop guards (read-only unlock, production safety) agree with the
* backend read-only gate instead of treating every request as unrecognized.
*
+1 -1
View File
@@ -151,7 +151,7 @@ export function resolveNewQueryTable(input: ResolveNewQueryTableInput): NewQuery
*
* Time-series engines get the same rolling-window scoping the sidebar
* quick-open uses (see `default_time_series_predicate` in
* `crates/dbx-sql/src/sql_dialect/table_select.rs`). Without a `time`
* `crates/dbx-sql-dialect/src/sql_dialect/table_select.rs`). Without a `time`
* predicate InfluxDB scans every shard (v1/v2) or every Parquet file
* (v3), which turns "let me draft a query against this table" into a
* full-history scan the moment the user hits Run. VictoriaMetrics