MCPcopy Create free account
hub / github.com/RedisGraph/redisgraph-go / ExampleGraphNew_pool

Function ExampleGraphNew_pool

example_graph_test.go:29–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27}
28
29func ExampleGraphNew_pool() {
30 host := "localhost:6379"
31 pool := &redis.Pool{Dial: func() (redis.Conn, error) {
32 return redis.Dial("tcp", host)
33 }}
34
35 graph := redisgraph.GraphNew("social", pool.Get())
36
37 q := "CREATE (w:WorkPlace {name:'RedisLabs'}) RETURN w"
38 res, _ := graph.Query(q)
39
40 res.Next()
41 r := res.Record()
42 w := r.GetByIndex(0).(*redisgraph.Node)
43 fmt.Println(w.Label)
44 // Output: WorkPlace
45
46}
47
48func ExampleGraphNew_tls() {
49 // Consider the following helper methods that provide us with the connection details (host and password)

Callers

nothing calls this directly

Calls 5

GetMethod · 0.80
QueryMethod · 0.80
NextMethod · 0.80
RecordMethod · 0.80
GetByIndexMethod · 0.80

Tested by

no test coverage detected