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

Function test_insert_with_numeric_values

tests/decimal_rewriter_test.rs:182–195  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

180
181#[test]
182fn test_insert_with_numeric_values() {
183 let conn = setup_test_db();
184
185 // INSERT with VALUES
186 let sql = "INSERT INTO products (name, price, discount) VALUES ('Test', 99.99, 10.5)";
187 let result = rewrite_query(&conn, sql).unwrap();
188 // INSERT values shouldn't be rewritten in this simple case
189 assert!(!result.contains("decimal_"));
190
191 // INSERT with SELECT
192 let sql = "INSERT INTO products (name, price) SELECT name, price * 1.1 FROM products";
193 let result = rewrite_query(&conn, sql).unwrap();
194 assert!(result.contains("decimal_mul"));
195}
196
197#[test]
198fn test_update_with_numeric_operations() {

Callers

nothing calls this directly

Calls 2

setup_test_dbFunction · 0.70
rewrite_queryFunction · 0.70

Tested by

no test coverage detected