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

Function show_schema

crates/vcsql/src/main.rs:95–118  ·  view source on GitHub ↗
(table_name: Option<&str>)

Source from the content-addressed store, hash-verified

93}
94
95fn show_schema(table_name: Option<&str>) -> Result<()> {
96 match table_name {
97 Some(name) => {
98 if let Some(info) = get_table_info(name) {
99 print_table_schema(info);
100 } else {
101 eprintln!("Table '{}' not found.", name);
102 eprintln!("\nAvailable tables:");
103 for t in TABLES {
104 eprintln!(" {}", t.name);
105 }
106 std::process::exit(1);
107 }
108 }
109 None => {
110 for info in TABLES {
111 print_table_schema(info);
112 println!();
113 }
114 }
115 }
116
117 Ok(())
118}
119
120fn print_table_schema(info: &vcsql::sql::TableInfo) {
121 println!("\nTABLE: {}", info.name);

Callers 1

mainFunction · 0.85

Calls 2

get_table_infoFunction · 0.85
print_table_schemaFunction · 0.85

Tested by

no test coverage detected