MCPcopy Create free account
hub / github.com/erans/pgsqlite / test_current_user_with_parentheses

Function test_current_user_with_parentheses

tests/session_functions_test.rs:27–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25
26#[tokio::test]
27async fn test_current_user_with_parentheses() {
28 // Create a temporary database
29 let temp_dir = tempfile::tempdir().unwrap();
30 let db_path = temp_dir.path().join("session_parentheses_test.db");
31 let db_handler = Arc::new(DbHandler::new(db_path.to_str().unwrap()).unwrap());
32
33 // Create session
34 let session_id = Uuid::new_v4();
35 db_handler.create_session_connection(session_id).await.unwrap();
36
37 // Test current_user() function with parentheses
38 let result = db_handler.query_with_session("SELECT current_user()", &session_id).await.unwrap();
39
40 assert_eq!(result.columns.len(), 1);
41 assert_eq!(result.rows.len(), 1);
42
43 let user = String::from_utf8(result.rows[0][0].as_ref().unwrap().clone()).unwrap();
44 assert_eq!(user, "postgres");
45}
46
47#[tokio::test]
48async fn test_current_database_basic() {

Callers

nothing calls this directly

Calls 3

query_with_sessionMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected