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

Function main

crates/vcsql/src/main.rs:11–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9use vcsql::sql::schema::{get_table_info, get_tables_by_category, TABLES};
10
11fn main() -> Result<()> {
12 let args = Args::parse();
13
14 match &args.command {
15 Some(Command::Tables) => show_tables(),
16 Some(Command::Schema { table }) => show_schema(table.as_deref()),
17 Some(Command::Examples) => show_examples(),
18 None => {
19 if let Some(sql) = &args.sql {
20 execute_query(&args, sql)
21 } else {
22 eprintln!("No query provided. Use 'vcsql --help' for usage.");
23 eprintln!("\nQuick start:");
24 eprintln!(" vcsql \"SELECT * FROM commits LIMIT 10\"");
25 eprintln!(" vcsql tables");
26 eprintln!(" vcsql examples");
27 std::process::exit(1);
28 }
29 }
30 }
31}
32
33fn execute_query(args: &Args, sql: &str) -> Result<()> {
34 let start = Instant::now();

Callers

nothing calls this directly

Calls 4

show_tablesFunction · 0.85
show_schemaFunction · 0.85
show_examplesFunction · 0.85
execute_queryFunction · 0.85

Tested by

no test coverage detected