spread
Marks this map to be spread into parameters of its own rather than assigned to one.
Its entries become parameters under their own keys, and the name it was filed under is dropped: that name is a placeholder, there because a map of parameters needs a key, and nothing binds it. A whole row goes into the next step this way without naming a parameter per column.
The map comes from a fetchObject* terminal, which treats a row as a record like any other. That is where the columns' type is chosen: Map<String, Any?> asks the result converters what each column is, and anything narrower asks them for that instead.
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().update("anything" to original.value().spread())
)@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 map that might not be there is not one of these: fetchObject returns Map<String, Any?>? and does not spread, so what an absent row contributes is said in a map first - map { it ?: emptyMap() }.
Return
The value, marked for spreading.