Skip to content

Commit

Permalink
fixed missing WithNeo calls
Browse files Browse the repository at this point in the history
  • Loading branch information
erictg committed Sep 18, 2019
1 parent 6890cea commit 7d18374
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion decoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestDecode(t *testing.T){
if err != nil {
require.Nil(t, err)
}
driverPool.Reclaim(conn)
defer driverPool.Reclaim(conn)


rows, err := dsl.QB().WithNeo(conn).Cypher(query).Query(nil)
Expand Down
2 changes: 1 addition & 1 deletion delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestDelete(t *testing.T){
if err != nil {
require.Nil(t, err)
}
driverPool.Reclaim(conn)
defer driverPool.Reclaim(conn)

del := a{
Id: 0,
Expand Down
6 changes: 4 additions & 2 deletions save.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func saveDepth(sess *driver.BoltConn, obj interface{}, depth int) error {
return relateNodes(sess, relations, ids)
}

func createNodes(sess *driver.BoltConn, crNodes map[string]map[string]nodeCreateConf) (map[string]int64, error){
func createNodes(conn *driver.BoltConn, crNodes map[string]map[string]nodeCreateConf) (map[string]int64, error){
idMap := map[string]int64{}

for label, nodes := range crNodes{
Expand Down Expand Up @@ -124,6 +124,7 @@ func createNodes(sess *driver.BoltConn, crNodes map[string]map[string]nodeCreate
},
Alias: "id",
}).
WithNeo(conn).
Query(map[string]interface{}{
"rows": rows,
})
Expand Down Expand Up @@ -157,7 +158,7 @@ func createNodes(sess *driver.BoltConn, crNodes map[string]map[string]nodeCreate
return idMap, nil
}

func relateNodes(sess *driver.BoltConn, relations map[string][]relCreateConf, ids map[string]int64) error{
func relateNodes(conn *driver.BoltConn, relations map[string][]relCreateConf, ids map[string]int64) error{
if relations == nil || len(relations) == 0{
return errors.New("relations can not be nil or empty")
}
Expand Down Expand Up @@ -245,6 +246,7 @@ func relateNodes(sess *driver.BoltConn, relations map[string][]relCreateConf, id
Path: mergePath,
}).
Cypher("SET rel += row.props").
WithNeo(conn).
Exec(map[string]interface{}{
"rows": params,
})
Expand Down
2 changes: 1 addition & 1 deletion save_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func TestSave(t *testing.T){
if err != nil {
require.Nil(t, err)
}
driverPool.Reclaim(conn)
defer driverPool.Reclaim(conn)

req.Nil(saveDepth(conn, comp2, defaultSaveDepth))
}

0 comments on commit 7d18374

Please sign in to comment.