From faaa9e7114a41b09d04733ff1c1c06d74218acb2 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Fri, 11 Aug 2023 13:37:29 +0300 Subject: [PATCH] libsql/core: Add libsql::version() and libsql::version_number() --- crates/core/src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/core/src/lib.rs b/crates/core/src/lib.rs index fed050aa4a..40c4be2049 100644 --- a/crates/core/src/lib.rs +++ b/crates/core/src/lib.rs @@ -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() } +} \ No newline at end of file