story-kit: merge 260_refactor_upgrade_libsqlite3_sys

This commit is contained in:
Dave
2026-03-17 13:39:08 +00:00
parent b0e4e04c9d
commit ea062400e5
73 changed files with 23405 additions and 10 deletions

View File

@@ -0,0 +1,23 @@
//! Ensure `loadable_extension.rs` works.
use rusqlite::{Connection, Result};
use std::env::consts::{DLL_PREFIX, DLL_SUFFIX};
fn main() -> Result<()> {
let db = Connection::open_in_memory()?;
unsafe {
db.load_extension_enable()?;
db.load_extension(
format!("target/debug/examples/{DLL_PREFIX}loadable_extension{DLL_SUFFIX}"),
None::<&str>,
)?;
db.load_extension_disable()?;
}
let str = db.query_row("SELECT rusqlite_test_function()", [], |row| {
row.get::<_, String>(0)
})?;
assert_eq!(&str, "Rusqlite extension loaded correctly!");
Ok(())
}