使用数据库(DB)

//SQLite example
//crate sqlite = "0.27.0" 

// Connect to the database
let connection = sqlite::open(
    "data.sqlite").unwrap();      

let sql = r"
    SELECT
      Language, Percentage
    FROM countrylanguage
    WHERE
      CountryCode = ? AND
      Percentage > ?"

// SQL query execution
let mut cursor = connection
    .prepare(sql).unwrap()
    .bind(1"RUS").unwrap()
    .bind(20.5).unwrap()        
    .into_cursor(); 

while let Some(Ok(row)) = cursor.next() {
    println!("{}{}"
        row.get::<String_>(0),
        row.get::<f64_>(1));
}