Expand description
Public API for DataZen database driver plugins.
External drivers depend on this crate and implement DatabaseDriver.
They register themselves at link time via the register_driver! macro,
which uses the inventory crate for zero-code discovery in the host binary.
Re-exports§
pub use command::check_command_access;pub use command::execute_command_definition;pub use command::execute_command_definition_for;pub use command::query_command_definition;pub use command::query_command_definition_for;pub use command::query_only_command_definitions;pub use command::required_access_level;pub use command::statement_command_definitions;pub use command::validate_command_input;pub use command::CommandAccessLevel;pub use command::CommandCategory;pub use command::CommandResult;pub use command::DriverCommandDefinition;pub use command::DriverCommandMetadata;pub use sync::BoxedSyncAdapter;pub use sync::IRColumn;pub use sync::IRDefault;pub use sync::IRTable;pub use sync::IRType;pub use sync::SyncAdapterFactory;pub use sync::SyncSourceAdapter;pub use sync::SyncTargetAdapter;pub use inventory;
Modules§
- command
- Generic Driver Command API.
- sql_
dump - Generic SQL dump helpers used by
crate::DatabaseDriverdefaults. - sync
- Cross-database sync IR and adapter traits.
Macros§
- register_
driver - Register a driver factory at link time. Usage:
- register_
sync_ adapter - Helper: submit a sync adapter factory at link time.
Structs§
- Backup
Dump Options - Options for driver-native SQL database dumps.
- Backup
Restore Options - Options for SQL restore operations.
- Column
Info - Column
Schema - Connection
Config - Connection
Handle - Explain
Result - Foreign
KeyInfo - Index
Info - KeyDetail
- KeyEntry
- Multi
Query Result - Plan
Statement - Prompt
Template - A bilingual prompt template for a specific scenario.
- Query
Result - Query
RowBatcher - Incremental row emitter used by drivers that stream from the wire.
- Reuse
Driver - Server
Info - SshTunnel
Config - Statement
Result - Structure
Capabilities - Table structure editor capability flags returned by drivers.
- Structure
Change Plan - Structure
Change Request - Structure
Column Draft - Structure
Index Draft - Table
Data Result - Table
Info - Table
Schema - Transaction
Handle
Enums§
- Alter
Strategy - Driver
Category - Driver
Error - Prompt
Scenario - Identifies an AI prompt scenario.
- Query
Stream Event - SslMode
- Statement
Risk - Structure
Change Mode - Table
Type - Value
Constants§
- MIN_
PROTOCOL_ VERSION - Minimum protocol version the host still supports.
- PROTOCOL_
VERSION - Protocol version for the driver API.
- QUERY_
STREAM_ BATCH_ SIZE - Default number of rows per
Rowsevent. Independent of SQL LIMIT.
Traits§
- Database
Driver - Database
Driver Factory - Factory that plugins implement to register their driver.
Use the [
register_driver!] macro for convenient registration. - KeyValue
Driver
Functions§
- append_
select_ limit - Append
LIMIT n+1to a top-level SELECT/WITH that has no LIMIT. The extra row lets callers detect truncation. Independent of batch size. - emit_
execute_ statement - emit_
multi_ query_ as_ stream - Emit an already-materialized
MultiQueryResultas stream events, draining row vectors as chunks are sent so the default (non-streaming) driver path can still avoid a giant single IPC payload. - execute_
standard_ sql_ command - Default
query/executecommand dispatch shared by SQL drivers. - iter_
driver_ factories - Iterate over all registered driver factories.
- stream_
decoded_ rows - Emit already-decoded rows through
QueryRowBatcherwithout holding a second fullMultiQueryResultcopy.
Type Aliases§
- Database
Type - Database type identifier — a plain string (e.g. “postgresql”, “mysql”, “superset”). Plugins define their own identifiers without modifying this crate.
- Query
Stream Callback