mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 01:58:16 +00:00
bindings/rust: Fix complaints about non-Sync/Send use of Arc
We probably should drop the `Rc` from `Connection` in the core, but let's paper over it for now.
This commit is contained in:
parent
08c1dce549
commit
50f9cc449c
1 changed files with 12 additions and 6 deletions
|
@ -60,9 +60,11 @@ unsafe impl Sync for Database {}
|
|||
impl Database {
|
||||
pub fn connect(&self) -> Result<Connection> {
|
||||
let conn = self.inner.connect();
|
||||
Ok(Connection {
|
||||
#[allow(clippy::arc_with_non_send_sync)]
|
||||
let connection = Connection {
|
||||
inner: Arc::new(Mutex::new(conn)),
|
||||
})
|
||||
};
|
||||
Ok(connection)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -100,9 +102,11 @@ impl Connection {
|
|||
|
||||
let stmt = conn.prepare(sql)?;
|
||||
|
||||
Ok(Statement {
|
||||
#[allow(clippy::arc_with_non_send_sync)]
|
||||
let statement = Statement {
|
||||
inner: Arc::new(Mutex::new(stmt)),
|
||||
})
|
||||
};
|
||||
Ok(statement)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -120,9 +124,11 @@ impl Statement {
|
|||
crate::params::Params::None => {}
|
||||
_ => todo!(),
|
||||
}
|
||||
Ok(Rows {
|
||||
#[allow(clippy::arc_with_non_send_sync)]
|
||||
let rows = Rows {
|
||||
inner: Arc::clone(&self.inner),
|
||||
})
|
||||
};
|
||||
Ok(rows)
|
||||
}
|
||||
|
||||
pub async fn execute(&mut self, params: impl IntoParams) -> Result<u64> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue