toTransactionValue
Wraps a known value as a TransactionValue, for a function that takes either a value already there or one an earlier step will produce. A parameter map needs no wrapping.
fun addSeal(plan: TransactionPlan, edictId: TransactionValue<Int>, sealedBy: String) {
plan.add(
db.insertInto("edict_seals").values(listOf("edict_id", "sealed_by"))
.asStep().executeUpdate("edict_id" to edictId, "sealed_by" to sealedBy)
)
}
addSeal(plan, newEdict.value(), "Augustus") // generated by an insert earlier in the plan
addSeal(plan, existingId.toTransactionValue(), "Tiberius") // already thereContent copied to clipboard