spread
Spreads this map into parameters under its own keys. The name it was filed under is only a placeholder and is not bound.
val original = plan.add(
db.select("title", "tribute", "province").from("edicts").where("id = @id")
.asStep().fetchObjectStrict<Map<String, Any?>>("id" to id)
)
plan.add(
db.insertInto("edict_archive").values(listOf("title", "tribute", "province"))
.asStep().executeUpdate("anything" to original.value().spread())
)Content copied to clipboard
@title, @tribute and @province are bound; @anything is not. To drop or overwrite an entry, map before the spread: map { it - "id" + ("archived_at" to now) }. A nullable map, from fetchObject, has to be made non-null first: map { it ?: emptyMap() }.