Skip to content

Commit

Permalink
chore: delete old comment-outed code
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshinorin committed Jul 20, 2024
1 parent 6445d56 commit 9658416
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ import doobie.free.connection.ConnectionIO

class DoobieExecuter(tx: Transactor[IO]) extends Executer[ConnectionIO, IO] {

// NOTE: No-need ContextShift: https://typelevel.org/cats-effect/docs/migration-guide#contextshift
// implicit val cs: ContextShift[IO] = IO.contextShift(executionContexts)
// val executors: ExecutorService = Executors.newCachedThreadPool()
// val executionContexts: ExecutionContextExecutor = scala.concurrent.ExecutionContext.fromExecutor(executors)

override def perform[R](c: ContT[doobie.ConnectionIO, R, R]): ConnectionIO[R] = {
c.run { x => x.pure[ConnectionIO] }
}
Expand All @@ -42,16 +37,4 @@ class DoobieExecuter(tx: Transactor[IO]) extends Executer[ConnectionIO, IO] {
} yield r._8
}

/*
implicit final class PerformOps[R](action: Action[R]) {
def perform: ConnectionIO[R] = action match {
case continue: Continue[_, R, ConnectionIO] => continue.request.flatMap { t => continue.next(t).perform }
case done: Done[R] => done.value.pure[ConnectionIO]
}
}
implicit final class TransactOps[T](connectionIO: ConnectionIO[T]) {
def andTransact: IO[T] = connectionIO.transact(transactor)
}
*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,6 @@ trait DoobieTransactor[F[G[_], _]] {

object DoobieTransactor {

/*
given DoobieTransactor: DoobieTransactor[Aux] = {
new DoobieTransactor[Aux] {
override def make(config: DBConfig): Transactor[IO] = {
Transactor.fromDriverManager[IO](
driver = "org.mariadb.jdbc.Driver",
url = config.url,
user = config.user,
password = config.password,
logHandler = None
)
}
}
}
*/

given DoobieTransactor: DoobieTransactor[Aux] = {
new DoobieTransactor[Aux] {
override def make(config: DBConfig): Resource[IO, HikariTransactor[IO]] = {
Expand Down

0 comments on commit 9658416

Please sign in to comment.