Parameterized SQL query

Databases

//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(2, 0.5).unwrap()        
    .into_cursor(); 

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