Expand description
This library provides the Rust implementation of the wasmcloud SQL database capability contract wasmcloud:sqldb.
The initial version of this interface supports executing sql queries (inserts, update, create table, etc.) and fetching data (select).
The api is intended to be independent of any specific relational database implementation (postgres, mysql, mariadb, sqlite, etc.).
For efficiency, query results are encoded in Compact Binary Object Representation CBOR, a language-neutral format. CBOR is designed to be an extensible, language-neutral, about 50-70% denser than JSON, and suitable for constrained environments (low cpu and memory requirements). Parsers are simple to write, and libraries are available in several languages.
This interface currently does not support:
- transactions
- streaming results
- prepared statements
Re-exports§
pub use minicbor;
Structs§
- Column
- Metadata about a Column in the result set
- Execute
Result - Result of an Execute operation
- Ping
Result - Query
Result - Result of a query
- SqlDb
Error - Detailed error information from the previous operation
- SqlDb
Sender - SqlDbSender sends messages to a SqlDb service SqlDb - SQL Database connections To use this capability, the actor must be linked with the capability contract “wasmcloud:sqldb” client for sending SqlDb messages
- Statement
Constants§
Traits§
- SqlDb
- SqlDb - SQL Database connections To use this capability, the actor must be linked with the capability contract “wasmcloud:sqldb” wasmbus.contractId: wasmcloud:sqldb wasmbus.providerReceive
Type Aliases§
- Columns
- List of columns in the result set returned by a Query operation
- Parameters
- An optional list of arguments to be used in the SQL statement. When a statement uses question marks ‘?’ for placeholders, the capability provider will replace the specified arguments during execution. The command must have exactly as many placeholders as arguments, or the request will fail. The members are CBOR encoded.