Skip to main content

create_graph/
create_graph.rs

1use std::env;
2
3use terminus_store::*;
4use tokio;
5
6#[tokio::main]
7async fn main() {
8    let args: Vec<String> = env::args().collect();
9    if args.len() != 3 {
10        println!("usage: {} <path> <graph_name>", args[0]);
11    } else {
12        // open a store at the given path. the directory has to exist.
13        let store = open_directory_store(&args[1]);
14
15        // then create a graph. if the graph already exists, this will error.
16        store.create(&args[2]).await.unwrap();
17    }
18}