Skip to content

Commit

Permalink
Extract the value in async transactions only
Browse files Browse the repository at this point in the history
  • Loading branch information
hfhbd committed Jul 15, 2023
1 parent d9d8329 commit 72b6bb3
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,11 @@ abstract class QueryGenerator(
}
}

// Extract value from the result of a grouped statement
if (isNamedQuery && query.statement is SqlDelightStmtClojureStmtList) {
// Extract value from the result of a grouped statement in async,
// because the transaction is put in an QueryResult.AsyncValue block.
if (generateAsync && isNamedQuery && query.statement is SqlDelightStmtClojureStmtList) {
binder += "%L"
if (generateAsync) {
arguments.add(".await()")
} else {
arguments.add(".value")
}
arguments.add(".await()")
}

val statementId = if (needsFreshStatement) CodeBlock.of("null") else CodeBlock.of("%L", id)
Expand Down

0 comments on commit 72b6bb3

Please sign in to comment.