mirror of
https://github.com/fluencelabs/sqlite-wasm-connector
synced 2025-04-25 08:42:14 +00:00
Fix the lifetime binding of Database::open
This commit is contained in:
parent
c0c44e67b8
commit
2cdf79bca0
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "sqlite"
|
name = "sqlite"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
authors = ["Ivan Ukhov <ivan.ukhov@gmail.com>"]
|
authors = ["Ivan Ukhov <ivan.ukhov@gmail.com>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://github.com/stainless-steel/sqlite"
|
repository = "https://github.com/stainless-steel/sqlite"
|
||||||
|
@ -16,7 +16,7 @@ pub type ExecuteCallback<'l> = FnMut(Vec<(String, String)>) -> bool + 'l;
|
|||||||
|
|
||||||
impl<'l> Database<'l> {
|
impl<'l> Database<'l> {
|
||||||
/// Open a database.
|
/// Open a database.
|
||||||
pub fn open(path: &Path) -> Result<Database> {
|
pub fn open(path: &Path) -> Result<Database<'l>> {
|
||||||
let mut raw = 0 as *mut _;
|
let mut raw = 0 as *mut _;
|
||||||
unsafe {
|
unsafe {
|
||||||
success!(raw::sqlite3_open(path_to_c_str!(path), &mut raw));
|
success!(raw::sqlite3_open(path_to_c_str!(path), &mut raw));
|
||||||
|
@ -65,6 +65,6 @@ pub use statement::{Statement, Binding, Value};
|
|||||||
|
|
||||||
/// Open a database.
|
/// Open a database.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn open(path: &std::path::Path) -> Result<Database> {
|
pub fn open<'l>(path: &std::path::Path) -> Result<Database<'l>> {
|
||||||
Database::open(path)
|
Database::open(path)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user