Skip to main content

Crate oxisql_core

Crate oxisql_core 

Source
Expand description

oxisql-core — core traits and types for the OxiSQL Pure-Rust SQL facade.

This crate defines the public API surface (Connection, Transaction, Row, Value, OxiSqlError) that every OxiSQL backend must implement. It has no storage logic of its own; concrete backends live in oxisql-embedded, oxisql-postgres, etc.

§Extended Type System

Beyond the basic scalar types (Null, Bool, I64, F64, Text, Blob), Value supports rich database types:

§Type-Safe Extraction

Use Row::try_get with the FromValue trait for ergonomic, type-safe value extraction:

let row = Row::new(
    vec!["id".into(), "name".into()],
    vec![Value::I64(42), Value::Text("Alice".into())],
);
let id: i64 = row.try_get("id").unwrap();
let name: String = row.try_get("name").unwrap();

Re-exports§

pub use middleware::ConnectionMetrics;
pub use middleware::LoggingConnection;
pub use middleware::MetricsConnection;
pub use middleware::MetricsSnapshot;
pub use middleware::RetryConnection;
pub use middleware::RetryPolicy;
pub use middleware::RetryPredicate;
pub use params::bind_named_params;
pub use params::rewrite_named_params;
pub use query::BuiltQuery;
pub use query::DeleteBuilder;
pub use query::InsertBuilder;
pub use query::SelectBuilder;
pub use query::SortDirection;
pub use query::UpdateBuilder;
pub use registry::SqlType;
pub use registry::TypeRegistry;
pub use schema::ColumnInfo;
pub use schema::ForeignKeyInfo;
pub use schema::IndexInfo;
pub use schema::TableInfo;
pub use schema::TableType;

Modules§

middleware
Middleware wrappers for Connection — logging and metrics.
params
Named-parameter rewriting for OxiSQL.
query
Fluent query builder for constructing SQL strings with positional parameters.
registry
TypeRegistry — bidirectional mapping between SQL type-name strings and SqlType descriptors, together with default Value construction.
schema
Types returned by Connection schema-inspection methods.

Structs§

Cursor
An incremental cursor for traversing a materialised result set.
MigrationInfo
Metadata describing a single migration version.
Row
A single row returned from a query, with named columns.
RowSet
A collection of Rows with schema metadata.
SqlWarning
A SQL warning returned by the database server after a statement.

Enums§

ArrayElementType
The nominal SQL element type of a Value::TypedArray.
BorrowedValue
A borrowed, zero-allocation view of a SQL value.
MigrationStatus
The execution status of a single migration version.
OxiSqlError
Errors that can occur during OxiSQL operations.
SqlWarningLevel
Severity level of a SQL warning.
Value
A single SQL value returned from or passed to a query.

Traits§

Connection
An async database connection.
ConnectionPool
A pool of database connections.
FromValue
Extract a typed value from a Value enum variant.
Migrator
An async trait for managing database schema migrations.
PreparedStatement
A server-side prepared statement.
ToSqlValue
A value that can be used as a positional SQL parameter ($1, $2, …).
Transaction
A database transaction obtained via Connection::transaction.

Functions§

parse_warning_level
Parse a MySQL warning level string into a SqlWarningLevel.