Skip to main content

Crate omnia_wasi_sql

Crate omnia_wasi_sql 

Source
Expand description

§Omnia WASI SQL

This crate provides the SQL database interface for the Omnia runtime.

§Interface

Implements the wasi:sql WIT interface.

§Backend

  • Host: Uses rusqlite to provide a SQLite backend. Supports both in-memory (:memory:) and file-based databases.

§Features

§Guest ORM Layer

The guest module provides query builders for type-safe database operations:

  • Entity macro: Declare database models with automatic trait implementations.
  • Query builders: Fluent APIs for SELECT, INSERT, UPDATE, DELETE.
  • Joins & Filters: Type-safe query construction.

§Usage

Add this crate to your Cargo.toml and use it in your runtime configuration:

use omnia::runtime;
use omnia_wasi_sql::SqlDefault;

omnia::runtime!({
    "sql": SqlDefault,
});

§License

MIT OR Apache-2.0

§WASI SQL Service

This module implements a runtime service for wasi:sql (https://github.com/aspect-build/wasi-sql).

Modules§

default_impl
Default SQLite implementation for wasi-sql

Macros§

omnia_wasi_view
Implementation of the WasiSqlView trait for the store context.

Structs§

ConnectionProxy
ConnectionProxy provides a concrete wrapper around a dyn Connection object. It is used to store connection resources in the resource table.
Field
one field in a row
Row
one single row item
SqlDefault
Default implementation for wasi:sql.
Statement
Represents a statement resource in the WASI SQL host.
WasiSql
Host-side service for wasi:sql.
WasiSqlCtxView
View into WasiSqlCtx implementation and ResourceTable.

Enums§

DataType
common data types

Traits§

Connection
SQL providers implement the Connection trait to allow the host to connect to a backend (Azure Table Storage, Postgres, etc) and execute SQL statements.
WasiSqlCtx
A trait which provides internal WASI SQL context.
WasiSqlView
A trait which provides internal WASI SQL state.

Type Aliases§

FutureResult
Result type for asynchronous operations.