-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#33: Make execution of function without verification easier #34
base: master
Are you sure you want to change the base?
#33: Make execution of function without verification easier #34
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- pull
- code review
- Integration test run
* new function `getResult` which returns the list of function outputs
balta/src/main/scala/za/co/absa/db/balta/classes/DBFunction.scala
Outdated
Show resolved
Hide resolved
Co-authored-by: miroslavpojer <miroslav.pojer@absa.africa>
balta/src/main/scala/za/co/absa/db/balta/classes/DBFunction.scala
Outdated
Show resolved
Hide resolved
Co-authored-by: miroslavpojer <miroslav.pojer@absa.africa>
…out-verification-easier
JaCoCo 'balta' module code coverage report - scala 2.12.18
|
* @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] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIny
The orderBy
'API' is different in this function and in the execute
function. That I find a little bit confusing from users' point of view. Perhaps as they are sharing similar ideas should have similar APIs.
So I would consider making it default also in def execute[R](orderBy: String)
(such change is backward compatible and also doesn't overwhelm the user thus probably more preferred variant).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I would document / provide an example of orderBy
content, because it's not the full clause (ORDER BY
is already provided on line 88)
DBFunction.perfrom
added, intention to just execute the function without care for result, just the side-effectDBFunction.getResult
which execute the function and returns the list of its outputsNote:
Yes,
getResult
could also have a version to return a Scala case class list, as #13 suggests. But it's beyond the scope of this simple PR.Closes #33