From 965841696eade238cb1af34fb7905b8ceda9d75b Mon Sep 17 00:00:00 2001 From: yoshinorin Date: Sun, 21 Jul 2024 00:18:22 +0900 Subject: [PATCH] chore: delete old comment-outed code --- .../db/doobie/DoobieExecuter.scala | 17 ----------------- .../db/doobie/DoobieTransactor.scala | 16 ---------------- 2 files changed, 33 deletions(-) diff --git a/src/main/scala/net/yoshinorin/qualtet/infrastructure/db/doobie/DoobieExecuter.scala b/src/main/scala/net/yoshinorin/qualtet/infrastructure/db/doobie/DoobieExecuter.scala index 4b4471ef..e44a448a 100644 --- a/src/main/scala/net/yoshinorin/qualtet/infrastructure/db/doobie/DoobieExecuter.scala +++ b/src/main/scala/net/yoshinorin/qualtet/infrastructure/db/doobie/DoobieExecuter.scala @@ -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] } } @@ -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) - } - */ } diff --git a/src/main/scala/net/yoshinorin/qualtet/infrastructure/db/doobie/DoobieTransactor.scala b/src/main/scala/net/yoshinorin/qualtet/infrastructure/db/doobie/DoobieTransactor.scala index 226b3ffb..62cbabe7 100644 --- a/src/main/scala/net/yoshinorin/qualtet/infrastructure/db/doobie/DoobieTransactor.scala +++ b/src/main/scala/net/yoshinorin/qualtet/infrastructure/db/doobie/DoobieTransactor.scala @@ -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]] = {