文档/Drivers

此页面尚未翻译,当前显示英文版本。 查看英文版本

DBFlux Drivers

This document is a comparative overview of the database drivers shipped with DBFlux. For per-driver details, follow the link to each driver crate’s README.md. For the internal driver architecture (traits, registration, the DbDriver/Connection seam), see the Driver System section of Architecture. Contributors implementing a driver should start with the Driver Authoring Guide.

How drivers are abstracted

Every driver exposes a DriverMetadata value (defined in crates/dbflux_core/src/driver/capabilities.rs). The UI is driver-agnostic and adapts purely from this metadata. The relevant fields are:

  • DatabaseCategory — selects the view model and terminology. Values: Relational, Document, KeyValue, Graph, TimeSeries, WideColumn, LogStream. (Not every value has a shipping driver.)
  • QueryLanguage — drives editor mode, placeholder text, and query parsing. Values include Sql, MongoQuery, RedisCommands, Cypher, InfluxQuery, Flux, Cql, CloudWatchLogsInsightsQl, OpenSearchPpl, OpenSearchSql, the script languages Lua / Python / Bash, and Custom(String).
  • DriverCapabilities — a u64 bitflag set declaring supported features (transactions, pagination, schemas, key-value operations, etc.). Convenience bases RELATIONAL_BASE, DOCUMENT_BASE, and KEYVALUE_BASE group the common flags for each category.

The capability flags listed below are exactly the ones each driver’s DriverMetadata sets in code; nothing is inferred.

Comparison

DriverCategoryQuery languageKey capabilitiesNotes / limitations
PostgreSQLRelationalSQLRelational base + schemas, SSH tunnel, SSL, auth, foreign keys, check/unique constraints, custom types, RETURNING, transactional DDL, routines, multi-statementFull SQL driver; routine viewer is read-only; transactional DDL except CREATE INDEX CONCURRENTLY.
Amazon RedshiftRelationalSQLMultiple databases, schemas, views, SSH tunnel, SSL/client certificates, auth, query cancellation, prepared statements, pagination, sorting, filtering, CSV/JSON exportRead-only over the PostgreSQL wire protocol; single-statement; exposes Redshift storage hints; no writes/DDL, IAM/SSO, or indexes.
MySQLRelationalSQLRelational base + SSH tunnel, SSL, auth, foreign keys, check/unique constraints, routines, multi-statementDDL is non-transactional; multi-statement scripts split text-based and run sequentially; routine listing covers FUNCTION/PROCEDURE only.
MariaDBRelationalSQLSame crate and capabilities as MySQLRegistered as a separate mariadb metadata sharing the MySQL implementation.
SQLiteRelationalSQLViews, indexes, foreign keys, check/unique constraints, prepared statements, insert/update/delete, pagination, sorting, filtering, CSV/JSON export, query cancellation, transactional DDL, multi-statementEmbedded file driver: no network, SSH tunnel, or TLS; no multi-schema namespace.
SQL ServerRelationalSQLRelational base + schemas, SSH tunnel, SSL, auth, foreign keys, check/unique constraints, transactional DDL, routines, multi-statementBuilt on tiberius; named-instance lookup unavailable through SSH tunnel; multi-result-set batches return the last set as primary.
MongoDBDocumentMongoQueryDocument base + aggregation, SSH tunnel, indexesMongoDB shell-style syntax only (no SQL); no query cancellation; parser scoped to supported command patterns.
RedisKey-ValueRedisCommandsKey-value base + multiple databases, TTL, key types, value size, rename, bulk get, stream range/add/delete, auth, SSH tunnel, SSLRedis command syntax only (no SQL); no query cancellation; SSH tunneling unavailable in URI mode.
DynamoDBDocumentCustom(“DynamoDB”)Auth, pagination, filtering, insert/update/delete, nested documents, arraysAWS-managed; native command envelope (scan/query/put/update/delete); no PartiQL/transactions; no query cancellation; update many+upsert unsupported.
CloudWatch LogsLog StreamSql (metadata default)AuthAWS-managed; executes Logs Insights QL, OpenSearch PPL, and OpenSearch SQL via editor-managed source context; no query cancellation yet.
InfluxDBTime SeriesInfluxQueryAuth, multiple databases, pagination, CSV/JSON exportv1 and v2 in one crate; InfluxQL on both, Flux on v2 only; read-only (no INSERT/UPDATE/DELETE); no transactions.
ClickHouseRelationalSQLMultiple databases, views, auth, pagination, sorting, filtering, grouping, joins, CTEs, windows, CSV/JSON exportHTTP(S), including ClickHouse Cloud; read-oriented DBFlux integration with no structured mutations, DDL, transactions, SSH tunneling, or query parameters.
Amazon S3Object StorageCustom(“S3”)Auth (profile/SSO or static credentials, custom endpoint), bucket browsing, paginated object navigation, preview, full CRUD, presigned URLsS3-compatible (Cloudflare R2, MinIO); no multipart upload/transfers panel, no embedded PDF viewer, no lifecycle/ACL management or S3 Select.

