1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use crate::config::{DataLoadConfiguration, DatabaseConfiguration};
use crate::errors::GraphLoaderError;
use crate::graph_loader::{CollectionInfo, GraphLoader};

// User-facing functions to load graphs
pub async fn load_named_graph(
    db_config: DatabaseConfiguration,
    load_config: DataLoadConfiguration,
    graph_name: String,
    vertex_global_fields: Option<Vec<String>>,
    edge_global_fields: Option<Vec<String>>,
) -> Result<GraphLoader, GraphLoaderError> {
    GraphLoader::new_named(
        db_config,
        load_config,
        graph_name,
        vertex_global_fields,
        edge_global_fields,
    )
    .await
}

pub async fn load_custom_graph(
    db_config: DatabaseConfiguration,
    load_config: DataLoadConfiguration,
    vertex_collections: Vec<CollectionInfo>,
    edge_collections: Vec<CollectionInfo>,
) -> Result<GraphLoader, GraphLoaderError> {
    GraphLoader::new_custom(db_config, load_config, vertex_collections, edge_collections).await
}