mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 01:58:16 +00:00
Pass io to statement from db
This commit is contained in:
parent
53586b9d00
commit
f10b41c5b5
3 changed files with 22 additions and 58 deletions
|
@ -9,16 +9,19 @@ use jni::sys::jlong;
|
|||
use jni::JNIEnv;
|
||||
use limbo_core::Connection;
|
||||
use std::rc::Rc;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[derive(Clone)]
|
||||
#[allow(dead_code)]
|
||||
pub struct LimboConnection {
|
||||
// Because java's LimboConnection is 1:1 mapped to limbo connection, we can use Rc
|
||||
pub(crate) conn: Rc<Connection>,
|
||||
pub(crate) io: Rc<dyn limbo_core::IO>,
|
||||
// Because io is shared across multiple `LimboConnection`s, wrap it with Arc
|
||||
pub(crate) io: Arc<dyn limbo_core::IO>,
|
||||
}
|
||||
|
||||
impl LimboConnection {
|
||||
pub fn new(conn: Rc<Connection>, io: Rc<dyn limbo_core::IO>) -> Self {
|
||||
pub fn new(conn: Rc<Connection>, io: Arc<dyn limbo_core::IO>) -> Self {
|
||||
LimboConnection { conn, io }
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue