mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 10:08:20 +00:00
Nit
This commit is contained in:
parent
39245f35cc
commit
eaa8743c36
3 changed files with 4 additions and 20 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -1064,7 +1064,7 @@ version = "0.0.12"
|
|||
dependencies = [
|
||||
"jni",
|
||||
"limbo_core",
|
||||
"thiserror 2.0.9",
|
||||
"thiserror 2.0.11",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
@ -11,6 +11,7 @@ use limbo_core::Connection;
|
|||
use std::rc::Rc;
|
||||
|
||||
#[derive(Clone)]
|
||||
#[allow(dead_code)]
|
||||
pub struct LimboConnection {
|
||||
pub(crate) conn: Rc<Connection>,
|
||||
pub(crate) io: Rc<dyn limbo_core::IO>,
|
||||
|
@ -39,20 +40,6 @@ pub fn to_limbo_connection(ptr: jlong) -> Result<&'static mut LimboConnection> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Returns a pointer to a `Cursor` object.
|
||||
///
|
||||
/// The Java application will pass this pointer to native functions,
|
||||
/// which will use it to reference the `Cursor` object.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `_env` - The JNI environment pointer.
|
||||
/// * `_class` - The Java class calling this function.
|
||||
/// * `connection_ptr` - A pointer to the `Connection` object.
|
||||
///
|
||||
/// # Returns
|
||||
///
|
||||
/// A `jlong` representing the pointer to the newly created `Cursor` object.
|
||||
#[no_mangle]
|
||||
pub extern "system" fn Java_org_github_tursodatabase_core_LimboConnection_prepareUtf8<'local>(
|
||||
mut env: JNIEnv<'local>,
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
use crate::errors::{LimboError, Result, LIMBO_ETC};
|
||||
use crate::limbo_connection::LimboConnection;
|
||||
use crate::utils::set_err_msg_and_throw_exception;
|
||||
use jni::objects::{JByteArray, JObject};
|
||||
use jni::sys::{jint, jlong};
|
||||
use jni::JNIEnv;
|
||||
use limbo_core::Database;
|
||||
use std::rc::Rc;
|
||||
use std::sync::Arc;
|
||||
use crate::utils::set_err_msg_and_throw_exception;
|
||||
|
||||
struct LimboDB {
|
||||
db: Arc<Database>,
|
||||
|
@ -127,10 +127,7 @@ pub extern "system" fn Java_org_github_tursodatabase_core_LimboDB_connect0<'loca
|
|||
}
|
||||
},
|
||||
};
|
||||
let conn = LimboConnection::new(
|
||||
db.db.connect(),
|
||||
io,
|
||||
);
|
||||
let conn = LimboConnection::new(db.db.connect(), io);
|
||||
|
||||
conn.to_ptr()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue