Updates - Flaarum Tutorials Golang Python
Updating a row in Flaarum takes a search statement as detailed in the searches tutorial and a map[string]any which would contain the updated values. One can update more than one row at a time
Sample Code
package main
import (
"github.com/saenuma/flaarum"
)
func main() {
cl := flaarum.NewClient("127.0.0.1", "not-yet-ready", "first_proj")
toUpdate := map[string]any {
"userid": 32,
"roleid": 14,
}
err := cl.UpdateRowsAny(`
table: user_roles
where:
userid = 32
`, toUpdate)
if err != nil {
panic(err)
}
}