Skip to content

Commit 79ac527

Browse files
committed
progress with graph
1 parent 65a560c commit 79ac527

File tree

20 files changed

+1608
-2552
lines changed

20 files changed

+1608
-2552
lines changed

Cargo.lock

Lines changed: 0 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ members = [
2222
"search/typesense",
2323
"graph/graph",
2424
"graph/arangodb",
25-
"graph/janusgraph",
25+
#"graph/janusgraph",
2626
"graph/neo4j",
2727
"video/video",
2828
"video/kling",

graph/arangodb/src/helpers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ pub(crate) fn config_from_env() -> Result<ConnectionConfig, GraphError> {
182182
.ok();
183183

184184
Ok(ConnectionConfig {
185-
hosts: vec![host],
185+
hosts: Some(vec![host]),
186186
port,
187187
database_name,
188188
username: Some(username),
@@ -331,7 +331,7 @@ mod tests {
331331
env::set_var("ARANGODB_PASSWORD", "pass1");
332332
env::set_var("ARANGODB_PORT", "8529");
333333
let cfg = config_from_env().unwrap();
334-
assert_eq!(cfg.hosts, vec!["localhost".to_string()]);
334+
assert_eq!(cfg.hosts, Some(vec!["localhost".to_string()]));
335335
assert_eq!(cfg.port, Some(8529));
336336
assert_eq!(cfg.username, Some("user1".to_string()));
337337
assert_eq!(cfg.password, Some("pass1".to_string()));

graph/arangodb/src/lib.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ mod client;
22
mod connection;
33
mod conversions;
44
mod helpers;
5-
mod query;
65
mod schema;
76
mod transaction;
8-
mod traversal;
97

108
use client::ArangoDbApi;
119
use golem_graph::config::with_config_key;
@@ -35,7 +33,13 @@ impl ExtendedGuest for GraphArangoDbComponent {
3533
fn connect_internal(config: &ConnectionConfig) -> Result<Graph, GraphError> {
3634
let host = with_config_key(config, "ARANGO_HOST")
3735
.or_else(|| with_config_key(config, "ARANGODB_HOST"))
38-
.or_else(|| config.hosts.first().cloned())
36+
.or_else(|| {
37+
config
38+
.hosts
39+
.as_ref()
40+
.and_then(|hosts| hosts.first())
41+
.cloned()
42+
})
3943
.ok_or_else(|| GraphError::ConnectionFailed("Missing host".to_string()))?;
4044

4145
let port = with_config_key(config, "ARANGO_PORT")

graph/arangodb/src/query.rs

Lines changed: 0 additions & 191 deletions
This file was deleted.

0 commit comments

Comments
 (0)