copy

open override fun copy(): DatabaseSelectQueryBuilder

Creates and returns a deep copy of this builder. Enables safe creation of query variants from a shared base without modifying the original.

val base = dataAccess.select("*").from("legions").orderBy("name ASC")
val onMarch = base.copy().where("status = 'ON_MARCH'")
val garrisoned = base.copy().where("status = 'GARRISONED'")
// 'base' is unchanged — both variants are independent