Updates - Flaarum Tutorials Python Golang
Updating a row in Flaarum takes a search statement as detailed in the searches tutorial and a dict which would contain the updated values. One can update more than one row at a time
Sample Code
import pyflaarum
cl = pyflaarum.flaacl("127.0.0.1", "not-yet-ready", "first_proj")
try:
cl.ping()
except:
print("error connecting")
to_write = {"userid": 32, "roleid": 14,}
stmt = '''
table: user_roles
where:
userid = 32
'''
try:
rows = cl.update_rows(stmt, to_write)
except pyflaarum.flaa_error as fe:
print("Server error", fe.code, fe.message)
except Exception as e:
print("python error")
print(e.message)