Untitled
Anonymous
plain_text
10/21/2024 5:05 AM
468 B
21
Indexable
fn select_first<'a>() -> &'a str {
let connection = sqlite::open("contacts").unwrap();
let mut record= "";
let query = "SELECT * FROM contacts WHERE id = 1;";
connection
.iterate(query, |pairs| {
for &(name,value) in pairs.iter() {
record = value.unwrap();
}
true
}).unwrap();
record
}Editor is loading...
Leave a Comment