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

Function test_subquery_with_arithmetic

tests/subquery_cte_test.rs:128–138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

126
127#[test]
128fn test_subquery_with_arithmetic() {
129 let conn = setup_test_db();
130
131 let sql = "SELECT name,
132 (SELECT SUM(total + tax) FROM orders WHERE customer_id = c.id) as total_with_tax
133 FROM customers c";
134 let result = rewrite_query(&conn, sql).unwrap();
135
136 println!("Subquery with arithmetic rewritten to: {result}");
137 assert!(result.contains("decimal_add"));
138}
139
140#[test]
141fn test_derived_table_subquery() {

Callers

nothing calls this directly

Calls 2

setup_test_dbFunction · 0.70
rewrite_queryFunction · 0.70

Tested by

no test coverage detected