Skip to content

ReshiAdavan/LevaunaDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LevaunaDB

Developed in R*** [Redacted due to policy] and implemented by a Gremlin inspired traversal language.

Inspiration

Graph architectures have become increasingly popular in software design - databases, query languages, machine learning, etc. Neo4j and GraphQL are great examples. I wanted to see the hype myself but instead by implementing it myself and seeing how things work behind the scenes.

I'll probably do the same for relational databases via B+ trees since im on the topic of creating small-scale databases.

Sample

let mut graph = Graph::new();

let v1 = graph.add_vertex(hashmap!{
    "name".into() => Value::String("foo".into()),
    "type".into() => Value::String("banana".into())
}).unwrap();

let v2 = graph.add_vertex(hashmap!{
    "name".into() => Value::String("bar".into()),
    "type".into() => Value::String("orange".into())
}).unwrap();

graph.add_edge(v1, v2, "fruitier".into(), hashmap!{});

let mut q = Query::new(&graph, VertexFilter::Id(v1));
let out = q.out(EdgeFilter::None).run();

assert_eq!(out, vec![QueryResult::Vertex(v2)]);

Testing files for the DB are in tests

Skills

Small disclaimer this DB does use hashmaps BUT for the purpose of creating a graph.

  • R*** [Redacted due to policy]
  • Graphs/Hashmaps, Traversals
  • Gremlin (Traversal Query Languages)

Dependencies

  • maplit = "0.1.4"

Releases

No releases published

Packages

No packages published

Languages