Skip to content

Instantly share code, notes, and snippets.

@ryansgot
Last active December 27, 2017 08:31
Show Gist options
  • Save ryansgot/e3f60cfa93c9690a14fd254fd59ac1e3 to your computer and use it in GitHub Desktop.
Save ryansgot/e3f60cfa93c9690a14fd254fd59ac1e3 to your computer and use it in GitHub Desktop.
Basic Forsuredb Upsert Query (android)
SaveResult<Uri> result = ForSure.myTable()
.find() // <-- start narrowing the number of records and columns to update
.byIntColumnBetween(3).andInclusive(10) // <-- set bounds (3, 10]
.and().byNotDeleted() // <-- add additional condition that the record must not be "soft deleted"
.then() // <-- end narrowing number of records and columns to return
.set() // <-- start setting column values to update
.stringColumn("Your int_column value is greater than three and less than or equal to 10")
.save();
System.out.println("Number of records updated: " + result.rowsAffected());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment