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

generate scalikejdbc-streams methods by mapper-generator #621

Open
xuwei-k opened this issue Jan 4, 2017 · 4 comments
Open

generate scalikejdbc-streams methods by mapper-generator #621

xuwei-k opened this issue Jan 4, 2017 · 4 comments

Comments

@xuwei-k
Copy link
Member

xuwei-k commented Jan 4, 2017

No description provided.

@seratch
Copy link
Member

seratch commented Jan 6, 2017

like stream(where: SQLSyntax): DatabasePublisher[Entity]?

It's ok to have it but we should disable(=comment out) the method by default because scalikejdbc-streams is an optional module.

@yoskhdia
Copy link
Member

yoskhdia commented Jan 6, 2017

If so, does the DB object get inside method?

def stream(where: SQLSyntax): DatabasePublisher[Entity] = {
  DB.readOnlyStream {  // <- use DB ? or NamedDB ? ConnectionPoolContext ? ... ?
    // ...
  }
}

So I suppose that it could do about returning StreamReadySQL like #622.

object Entity extends SQLSyntaxSupport[Entity] {
  import scalikejdbc.streams._
  def streamBy(where: SQLSyntax): StreamReadySQL[Entity] = {
    sql"... $where".iterator()
  }
}

// somewhere
DB readOnlyStream {
  Entity.streamBy(sqls"groupId = 1")
}

and maybe need an option like generator.streams = true.

@xuwei-k
Copy link
Member Author

xuwei-k commented Jan 6, 2017

maybe need an option like generator.streams = true

👍

@seratch
Copy link
Member

seratch commented Jan 6, 2017

@yoskhdia Your idea looks fine. 👍

@seratch seratch added this to the version 5.0.x milestone Jun 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants