Skip to content

Instantly share code, notes, and snippets.

@jczuchnowski
Created August 4, 2019 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jczuchnowski/5eccbe1d03f7838aa0422c7ae2fe12c4 to your computer and use it in GitHub Desktop.
Save jczuchnowski/5eccbe1d03f7838aa0422c7ae2fe12c4 to your computer and use it in GitHub Desktop.
def fromStreamingDBIO[T](dbio: StreamingDBIO[_, T]): ZIO[DatabaseProvider, Throwable, ZStream[Any, Throwable, T]] =
for {
db <- ZIO.accessM[DatabaseProvider](_.databaseProvider.db)
r <- ZIO.effect(db.stream(dbio).toStream())
} yield r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment