mirror of
https://github.com/fluencelabs/sqlite-wasm-connector
synced 2025-03-15 06:20:50 +00:00
Add a few assertions
This commit is contained in:
parent
9ce913343c
commit
4ddf77ec98
@ -59,6 +59,7 @@ impl<'l> Statement<'l> {
|
||||
///
|
||||
/// The type is revealed after the first step has been taken.
|
||||
pub fn kind(&self, i: usize) -> Type {
|
||||
debug_assert!(i < self.count(), "the index is out of range");
|
||||
match unsafe { ffi::sqlite3_column_type(self.raw.0, i as c_int) } {
|
||||
ffi::SQLITE_BLOB => Type::Binary,
|
||||
ffi::SQLITE_FLOAT => Type::Float,
|
||||
@ -103,6 +104,7 @@ impl<'l> Statement<'l> {
|
||||
/// The leftmost column has the index 0.
|
||||
#[inline]
|
||||
pub fn read<T: Readable>(&self, i: usize) -> Result<T> {
|
||||
debug_assert!(i < self.count(), "the index is out of range");
|
||||
Readable::read(self, i)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user