Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
0o-de-lally committed Dec 6, 2024
1 parent e7d4e4e commit ef6e66b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/neo4j_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ pub static INDEX_SWAP_ID: &str =
pub static INDEX_SWAP_TIME: &str =
"CREATE INDEX swap_time IF NOT EXISTS FOR ()-[r:Swap]-() ON (r.filled_at)";

pub static INDEX_EXCHANGE_LEDGER: &str = r#"
pub static INDEX_EXCHANGE_LEDGER: &str = "
CREATE INDEX user_ledger IF NOT EXISTS FOR (ul:UserExchangeLedger) ON (ul.date)
";

pub static INDEX_EXCHANGE_LINK_LEDGER: &str = "
CREATE INDEX link_ledger IF NOT EXISTS FOR ()-[r:DailyLedger]->() ON (r.date)
"#;
";

/// get the testing neo4j connection
pub async fn get_neo4j_localhost_pool(port: u16) -> Result<Graph> {
Expand Down Expand Up @@ -73,6 +76,7 @@ pub async fn maybe_create_indexes(graph: &Graph) -> Result<()> {
INDEX_TX_FUNCTION,
INDEX_SWAP_ID,
INDEX_EXCHANGE_LEDGER,
INDEX_EXCHANGE_LINK_LEDGER,
])
.await?;
txn.commit().await?;
Expand Down
2 changes: 1 addition & 1 deletion tests/test_neo4j_meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async fn test_tx_insert() -> Result<()> {
}

#[tokio::test]
async fn test_init_indices() {
async fn test_init_indexes() {
let c = start_neo4j_container();
let port = c.get_host_port_ipv4(7687);
let graph = get_neo4j_localhost_pool(port)
Expand Down

0 comments on commit ef6e66b

Please sign in to comment.