simplefile

package
v0.0.0-...-af33e7b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2023 License: BSD-3-Clause, MIT Imports: 5 Imported by: 0

Documentation

Overview

Package simplefile for a simple file backed DatabaseService.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDb

func NewDb(name string, options map[string][]string) (service *databaseService, err error)

NewDb creates a DB instance of a simple file backed graph DB

Example
db, _ := NewDb("test", nil)

nodeA := db.NewNode()
nodeA.SetProperty("foo", "bar")

nodeB := db.NewNode()

fmt.Println("nodes: ", nodeA, nodeB)

relAB := nodeA.RelateTo(nodeB, "BELONGS_TO")

fmt.Println("relation: ", relAB)

path := db.FindPath(nodeA, nodeB)

fmt.Println("path: ", path)

nodeC := db.NewNode("A")

nodeB.RelateTo(nodeC, "BELONGS_TO")

path = db.FindPath(nodeA, nodeC)

fmt.Println("path: ", path)
Output:

nodes:  (0 {foo:"bar",}) (1)
relation:  (0 {foo:"bar",})-[:BELONGS_TO]->(1)
path:  (0 {foo:"bar",})-[:BELONGS_TO]->(1)
path:  (0 {foo:"bar",})-[:BELONGS_TO]->(1)-[:BELONGS_TO]->(2:A)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL