I am trying to execute an SQL statement at AWS QLDB like the example in the AWS SDK Git but using Kotlin. The example shows me that I can return something at "execute" (represented by "searchValue")
String searchValue = driver.execute(
txn -> {
Result result = txn.execute(searchQuery);
String value = "";
for (IonValue row : result) {
value = ((IonString) row).stringValue();
}
return value;
});
Based on the example, I've tried to receive the return in "executionReturn" and transform the values at "let" function but "executionReturn" cames as undefined.
val executionReturn = driver.execute { txn: TransactionExecutor ->
val result: Result = txn.execute(
"SELECT * FROM Table")
)
result
}
executionReturn.let {
list.plus(it as IonStruct)
}
How could I return a specific value from "driver.execute"?