()
| 530 | |
| 531 | #[test] |
| 532 | fn test_simple_queries_zero_allocation() { |
| 533 | // These should all return Cow::Borrowed (no allocation) |
| 534 | let queries = [ |
| 535 | "SELECT * FROM users", |
| 536 | "SELECT id, name FROM users WHERE id = $1", |
| 537 | "INSERT INTO users (name, email) VALUES ($1, $2)", |
| 538 | "UPDATE users SET name = $1 WHERE id = $2", |
| 539 | "DELETE FROM users WHERE id = $1", |
| 540 | "SELECT * FROM benchmark_table_pg WHERE int_col > %s", |
| 541 | ]; |
| 542 | |
| 543 | for query in &queries { |
| 544 | let result = process_query(query, &Connection::open_in_memory().unwrap(), &SchemaCache::new(300)); |
| 545 | assert!(matches!(result, Ok(Cow::Borrowed(_)))); |
| 546 | } |
| 547 | } |
| 548 | |
| 549 | #[test] |
| 550 | fn test_simple_returning_passthrough() { |
nothing calls this directly
no test coverage detected