mirror of
https://github.com/fluencelabs/sqlite-wasm-connector
synced 2025-06-21 02:51:33 +00:00
Add Statement::columns
This commit is contained in:
@ -58,7 +58,7 @@ macro_rules! raise(
|
||||
macro_rules! error(
|
||||
($connection:expr, $code:expr) => (match ::error::last($connection) {
|
||||
Some(error) => return Err(error),
|
||||
None => return Err(::Error::from(::ErrorKind::from($code as isize))),
|
||||
_ => return Err(::Error::from(::ErrorKind::from($code as isize))),
|
||||
});
|
||||
);
|
||||
|
||||
|
@ -36,6 +36,12 @@ pub trait Value {
|
||||
}
|
||||
|
||||
impl<'l> Statement<'l> {
|
||||
/// Return the number of columns.
|
||||
#[inline]
|
||||
pub fn columns(&mut self) -> usize {
|
||||
unsafe { ffi::sqlite3_column_count(self.raw.0) as usize }
|
||||
}
|
||||
|
||||
/// Bind the parameter at a specific location.
|
||||
///
|
||||
/// The leftmost location has the index 1.
|
||||
|
Reference in New Issue
Block a user