def _update(self, tree):
tablename = tree.table<EOL>table = self.describe(tablename, require=True)<EOL>kwargs = {}<EOL>if tree.returns:<EOL><INDENT>kwargs["<STR_LIT>"] = "<STR_LIT:_>".join(tree.returns)<EOL><DEDENT>else:<EOL><INDENT>kwargs["<STR_LIT>"] = "<STR_LIT>"<EOL><DEDENT>visitor = Visitor(self.reserved_words)<EOL>updates = UpdateExpression.from_update(tree.update)<EOL>kwargs["<STR_LIT>"] = updates.build(visitor)<EOL>if tree.where:<EOL><INDENT>constraints = ConstraintExpression.from_where(tree.where)<EOL>kwargs["<STR_LIT>"] = constraints.build(visitor)<EOL><DEDENT>kwargs["<STR_LIT>"] = visitor.expression_values<EOL>kwargs["<STR_LIT>"] = visitor.attribute_names<EOL>return self._query_and_op(tree, table, "<STR_LIT>", kwargs)<EOL>
Run an UPDATE statement