From cac3f193d748a00008146ffacf8c9f135d08aef1 Mon Sep 17 00:00:00 2001 From: Tim Murison Date: Mon, 22 Jun 2020 23:26:47 -0400 Subject: [PATCH] Adds a method get the underlying sqlite3 pointer --- sqlx-core/src/sqlite/connection/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sqlx-core/src/sqlite/connection/mod.rs b/sqlx-core/src/sqlite/connection/mod.rs index 47fa5461..5e3d3d12 100644 --- a/sqlx-core/src/sqlite/connection/mod.rs +++ b/sqlx-core/src/sqlite/connection/mod.rs @@ -4,6 +4,7 @@ use std::sync::Arc; use futures_core::future::BoxFuture; use futures_util::future; use hashbrown::HashMap; +use libsqlite3_sys::sqlite3; use crate::connection::{Connect, Connection}; use crate::error::Error; @@ -33,6 +34,13 @@ pub struct SqliteConnection { scratch_row_column_names: Arc>, } +impl SqliteConnection { + /// Returns the underlying sqlite3* connection handle + pub fn as_raw_handle(&self) -> *mut sqlite3 { + self.handle.as_ptr() + } +} + impl Debug for SqliteConnection { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { f.debug_struct("SqliteConnection").finish()