-
Notifications
You must be signed in to change notification settings - Fork 351
Open
Labels
apiRelated to library's APIRelated to library's APIbreaking changeIncludes breaking changesIncludes breaking changesbuilt-in dialectRelated to a built-in dialectRelated to a built-in dialectcustom dialectRelated to a custom dialectRelated to a custom dialectenhancementNew feature or requestNew feature or request
Description
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.
kasvith, subframe7536, muniter, HendrixString, jwnx and 13 more
Metadata
Metadata
Assignees
Labels
apiRelated to library's APIRelated to library's APIbreaking changeIncludes breaking changesIncludes breaking changesbuilt-in dialectRelated to a built-in dialectRelated to a built-in dialectcustom dialectRelated to a custom dialectRelated to a custom dialectenhancementNew feature or requestNew feature or request