Get schema for a table using lazy loading
(&self, conn: &Connection, table_name: &str)
| 102 | |
| 103 | /// Get schema for a table using lazy loading |
| 104 | pub fn get_table_schema(&self, conn: &Connection, table_name: &str) -> Result<Option<crate::cache::schema::TableSchema>, rusqlite::Error> { |
| 105 | let result = self.lazy_schema_loader.get_schema(conn, table_name)?; |
| 106 | |
| 107 | if result.is_some() { |
| 108 | let mut stats = self.optimization_stats.write().unwrap(); |
| 109 | stats.schema_cache_hits += 1; |
| 110 | } |
| 111 | |
| 112 | Ok(result) |
| 113 | } |
| 114 | |
| 115 | /// Preload schemas for multiple tables (useful for JOIN queries) |
| 116 | pub fn preload_schemas(&self, conn: &Connection, table_names: &[String]) -> Result<(), rusqlite::Error> { |