Skip to content

Commit

Permalink
* the new execute renamed to perform
Browse files Browse the repository at this point in the history
* new function `getResult` which returns the list of function outputs
  • Loading branch information
benedeki committed Sep 11, 2024
1 parent 10801f6 commit 4484c57
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions balta/src/main/scala/za/co/absa/db/balta/classes/DBFunction.scala
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,23 @@ sealed abstract class DBFunction private(functionName: String,
}

/**
* Executes the function.
* Executes the function without caring about the result. The goal is the side-effect of the function.
* @param connection - the database connection
*/
def execute()(implicit connection: DBConnection): Unit = {
def perform()(implicit connection: DBConnection): Unit = {
execute("")(_ => ())
}

/**
* Executes the function without any verification proceudre. It instantiate the function result(s) and return them in
* a list.
* @param orderBy - the clause how to order the function result, if empty, default ordering is preserved
* @param connection - the database connection
*/
def getResult(orderBy: String = "")(implicit connection: DBConnection): List[QueryResultRow] = {
execute("")(_.toList)
}

/**
* Executes the function and verifies the result via the verify function.
*
Expand Down

0 comments on commit 4484c57

Please sign in to comment.