DatabaseConnection has a executeQuery method. I believe it will be beneficial to add the plural form as well executeQueries, which receive an array of queries. This should be exposed from kysely class as well.
What is the gain ?
Several dialects ( D1 / Turso ) drivers can use the plural form as intent to run their native batch command, which is a best practice for them. The base class or default implementation in executor shall have a uniform implementation of:
async executeQueries<R>(
compiledQueries: CompiledQuery[],
queriesIds: QueryId[],
): Promise<QueryResult<R>[]> {
const results = []
for(let ix = 0; ix < compiledQueries.length; ix++) {
results.push(
await this.executeQuery(compiledQueries[ix], queriesIds[ix])
);
}
return results;
}
Then, other dialects can override this behavior in the driver level, is this too much to ask for ? It seems like an easy win with no cost to me :)
BTW, Drizzle has recognized this issue and supports it for al the mentioned databases above.
DatabaseConnectionhas aexecuteQuerymethod. I believe it will be beneficial to add the plural form as wellexecuteQueries, which receive an array of queries. This should be exposed fromkyselyclass as well.What is the gain ?
Several dialects (
D1/Turso) drivers can use the plural form as intent to run their nativebatchcommand, which is a best practice for them. The base class or default implementation in executor shall have a uniform implementation of:Then, other dialects can override this behavior in the driver level, is this too much to ask for ? It seems like an easy win with no cost to me :)
BTW, Drizzle has recognized this issue and supports it for al the mentioned databases above.