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

Function test_simple_subquery_in_select

tests/subquery_cte_test.rs:115–125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113
114#[test]
115fn test_simple_subquery_in_select() {
116 let conn = setup_test_db();
117
118 let sql = "SELECT name, (SELECT SUM(total) FROM orders WHERE customer_id = c.id) as total_orders
119 FROM customers c";
120 let result = rewrite_query(&conn, sql).unwrap();
121
122 println!("Subquery in SELECT rewritten to: {result}");
123 assert!(result.contains("decimal_from_text"));
124 assert!(result.contains("SUM"));
125}
126
127#[test]
128fn test_subquery_with_arithmetic() {

Callers

nothing calls this directly

Calls 2

setup_test_dbFunction · 0.70
rewrite_queryFunction · 0.70

Tested by

no test coverage detected