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

Function table_has_decimal_columns

src/query/fast_path.rs:303–323  ·  view source on GitHub ↗

Check if a table has any DECIMAL columns that would require query rewriting

(
    _conn: &Connection,
    table_name: &str,
    schema_cache: &SchemaCache,
)

Source from the content-addressed store, hash-verified

301
302/// Check if a table has any DECIMAL columns that would require query rewriting
303pub 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
326pub fn execute_fast_path(

Callers 6

execute_fast_pathFunction · 0.85
query_fast_pathFunction · 0.85
query_fast_path_enhancedFunction · 0.85

Calls 3

has_decimal_columnsMethod · 0.80
getMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected