Check if a table has any DECIMAL columns that would require query rewriting
(
_conn: &Connection,
table_name: &str,
schema_cache: &SchemaCache,
)
| 301 | |
| 302 | /// Check if a table has any DECIMAL columns that would require query rewriting |
| 303 | pub fn table_has_decimal_columns( |
| 304 | _conn: &Connection, |
| 305 | table_name: &str, |
| 306 | schema_cache: &SchemaCache, |
| 307 | ) -> Result<bool, rusqlite::Error> { |
| 308 | // Check dedicated decimal cache first |
| 309 | if let Ok(cache) = DECIMAL_TABLE_CACHE.lock() |
| 310 | && let Some(&has_decimal) = cache.get(table_name) { |
| 311 | return Ok(has_decimal); |
| 312 | } |
| 313 | |
| 314 | // Fast decimal detection using bloom filter |
| 315 | let has_decimal = schema_cache.has_decimal_columns(table_name); |
| 316 | |
| 317 | // Cache the result |
| 318 | if let Ok(mut cache) = DECIMAL_TABLE_CACHE.lock() { |
| 319 | cache.insert(table_name.to_string(), has_decimal); |
| 320 | } |
| 321 | |
| 322 | Ok(has_decimal) |
| 323 | } |
| 324 | |
| 325 | /// Fast path DML execution that bypasses parsing and rewriting |
| 326 | pub fn execute_fast_path( |
no test coverage detected