Skip to content

Instantly share code, notes, and snippets.

@searler
Created October 13, 2013 23:25
Show Gist options
  • Save searler/6968493 to your computer and use it in GitHub Desktop.
Save searler/6968493 to your computer and use it in GitHub Desktop.
comment transaction to record side effect
// create attribute to record comment
val comment = Attribute(new Namespace("meta") / "comment", SchemaType.string, Cardinality.one)
Datomic.transact(comment)
// data from txReportQueue
val txr:datomisca.TxReport = ...
// assert "sent email" on all the transactions
Datomic.transact(txr.txData.map{case DDatom(_,_,_,tx,_) => tx}.distinct.
map{id => SchemaEntity.add(FinalId(id))(Props() + (comment-> "sent email"))})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment