Expand description
Parameter binding for SQL queries
This module provides ergonomic parameter passing for SQL queries,
similar to rusqlite’s params! macro.
§Examples
use radixdb_api::{Database, params, named_params};
let db = Database::open("memory://")?;
// Using params! macro (positional)
db.execute("INSERT INTO users VALUES ($1, $2, $3)", params![1, "Alice", 30])?;
// Using tuple syntax (positional)
db.execute("INSERT INTO users VALUES ($1, $2)", (1, "Alice"))?;
// Using named_params! macro
db.execute_named(
"INSERT INTO users VALUES (:id, :name, :age)",
named_params!{ id: 1, name: "Alice", age: 30 }
)?;Structs§
- Decimal
Value - Exact public representation of a SQL DECIMAL value.
- Named
Params - Named parameters for SQL queries
Traits§
- Params
- Trait for collections of parameters
- ToParam
- Trait for types that can be converted to SQL parameters
Type Aliases§
- Param
Vec - Positional SQL parameters shared by API adapters and the executor.