Understanding Database Interactions
Now that our tables are defined, let's learn how to interact with those form a Zephyr program.
Accessing the Tables
#[derive(DatabaseDerive, Clone)]
#[with_name("feedback")]
pub struct Feedback {
pub source: ScVal,
pub hash: ScVal,
pub text: ScVal,
pub votes: ScVal,
}pub fn write_feedback(env: &EnvClient, feedback: Feedback) {
env.put(&feedback)
}DatabaseDerive and Defining Tables Rust-Side
Last updated