Add version

This commit is contained in:
Ivan Ukhov 2015-08-01 21:38:54 -04:00
parent 301f27e94a
commit 3cdedd7db6
2 changed files with 9 additions and 1 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "sqlite"
version = "0.17.1"
version = "0.17.2"
authors = ["Ivan Ukhov <ivan.ukhov@gmail.com>"]
license = "MIT"
repository = "https://github.com/stainless-steel/sqlite"

View File

@ -159,6 +159,14 @@ pub fn open<T: AsRef<std::path::Path>>(path: T) -> Result<Connection> {
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<Error> {
unsafe {
let code = ffi::sqlite3_errcode(raw);