query_named
will accept
&foo
, not just foo
.
&'a [(&'static str, Box<dyn ToSql>)]
to &'a [(&'static str, &'a dyn ToSql)]
as_slice
, etc. still gets a type mismatch. That does work if I'm just using an unnamed &Vec<Box<dyn ToSql>>
but not for the named variant. I was trying to avoid that, however, since the complexity of the query and user input means I can't used numbered parameters and just using ?
parameters results in numerous copies of several parameters that get used multiple times in the query
_named
vs non-_named
functionality
let rows = match result {
Ok(rows) => rows,
Err(e @
rusqlite::Error::SqliteFailure(
libsqlite3_sys::Error { extended_code: 2067, .. },
_,
),
) => panic!("constraint violation: {:#?}", e),
Err(
rusqlite::Error::SqliteFailure(
libsqlite3_sys::Error { extended_code: 1, .. },
msg,
),
) => panic!("no such table: {:#?}", msg.unwrap()),
_ => panic!("some other error: {:#?}", result)
};
winit
requires very complex match statements like this too
26 | libsqlite3_sys::Error { extended_code: libsqlite3_sys::SQLITE_ERROR, .. },
| ^^^^^^^^^^^^^^ use of undeclared crate or module `libsqlite3_sys`
cd /tmp/rusqtest; cargo build
And I get that error.