Skip to content

Instantly share code, notes, and snippets.

@kitz99
Last active June 22, 2018 09:10
Show Gist options
  • Save kitz99/f7630fe0b5c7a95b8e642959acaf47ae to your computer and use it in GitHub Desktop.
Save kitz99/f7630fe0b5c7a95b8e642959acaf47ae to your computer and use it in GitHub Desktop.
func updateRecord(fieldName string, newVal string, condFieldName string, condFieldValue int64) error {
qryString := fmt.Sprintf("UPDATE posts set %s='%s' WHERE %s=%d", fieldName, newVal, condFieldName, condFieldValue)
fmt.Printf("Query: %v\n", qryString)
_, err := roachConnection.Exec(qryString)
return err
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment