MCPcopy Create free account
hub / github.com/douglance/devsql / list_tables

Method list_tables

crates/ccql/src/sql/mod.rs:159–189  ·  view source on GitHub ↗

Get available tables (files in the data directory)

(&self)

Source from the content-addressed store, hash-verified

157
158 /// Get available tables (files in the data directory)
159 pub fn list_tables(&self) -> Result<Vec<String>> {
160 let mut tables = Vec::new();
161
162 // history.jsonl -> history table
163 if self.config.history_file().exists() {
164 tables.push("history".to_string());
165 }
166
167 // Codex history.jsonl -> jhistory table
168 if self.config.jhistory_file().exists() {
169 tables.push("jhistory".to_string());
170 tables.push("codex_history".to_string());
171 }
172
173 // stats-cache.json -> stats table (note: renamed to avoid hyphen in SQL)
174 if self.config.stats_file().exists() {
175 tables.push("stats".to_string());
176 }
177
178 // Virtual multi-file tables
179 if self.config.transcripts_dir().exists() || self.config.projects_dir().exists() {
180 tables.push("transcripts".to_string());
181 tables.push("sessions".to_string());
182 }
183
184 if self.config.todos_dir().exists() {
185 tables.push("todos".to_string());
186 }
187
188 Ok(tables)
189 }
190}
191
192/// Check if a SQL statement is a write operation

Callers

nothing calls this directly

Calls 6

history_fileMethod · 0.80
jhistory_fileMethod · 0.80
stats_fileMethod · 0.80
transcripts_dirMethod · 0.80
projects_dirMethod · 0.80
todos_dirMethod · 0.80

Tested by

no test coverage detected