I am having some issues with deleting rows.
Some of the code:
` conInfo, err := griddb_go.CreateContainerInfo("Users",
[][]interface{}{
{"username", griddb_go.TYPE_STRING},
{"email", griddb_go.TYPE_STRING},
{"password", griddb_go.TYPE_BLOB}},
griddb_go.CONTAINER_COLLECTION,
true)
if err != nil {
fmt.Println("Create containerInfo failed")
}
col, err := gridstore.PutContainer(conInfo, true)
if err != nil {
fmt.Println("put container failed")
}
query, err := col.Query(fmt.Sprintf("SELECT * WHERE username='%s'", username))
if err != nil {
fmt.Println("create query failed")
}
rs, err := query.Fetch(false)
if err != nil {
fmt.Println("create rs from query failed")
}
col.SetAutoCommit(false)
if rs.HasNext() {
rrow, err := rs.NextRow()
if err != nil {
fmt.Println("Error retrieving row")
}
//deletes user
col.Remove(rrow[0])
col.Commit()
} else {
fmt.Println("error. Has Next Failed")
}`
This is hooked up to a webpage and is triggered when a button is pressed. But the issue is, sometimes it deletes, sometimes it doesn't.
I am having some issues with deleting rows.
Some of the code:
` conInfo, err := griddb_go.CreateContainerInfo("Users",
[][]interface{}{
{"username", griddb_go.TYPE_STRING},
{"email", griddb_go.TYPE_STRING},
{"password", griddb_go.TYPE_BLOB}},
griddb_go.CONTAINER_COLLECTION,
true)
if err != nil {
fmt.Println("Create containerInfo failed")
}
col, err := gridstore.PutContainer(conInfo, true)
if err != nil {
fmt.Println("put container failed")
}
This is hooked up to a webpage and is triggered when a button is pressed. But the issue is, sometimes it deletes, sometimes it doesn't.