mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
Rust: Test more variants of rusqlite usage.
This commit is contained in:
@@ -48,5 +48,13 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
})
|
||||
})?;
|
||||
|
||||
_ = connection.prepare_cached("SELECT id, name, age FROM person")?; // $ MISSING: sql-sink
|
||||
_ = connection.prepare_with_flags("SELECT id, name, age FROM person", rusqlite::PrepFlags::empty())?; // $ MISSING: ql-sink
|
||||
_ = connection.query_row_and_then("SELECT id, name, age FROM person", [], |row| { // $ sql-sink
|
||||
let row: &rusqlite::Row<'_> = row;
|
||||
let result: Result<i32, rusqlite::Error> = Ok(row.get(0)?); // $ database-read
|
||||
result
|
||||
})?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user