普通にmysql2にformat関数があった。
import { format } from "mysql2";
const upd = await db
.updateTable("article")
.where("article.id", "=", 1)
.set({ title: "exampleTitle" })
.compile();
const formatted = format(upd.sql, upd.parameters);
// update `article` set `title` = 'exampleTitle' where `article`.`id` = 1