Per-driver summary

PostgreSQL

Full SQL driver with schema discovery, stored routines (read-only viewer), SSL, SSH tunneling, query cancellation via cancel tokens, transactional DDL, and PostgreSQL-specific code generation. Multi-statement scripts run as a batch via the simple query protocol. See PostgreSQL.

Amazon Redshift

Read-only relational SQL driver using the PostgreSQL wire protocol. It supports schema, table, view, and column introspection; SSH tunneling; TLS and client certificates; query cancellation; and Redshift distribution/sort-key storage hints. It does not support writes or DDL, IAM/SSO authentication, multi-statement queries, or indexes. See Amazon Redshift.

MySQL / MariaDB

One crate implements both MySQL and MariaDB. Supports SQL execution, schema discovery, query cancellation via KILL QUERY, code generation, and routine discovery for functions and procedures. DDL is not transactional and multi-statement splitting is text-based. See MySQL / MariaDB.

SQLite

Embedded, file-based driver with schema discovery, query cancellation via interrupt handles, transactional DDL, and code generation. No network transport, SSH tunneling, or TLS, and no multi-schema namespace. See SQLite.

SQL Server

Built on the tiberius TDS client. Supports SQL Server / Azure SQL, TLS modes, named instances (resolved via SQL Browser), SSH tunneling, per-tab database switching, and multi-result-set batches. See SQL Server.

MongoDB

Document driver with collection browsing, document CRUD, MongoDB shell-style query parsing, aggregation, and document-focused schema metadata. SQL is not supported and query cancellation is unavailable. See MongoDB.

Redis

Key-value driver covering strings, hashes, lists, sets, sorted sets, and streams, plus key scanning, TTL operations, rename, bulk get, and multiple logical databases. SQL is not supported and SSH tunneling is unavailable in URI mode. See Redis.

DynamoDB

AWS NoSQL driver built on aws-sdk-dynamodb with region/profile/endpoint configuration. Table discovery maps PK/SK and GSI/LSI metadata; execution uses a native command envelope (scan, query, put, update, delete). PartiQL and DynamoDB transactions are not exposed. See DynamoDB.

CloudWatch Logs

AWS CloudWatch Logs driver executing queries through StartQuery with editor-managed time range and log-group source context. Query documents can run Logs Insights QL, OpenSearch PPL, and OpenSearch SQL; schema discovery enumerates log groups and exposes log streams as event-stream children. Its DriverMetadata.query_language is set to Sql as the default editor mode while the actual mode is chosen per query document. See CloudWatch.

InfluxDB

Time-series driver supporting both InfluxDB v1 and v2 in one crate. InfluxQL runs on both versions; Flux runs on v2 only. The query API is read-only (no INSERT/UPDATE/DELETE, no transactions), with optional default bucket/database and per-query bucket routing. See InfluxDB.

ClickHouse

Relational SQL driver for self-hosted ClickHouse and ClickHouse Cloud over HTTP(S). It discovers databases, tables, views, columns, and engine metadata, and supports read-oriented SQL workflows with pagination and visual SELECT generation. Structured mutations, DDL, transactions, SSH tunneling, and generic query parameters are not supported in this initial scope. See ClickHouse.

Amazon S3

Object-storage driver for AWS S3 and S3-compatible endpoints (Cloudflare R2, MinIO), authenticating via AWS profile/SSO or static credentials with endpoint override and path-style addressing. The connection root opens a buckets table; bucket browsing paginates per level (AWS-console style) with an optional non-paginated tree mode. Object preview covers images natively, text-like objects in an inline editable buffer with save-back, and metadata plus download/open-externally for PDF and other binary objects; archived storage classes (GLACIER, DEEP_ARCHIVE) skip body preview entirely. Supports upload, delete, type-to-confirm recursive prefix/bucket delete, folder/bucket creation, rename (copy-then-delete), and presigned URLs. It does not support multipart upload, a transfers panel, an embedded PDF viewer, lifecycle/ACL management, or S3 Select. See S3.

External RPC drivers

DBFlux can load drivers that run out-of-process and communicate over local IPC, implemented through dbflux_driver_ipc and hosted via dbflux_driver_host. These drivers register with the synthetic ID format rpc:<socket_id> and supply their own DriverMetadata (category, query language, capabilities) over the wire, so the UI treats them exactly like built-in drivers. For the discovery handshake, service lifecycle, and protocol details, see Driver RPC protocol.

Esc
移动 打开Esc 关闭