Draft for carray module in Rust

Incomplete support for sqlite3_bind_pointer.
Make Context::set_result return a Result.
Add Values::get_array.
This commit is contained in:
gwenn
2018-06-10 12:16:54 +02:00
parent b89b574f81
commit fa64a4d0bf
10 changed files with 290 additions and 60 deletions

View File

@@ -1,4 +1,6 @@
use super::{Null, Value, ValueRef};
#[cfg(feature = "array")]
use vtab::array::Array;
use Result;
/// `ToSqlOutput` represents the possible output types for implementors of the `ToSql` trait.
@@ -13,6 +15,9 @@ pub enum ToSqlOutput<'a> {
/// A BLOB of the given length that is filled with zeroes.
#[cfg(feature = "blob")]
ZeroBlob(i32),
#[cfg(feature = "array")]
Array(Array)
}
// Generically allow any type that can be converted into a ValueRef
@@ -59,6 +64,8 @@ impl<'a> ToSql for ToSqlOutput<'a> {
#[cfg(feature = "blob")]
ToSqlOutput::ZeroBlob(i) => ToSqlOutput::ZeroBlob(i),
#[cfg(feature = "array")]
ToSqlOutput::Array(ref a) => ToSqlOutput::Array(a.clone()),
})
}
}