Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

benedeki
Copy link
Contributor

@benedeki benedeki commented Sep 11, 2024

  • DBFunction.perfrom added, intention to just execute the function without care for result, just the side-effect
  • new function DBFunction.getResult which execute the function and returns the list of its outputs

Note:
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

lsulak
lsulak previously approved these changes Sep 11, 2024
miroslavpojer
miroslavpojer previously approved these changes Sep 11, 2024
Copy link
Collaborator

@miroslavpojer miroslavpojer left a 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
@benedeki benedeki dismissed stale reviews from miroslavpojer and lsulak via 4484c57 September 11, 2024 09:40
Co-authored-by: miroslavpojer <miroslav.pojer@absa.africa>
Co-authored-by: miroslavpojer <miroslav.pojer@absa.africa>
Copy link

JaCoCo 'balta' module code coverage report - scala 2.12.18

Overall Project 29.81% -0.89% 🍏
Files changed 0% 🍏

File Coverage
DBFunction.scala 0% -6.67% 🍏

* @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] = {
Copy link
Collaborator

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).

Copy link
Collaborator

@lsulak lsulak Oct 1, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

Make execution of function without verification easier
3 participants