()
| 291 | |
| 292 | #[test] |
| 293 | fn test_statement_pool_execute() { |
| 294 | let pool = StatementPool::new(10); |
| 295 | let conn = Connection::open_in_memory().unwrap(); |
| 296 | |
| 297 | conn.execute("CREATE TABLE test (id INTEGER, name TEXT)", []).unwrap(); |
| 298 | |
| 299 | // Test execute through pool |
| 300 | let rows_affected = pool.execute_cached(&conn, |
| 301 | "INSERT INTO test (id, name) VALUES (?, ?)", |
| 302 | [&1i32 as &dyn rusqlite::ToSql, &"Alice"]).unwrap(); |
| 303 | assert_eq!(rows_affected, 1); |
| 304 | |
| 305 | // Test query through pool |
| 306 | let (columns, rows) = pool.query_cached(&conn, |
| 307 | "SELECT id, name FROM test WHERE id = ?", |
| 308 | [&1i32 as &dyn rusqlite::ToSql]).unwrap(); |
| 309 | assert_eq!(columns, vec!["id", "name"]); |
| 310 | assert_eq!(rows.len(), 1); |
| 311 | } |
| 312 | |
| 313 | #[test] |
| 314 | fn test_batch_insert_fingerprint() { |
nothing calls this directly
no test coverage detected