diff --git a/Cargo.toml b/Cargo.toml index 1b6a433..5f57567 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sqlite" -version = "0.17.1" +version = "0.17.2" authors = ["Ivan Ukhov "] license = "MIT" repository = "https://github.com/stainless-steel/sqlite" diff --git a/src/lib.rs b/src/lib.rs index 9a2de66..7904269 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -159,6 +159,14 @@ pub fn open>(path: T) -> Result { Connection::open(path) } +/// Return the version number of SQLite. +/// +/// For instance, the version `3.8.11.1` corresponds to the integer `3008011`. +#[inline] +pub fn version() -> usize { + unsafe { ffi::sqlite3_libversion_number() as usize } +} + fn last_error(raw: *mut ffi::sqlite3) -> Option { unsafe { let code = ffi::sqlite3_errcode(raw);