Skip to content

Instantly share code, notes, and snippets.

@ryansgot
Last active December 27, 2017 08:21
Show Gist options
  • Save ryansgot/71734f06c59358f1a099cbbb5080d26a to your computer and use it in GitHub Desktop.
Save ryansgot/71734f06c59358f1a099cbbb5080d26a to your computer and use it in GitHub Desktop.
Basic Forsuredb Create (insert) query android
SaveResult<Uri> result = Forsuredb.myTable() // <-- the generated ForSure class serves as your entrypoint
.set() // <-- enter insert/update/delete portion of query
.stringColumn("My String") // <-- set the value of the column
.intColumn(42) // <-- column value setters are typesafe
.save(); // <-- performs the insertion and sends back a SaveResult
Uri inserted = result.inserted(); // <-- SaveResult contains a locator for the inserted record
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment