Crates.io | zawgl-core |
lib.rs | zawgl-core |
version | 0.1.11 |
source | src |
created_at | 2023-07-09 10:09:12.3826 |
updated_at | 2024-06-04 07:12:54.916091 |
description | Zawgl Graph Core Library |
homepage | |
repository | |
max_upload_size | |
id | 911940 |
size | 295,647 |
Zawgl graph core library
Sample usage:
use zawgl_core::{model::{init::InitContext, Node, Property, PropertyValue, Relationship}, repository::graph_repository::GraphRepository};
fn main() {
SimpleLogger::new().with_level(LevelFilter::Info).init().unwrap();
let ctx: InitContext = InitContext::new("zawgl-db").expect("can't create database context");
let mut gr = GraphRepository::new(ctx);
let mut node = Node::new();
node.set_labels(vec!["Person".to_string()]);
node.set_properties(vec![Property::new("age".to_string(), PropertyValue::PInteger(42))]);
let node_with_id = gr.create_node(&node).unwrap();
gr.sync();
}