update
Updates data in the table.
Parameters
builder
A lambda function to build the data to be updated.
Example usage:
val usersTable = database.addTable("users")
.addData(TableData.STRING, "username", TableFlag.PRIMARY_KEY, TableFlag.NON_NULL)
.addData(TableData.STRING, "email", TableFlag.NON_NULL)
.addData(TableData.INT, "age")
database.createTable("users")
usersTable.update {
set("email", "newmail@example.com")
set("age", 25)
where("username = 'john_doe'")
}
Content copied to clipboard
This will update the email
and age
fields in the users
table where the username
equals 'john_doe'.