Adds a method get the underlying sqlite3 pointer

This commit is contained in:
Tim Murison 2020-06-22 23:26:47 -04:00 committed by Ryan Leckey
parent 2adfb1926a
commit cac3f193d7

View File

@ -4,6 +4,7 @@ use std::sync::Arc;
use futures_core::future::BoxFuture; use futures_core::future::BoxFuture;
use futures_util::future; use futures_util::future;
use hashbrown::HashMap; use hashbrown::HashMap;
use libsqlite3_sys::sqlite3;
use crate::connection::{Connect, Connection}; use crate::connection::{Connect, Connection};
use crate::error::Error; use crate::error::Error;
@ -33,6 +34,13 @@ pub struct SqliteConnection {
scratch_row_column_names: Arc<HashMap<UStr, usize>>, scratch_row_column_names: Arc<HashMap<UStr, usize>>,
} }
impl SqliteConnection {
/// Returns the underlying sqlite3* connection handle
pub fn as_raw_handle(&self) -> *mut sqlite3 {
self.handle.as_ptr()
}
}
impl Debug for SqliteConnection { impl Debug for SqliteConnection {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.debug_struct("SqliteConnection").finish() f.debug_struct("SqliteConnection").finish()