The birthday mutation selects Ada and adds one to her age. This fragment uses the open database handle db containing the people created earlier. Keep that handle open across the create, query and update steps.

Parse birthdayText with the selected format, build a mutation against the database, and run it. Keep external effects after a successful commit. Then release the mutation as shown.

Give Ada her birthday and retain the commit result

birthdayText holds this document:

dust68 B
query {find  [?e]
       where [[?e name Ada]]}
patch {?e {age 37}}
go292 B
source, err := stardust.Parse(birthdayText, stardust.DUST)
if err != nil {
	return err
}
defer source.Close()

mutation, err := db.Mutation(source)
if err != nil {
	return err
}
defer mutation.Close()

result, err := mutation.Run(nil, stardust.RunOptions{}, nil)
if err != nil {
	return err
}
Result / 105 B
{status       committed
 transaction  5
 facts        1
 committed_at 17928498231804280
 ids          {}}

The commit result reports whether the update committed and how many facts changed. See Queries and mutations for commit results and failures.