aiondb-engine

Top-level orchestration crate. Wires the parser, planner, optimizer, executor, eval, catalog, storage, security, and transaction subsystems behind a single Engine value. Facade crates (aiondb-embedded, aiondb-pgwire, aiondb-dashboard) hold an Arc<Engine> and call into it via narrow traits exposed from engine::api.

cargo

[dependencies]
aiondb-engine = { path = "../aiondb-engine" }

modules

ModulePurpose
builderEngineBuilder constructors (new_in_memory, new_durable, new_durable_with_config, new_with_config, for_testing).
configEngineConfig and session_limits_from_config.
engineThe Engine value plus the narrow facade traits in engine::api.
preparedPrepared statement and portal types (PreparedStatementDesc, PortalBatch, StatementResult, ResultColumn).
sessionSessionHandle, SessionInfo, SessionLimits.

Internal modules (auth_audit, catalog_authorizer, catalog_auth, params) are not part of the public surface.

key types

TypeRole
EngineConcrete engine implementation. Built via EngineBuilder, used through Arc<Engine>.
EngineBuilderBuilder for Engine. Selects the storage profile and lets callers override authenticator, authorizer, rate limiter, transaction manager, snapshot oracle, lock manager, catalog, sequences, storage DDL/DML, and fragment dispatcher.
QueryEngineAggregate trait implemented by Engine. Bundles startup, simple query, extended protocol, transactions, replication, session control, and wire compatibility.
PgWireEngineMarker trait used by aiondb-pgwire to constrain the engine type.
QuerySimpleSql, QueryExtendedProtocol, QueryTransactions, QueryStartup, QuerySessionControl, QueryReplication, QueryWireCompatibilityNarrow traits in engine::api that facades depend on instead of QueryEngine when only one capability is needed.
StartupParams, StartupAuthenticationInputs to QueryStartup::startup.
SessionHandle, SessionInfo, SessionLimitsPer-connection session state.
PreparedStatementDesc, PortalBatch, ResultColumn, ResultColumnOrigin, StatementResult, PortalDescriptionExtended protocol results.
EngineMetrics, EngineMetricsSnapshotEngine-level counters.
ReplicationIdentity, EngineReplicationSeedManifest, install_replication_seedReplication seed installation.
SqlStatementWireMetadata, WireStateCleanupHintHints returned to the wire layer.
AuthAuditQuery, AuthAuditRecordAuthentication audit log query API.

re-exports

aiondb-engine re-exports a curated subset from its dependencies for callers that want to avoid pulling additional crates directly:

FromItems
aiondb-coreDataType, DbError, DbResult, ErrorReport, Row, SqlState, Value.
aiondb-securityAccessRequest, AccessTarget, Action, AllowAllAuthorizer, AuthRateLimiter, AuthenticatedIdentity, Authenticator, Authorizer, Credential, FileBackedAuthRateLimiter, InMemoryAuthRateLimiter, ScramVerifier, SecretBytes, SecretString, TransportInfo, TransportKind.
aiondb-txIsolationLevel.

example

use std::sync::Arc;
use aiondb_engine::{
    AllowAllAuthorizer, Credential, EngineBuilder, QueryEngine,
    StartupParams, TransportInfo, TransportKind,
};

fn main() -> aiondb_engine::DbResult<()> {
    let engine = EngineBuilder::new_in_memory()
        .with_authorizer(Arc::new(AllowAllAuthorizer))
        .with_allow_ephemeral_users(true)
        .build()?;

    let (session, _info) = engine.startup(StartupParams {
        database: "default".into(),
        application_name: Some("demo".into()),
        options: Default::default(),
        credential: Credential::Anonymous { user: "alice".into() },
        transport: TransportInfo { kind: TransportKind::InProcess },
    })?;

    let _ = engine.execute_sql(&session, "CREATE TABLE t (id INT);")?;
    engine.terminate(session)?;
    Ok(())
}