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

Feature request: foreach method in CodeGenerator #1196

Open
david-bouyssie opened this issue Apr 9, 2021 · 2 comments
Open

Feature request: foreach method in CodeGenerator #1196

david-bouyssie opened this issue Apr 9, 2021 · 2 comments

Comments

@david-bouyssie
Copy link

Currently the CodeGenerator provides utility methods such as findBy/findAll.
It would be great to provide a method such as:

def foreach(where: SQLSyntax)(item: ${className} => Unit)(implicit session: DBSession$defaultAutoSession): Unit = {
  sql"select xxx where $${where}".foreach { record => item(record) }
}
@seratch
Copy link
Member

seratch commented Jun 12, 2021

Thanks for the suggestion. Indeed, this may be useful for some!

@seratch seratch added this to the version 4.1.x milestone Jun 12, 2021
@AndySakov
Copy link

Anyone wanna work on this?
If no one is, I'd like to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants