Commit creates the entire graph, but will re-add nodes if called again.
()
| 90 | |
| 91 | // Commit creates the entire graph, but will re-add nodes if called again. |
| 92 | func (g *Graph) Commit() (*QueryResult, error) { |
| 93 | items := make([]string, 0, len(g.Nodes)+len(g.Edges)) |
| 94 | for _, n := range g.Nodes { |
| 95 | items = append(items, n.Encode()) |
| 96 | } |
| 97 | for _, e := range g.Edges { |
| 98 | items = append(items, e.Encode()) |
| 99 | } |
| 100 | q := "CREATE " + strings.Join(items, ",") |
| 101 | return g.Query(q) |
| 102 | } |
| 103 | |
| 104 | // NewQueryOptions instantiates a new QueryOptions struct. |
| 105 | func NewQueryOptions() *QueryOptions { |