We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b694df6 commit ce868ccCopy full SHA for ce868cc
src/storage/sqlite_pool.rs
@@ -77,3 +77,26 @@ impl SqliteConnectionPool {
77
f(&conn)
78
}
79
80
+
81
+#[cfg(test)]
82
+mod tests {
83
+ use super::*;
84
85
+ #[test]
86
+ fn test_simple_connection() {
87
+ let filename = tempfile::NamedTempFile::new().unwrap().into_temp_path();
88
+ rusqlite::Connection::open(&filename).unwrap();
89
90
+ let pool = SqliteConnectionPool::new(NonZeroU64::new(1).unwrap());
91
92
+ pool.with_connection(&filename, |conn| {
93
+ conn.query_row("SELECT 1", [], |row| {
94
+ assert_eq!(row.get::<_, i32>(0).unwrap(), 1);
95
+ Ok(())
96
+ })
97
+ .unwrap();
98
99
100
101
+ }
102
+}
0 commit comments