knex って then を呼び出したらクエリ実行だから 実行して Promise を取得したいと

knex("table").select("*").then(e => e)

みたいな then が必要ぽい
普通の Promise なら then はなくてもすでに実行済みで 非同期処理が終わって結果が来たら実行するための関数を指定するためにつかうのが then
だからそのまま返すだけの then ならつけなくても一緒
だけど knex は then が実行も兼用してるから then がないと実行されない

knex("table").select("*").execute()

みたいのがあればいいのに

基本的には then で結果を処理すればいいかもだけど 全部終わってから処理したい場合もあるし そのまま返して Promise 化するだけの then が必要になる

const [t1, t2, t3] = await Promise.all([
knex("table1").select("*").then(e => e),
knex("table2").select("*").then(e => e),
knex("table3").select("*").then(e => e),
])

かと言って これをまとめる関数を作るのものなぁ

const execAll = builders => Promise.all(builders.map(e => e.then(x => x)))

const [t1, t2, t3] = await execAll([
knex("table1").select("*"),
knex("table2").select("*"),
knex("table3").select("*"),
])