mirror of
https://github.com/fluencelabs/sqlite-wasm-connector
synced 2025-06-26 13:31:32 +00:00
Merge branch 'bindable-option' of https://github.com/danieldulaney/sqlite into danieldulaney-bindable-option
This commit is contained in:
@ -229,6 +229,17 @@ impl Bindable for () {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Bindable> Bindable for Option<T> {
|
||||
#[inline]
|
||||
fn bind(self, statement: &mut Statement, i: usize) -> Result<()> {
|
||||
debug_assert!(i > 0, "the indexing starts from 1");
|
||||
match self {
|
||||
Some(inner) => inner.bind(statement, i),
|
||||
None => ().bind(statement, i),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Readable for Value {
|
||||
fn read(statement: &Statement, i: usize) -> Result<Self> {
|
||||
Ok(match statement.kind(i) {
|
||||
|
Reference in New Issue
Block a user