Skip to content

Commit

Permalink
libsql/core: Add libsql::version() and libsql::version_number()
Browse files Browse the repository at this point in the history
  • Loading branch information
penberg committed Aug 11, 2023
1 parent 0511cd2 commit faaa9e7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,13 @@ pub use rows::Row;
pub use rows::Rows;
pub use rows::RowsFuture;
pub use statement::{Column, Statement};

/// Return the version of the underlying SQLite library as a number.
pub fn version_number() -> i32 {
unsafe { ffi::sqlite3_libversion_number() }
}

/// Return the version of the underlying SQLite library as a string.
pub fn version() -> &'static str {
unsafe { std::ffi::CStr::from_ptr(ffi::sqlite3_libversion()).to_str().unwrap() }
}

0 comments on commit faaa9e7

Please sign in to comment.