Repository navigation
Fix broken JS/Java/Rust code samples in quickstart docs #577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -341,6 +341,7 @@ geospatial | |
| getConfig | ||
| getMessage | ||
| GETUSER | ||
| getValue | ||
| getzep | ||
| gg | ||
| GitHub | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -186,6 +186,7 @@ public class FalkorDBExample { | |||||||||||||
|
|
||||||||||||||
| ```rust Rust | ||||||||||||||
| use falkordb::{FalkorClientBuilder, FalkorConnectionInfo}; | ||||||||||||||
| use futures::StreamExt; | ||||||||||||||
|
|
||||||||||||||
| #[tokio::main] | ||||||||||||||
| async fn main() -> Result<(), Box<dyn std::error::Error>> { | ||||||||||||||
|
|
@@ -203,7 +204,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { | |||||||||||||
| let mut graph = client.select_graph("MotoGP"); | ||||||||||||||
|
|
||||||||||||||
| // Clear out this graph in case you've run this script before. | ||||||||||||||
| graph.delete().await?; | ||||||||||||||
| let _ = graph.delete().await; | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Prompt for AI agents
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Ignore only the missing-graph deletion error. If deletion fails for another reason, this line lets the example continue with the existing graph. A later successful write can then leave old data in the example’s results. Handle the missing-graph error specifically, and propagate other errors. Based on learnings: “In Rust, do not discard Result values with patterns like 🤖 Prompt for AI AgentsSource: Learnings |
||||||||||||||
|
|
||||||||||||||
| graph | ||||||||||||||
| .query( | ||||||||||||||
|
|
@@ -225,8 +226,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { | |||||||||||||
| .execute() | ||||||||||||||
| .await?; | ||||||||||||||
|
|
||||||||||||||
| for node in nodes.data.by_ref() { | ||||||||||||||
| println!("{:?}", node); | ||||||||||||||
| // `nodes.data` is a `RowStream` (a `futures::Stream`), not a synchronous | ||||||||||||||
| // `Iterator`, so draining it needs `.next().await` rather than a plain `for` loop. | ||||||||||||||
| while let Some(row) = nodes.data.next().await { | ||||||||||||||
| println!("{:?}", row?); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| // Query how many riders represent team Ducati? | ||||||||||||||
|
|
@@ -235,8 +238,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { | |||||||||||||
| .execute() | ||||||||||||||
| .await?; | ||||||||||||||
|
|
||||||||||||||
| for node in nodes.data.by_ref() { | ||||||||||||||
| println!("{:?}", node); | ||||||||||||||
| while let Some(row) = nodes.data.next().await { | ||||||||||||||
| println!("{:?}", row?); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| Ok(()) | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: This new direct import requires a
futuresdependency, but the quickstart only installsfalkordb. Addfuturesto the Rust setup instructions or the sample project’sCargo.toml, otherwise the sample fails with an unresolved crate.Prompt for AI agents