Introduction Installation Projects Tables Inserts Searches Updates Deletes Production Installation Conclusion

Deletes - Flaarum Tutorials

Deleting row(s) in Flaarum takes a search statement as detailed in the searches tutorial. One can delete more than one row at a time.

Sample Code

cl := flaarum.NewClient("127.0.0.1", "not-yet-ready", "first_proj")

err := cl.DeleteRows(`
table: user_roles
where:
	userid = 32
	and roleid = 14
`,)

if err != nil {
	panic(err)
}
		

Deleting Fields from a row

This is the act of deleting a field's value. This is like setting a field to null in mysql. It takes a search statement and the fields you want to empty.

cl := flaarum.NewClient("127.0.0.1", "not-yet-ready", "first_proj")

err := cl.DeleteFields(`
table: grade
where:
	userid = 32
`, []string{"remark", "created"})

if err != nil {
	panic(err)
}
		
< Previous Next >