Skip to main content

Crate datazen_driver_api

Crate datazen_driver_api 

Source
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::DatabaseDriver defaults.
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§

BackupDumpOptions
Options for driver-native SQL database dumps.
BackupRestoreOptions
Options for SQL restore operations.
ColumnInfo
ColumnSchema
ConnectionConfig
ConnectionHandle
ExplainResult
ForeignKeyInfo
IndexInfo
KeyDetail
KeyEntry
MultiQueryResult
PlanStatement
PromptTemplate
A bilingual prompt template for a specific scenario.
QueryResult
QueryRowBatcher
Incremental row emitter used by drivers that stream from the wire.
ReuseDriver
ServerInfo
SshTunnelConfig
StatementResult
StructureCapabilities
Table structure editor capability flags returned by drivers.
StructureChangePlan
StructureChangeRequest
StructureColumnDraft
StructureIndexDraft
TableDataResult
TableInfo
TableSchema
TransactionHandle

Enums§

AlterStrategy
DriverCategory
DriverError
PromptScenario
Identifies an AI prompt scenario.
QueryStreamEvent
SslMode
StatementRisk
StructureChangeMode
TableType
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 Rows event. Independent of SQL LIMIT.

Traits§

DatabaseDriver
DatabaseDriverFactory
Factory that plugins implement to register their driver. Use the [register_driver!] macro for convenient registration.
KeyValueDriver

Functions§

append_select_limit
Append LIMIT n+1 to 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 MultiQueryResult as 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 / execute command dispatch shared by SQL drivers.
iter_driver_factories
Iterate over all registered driver factories.
stream_decoded_rows
Emit already-decoded rows through QueryRowBatcher without holding a second full MultiQueryResult copy.

Type Aliases§

DatabaseType
Database type identifier — a plain string (e.g. “postgresql”, “mysql”, “superset”). Plugins define their own identifiers without modifying this crate.
QueryStreamCallback

Attribute Macros§

async_trait