-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
261942b
commit a31c6e6
Showing
21 changed files
with
3,117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[package] | ||
name = "kuzu-rust-example" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
kuzu = {path="../../tools/rust_api"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use kuzu::{Connection, Database, Error}; | ||
|
||
fn main() -> Result<(), Error> { | ||
let db = Database::new( | ||
std::env::args() | ||
.nth(1) | ||
.expect("The first CLI argument should be the database path"), | ||
0, | ||
)?; | ||
let connection = Connection::new(&db)?; | ||
|
||
// Create schema. | ||
connection.query("CREATE NODE TABLE Person(name STRING, age INT64, PRIMARY KEY(name));")?; | ||
// Create nodes. | ||
connection.query("CREATE (:Person {name: 'Alice', age: 25});")?; | ||
connection.query("CREATE (:Person {name: 'Bob', age: 30});")?; | ||
|
||
// Execute a simple query. | ||
let mut result = connection.query("MATCH (a:Person) RETURN a.name AS NAME, a.age AS AGE;")?; | ||
|
||
// Print query result. | ||
println!("{}", result.display()); | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
target | ||
Cargo.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[package] | ||
name = "kuzu" | ||
version = "0.0.4" | ||
description = "An in-process property graph database management system built for query speed and scalability" | ||
# Note: 1.63 required for building tests | ||
rust-version = "1.51" | ||
readme = "../../README.md" | ||
homepage = "http://kuzudb.com/" | ||
repository = "https://github.com/kuzudb/kuzu" | ||
license = "MIT" | ||
categories = ["database"] | ||
|
||
edition = "2018" | ||
links = "kuzu" | ||
|
||
[dependencies] | ||
cxx = "1.0" | ||
num-derive = "0.3" | ||
num-traits = "0.2" | ||
time = "0.3" | ||
|
||
[build-dependencies] | ||
cxx-build = "1.0" | ||
num_cpus = "1.0" | ||
|
||
[dev-dependencies] | ||
tempdir = "0.3" | ||
anyhow = "1" | ||
time = {version="0.3", features=["macros"]} |
Oops, something went wrong.