diff --git a/src/main/scala/net/yoshinorin/qualtet/Modules.scala b/src/main/scala/net/yoshinorin/qualtet/Modules.scala index 90194a7c..fe87aba4 100644 --- a/src/main/scala/net/yoshinorin/qualtet/Modules.scala +++ b/src/main/scala/net/yoshinorin/qualtet/Modules.scala @@ -44,7 +44,7 @@ import net.yoshinorin.qualtet.http.routes.v1.{ TagRoute => TagRouteV1 } import net.yoshinorin.qualtet.infrastructure.db.Migrator -import net.yoshinorin.qualtet.infrastructure.db.doobie.DoobieTransactor +import net.yoshinorin.qualtet.infrastructure.db.doobie.DoobieExecuter import pdi.jwt.JwtAlgorithm import java.security.SecureRandom @@ -55,7 +55,7 @@ object Modules { val config = ApplicationConfig.load given log4catsLogger: Log4CatsLoggerFactory[IO] = Log4CatsSlf4jFactory.create[IO] - given dbContext: DoobieTransactor = new DoobieTransactor(config.db) + given dbContext: DoobieExecuter = new DoobieExecuter(config.db) val migrator: Migrator = new Migrator(config.db) // NOTE: for generate JWT. They are reset when re-boot application. diff --git a/src/main/scala/net/yoshinorin/qualtet/domains/archives/ArchiveService.scala b/src/main/scala/net/yoshinorin/qualtet/domains/archives/ArchiveService.scala index bb24a222..2a0f3e90 100644 --- a/src/main/scala/net/yoshinorin/qualtet/domains/archives/ArchiveService.scala +++ b/src/main/scala/net/yoshinorin/qualtet/domains/archives/ArchiveService.scala @@ -5,7 +5,7 @@ import net.yoshinorin.qualtet.actions.Action.* import net.yoshinorin.qualtet.actions.{Action, Continue} import net.yoshinorin.qualtet.domains.contentTypes.ContentTypeService import net.yoshinorin.qualtet.message.Fail.NotFound -import net.yoshinorin.qualtet.infrastructure.db.Transactor +import net.yoshinorin.qualtet.infrastructure.db.Executer import net.yoshinorin.qualtet.domains.contentTypes.ContentTypeId import net.yoshinorin.qualtet.syntax.* import cats.Monad @@ -13,7 +13,7 @@ import cats.Monad class ArchiveService[F[_]: Monad]( archiveRepository: ArchiveRepository[F], contentTypeService: ContentTypeService[F] -)(using transactor: Transactor[F, IO]) { +)(using transactor: Executer[F, IO]) { def actions(contentTypeId: ContentTypeId): Action[Seq[ResponseArchive]] = { Continue(archiveRepository.get(contentTypeId), Action.done[Seq[ResponseArchive]]) diff --git a/src/main/scala/net/yoshinorin/qualtet/domains/articles/ArticleService.scala b/src/main/scala/net/yoshinorin/qualtet/domains/articles/ArticleService.scala index 8144f47a..0e0a2fc0 100644 --- a/src/main/scala/net/yoshinorin/qualtet/domains/articles/ArticleService.scala +++ b/src/main/scala/net/yoshinorin/qualtet/domains/articles/ArticleService.scala @@ -9,13 +9,13 @@ import net.yoshinorin.qualtet.message.Fail.NotFound import net.yoshinorin.qualtet.domains.tags.TagName import net.yoshinorin.qualtet.domains.series.SeriesName import net.yoshinorin.qualtet.http.ArticlesQueryParameter -import net.yoshinorin.qualtet.infrastructure.db.Transactor +import net.yoshinorin.qualtet.infrastructure.db.Executer import net.yoshinorin.qualtet.syntax.* class ArticleService[F[_]: Monad]( articleRepository: ArticleRepository[F], contentTypeService: ContentTypeService[F] -)(using transactor: Transactor[F, IO]) { +)(using transactor: Executer[F, IO]) { def actions( contentTypeId: ContentTypeId, diff --git a/src/main/scala/net/yoshinorin/qualtet/domains/authors/AuthorService.scala b/src/main/scala/net/yoshinorin/qualtet/domains/authors/AuthorService.scala index 71b92fb4..8e49fac7 100644 --- a/src/main/scala/net/yoshinorin/qualtet/domains/authors/AuthorService.scala +++ b/src/main/scala/net/yoshinorin/qualtet/domains/authors/AuthorService.scala @@ -3,14 +3,14 @@ package net.yoshinorin.qualtet.domains.authors import cats.effect.IO import cats.Monad import net.yoshinorin.qualtet.message.Fail.InternalServerError -import net.yoshinorin.qualtet.infrastructure.db.Transactor +import net.yoshinorin.qualtet.infrastructure.db.Executer import net.yoshinorin.qualtet.actions.Action.* import net.yoshinorin.qualtet.actions.{Action, Continue} import net.yoshinorin.qualtet.syntax.* class AuthorService[F[_]: Monad]( authorRepository: AuthorRepository[F] -)(using transactor: Transactor[F, IO]) { +)(using transactor: Executer[F, IO]) { def upsertActions(data: Author): Action[Int] = { Continue(authorRepository.upsert(data), Action.done[Int]) diff --git a/src/main/scala/net/yoshinorin/qualtet/domains/contentTaggings/ContentTaggingService.scala b/src/main/scala/net/yoshinorin/qualtet/domains/contentTaggings/ContentTaggingService.scala index 2df17654..fc351076 100644 --- a/src/main/scala/net/yoshinorin/qualtet/domains/contentTaggings/ContentTaggingService.scala +++ b/src/main/scala/net/yoshinorin/qualtet/domains/contentTaggings/ContentTaggingService.scala @@ -6,11 +6,11 @@ import net.yoshinorin.qualtet.actions.Action.* import net.yoshinorin.qualtet.actions.{Action, Continue} import net.yoshinorin.qualtet.domains.contents.ContentId import net.yoshinorin.qualtet.domains.tags.TagId -import net.yoshinorin.qualtet.infrastructure.db.Transactor +import net.yoshinorin.qualtet.infrastructure.db.Executer class ContentTaggingService[F[_]: Monad]( contentTaggingRepository: ContentTaggingRepository[F] -)(using transactor: Transactor[F, IO]) { +)(using transactor: Executer[F, IO]) { def findByTagIdActions(id: TagId): Action[Seq[ContentTagging]] = { Continue(contentTaggingRepository.findByTagId(id), Action.done[Seq[ContentTagging]]) diff --git a/src/main/scala/net/yoshinorin/qualtet/domains/contentTypes/ContentTypeService.scala b/src/main/scala/net/yoshinorin/qualtet/domains/contentTypes/ContentTypeService.scala index 54dd1cc5..58881f7c 100644 --- a/src/main/scala/net/yoshinorin/qualtet/domains/contentTypes/ContentTypeService.scala +++ b/src/main/scala/net/yoshinorin/qualtet/domains/contentTypes/ContentTypeService.scala @@ -7,13 +7,13 @@ import net.yoshinorin.qualtet.actions.Action.* import net.yoshinorin.qualtet.actions.{Action, Continue} import net.yoshinorin.qualtet.message.Fail.InternalServerError import net.yoshinorin.qualtet.domains.Cacheable -import net.yoshinorin.qualtet.infrastructure.db.Transactor +import net.yoshinorin.qualtet.infrastructure.db.Executer import net.yoshinorin.qualtet.syntax.* class ContentTypeService[F[_]: Monad]( contentRepository: ContentTypeRepository[F], cache: CacheModule[String, ContentType] -)(using transactor: Transactor[F, IO]) +)(using transactor: Executer[F, IO]) extends Cacheable { def upsertActions(data: ContentType): Action[Int] = { diff --git a/src/main/scala/net/yoshinorin/qualtet/domains/contents/ContentService.scala b/src/main/scala/net/yoshinorin/qualtet/domains/contents/ContentService.scala index b72b089c..1e1f9fe4 100644 --- a/src/main/scala/net/yoshinorin/qualtet/domains/contents/ContentService.scala +++ b/src/main/scala/net/yoshinorin/qualtet/domains/contents/ContentService.scala @@ -14,7 +14,7 @@ import net.yoshinorin.qualtet.domains.contentTaggings.{ContentTagging, ContentTa import net.yoshinorin.qualtet.domains.robots.{Attributes, Robots, RobotsService} import net.yoshinorin.qualtet.domains.tags.{Tag, TagId, TagName, TagService} import net.yoshinorin.qualtet.domains.series.{Series, SeriesName, SeriesService} -import net.yoshinorin.qualtet.infrastructure.db.Transactor +import net.yoshinorin.qualtet.infrastructure.db.Executer import net.yoshinorin.qualtet.syntax.* class ContentService[F[_]: Monad]( @@ -28,7 +28,7 @@ class ContentService[F[_]: Monad]( seriesService: SeriesService[F], contentSerializingService: ContentSerializingService[F] )(using - transactor: Transactor[F, IO] + transactor: Executer[F, IO] ) { def upsertActions(data: Content): Action[Int] = { diff --git a/src/main/scala/net/yoshinorin/qualtet/domains/search/SearchService.scala b/src/main/scala/net/yoshinorin/qualtet/domains/search/SearchService.scala index 2bbbee2b..8524710a 100644 --- a/src/main/scala/net/yoshinorin/qualtet/domains/search/SearchService.scala +++ b/src/main/scala/net/yoshinorin/qualtet/domains/search/SearchService.scala @@ -6,7 +6,7 @@ import cats.implicits.* import net.yoshinorin.qualtet.actions.Action.* import net.yoshinorin.qualtet.actions.{Action, Continue} import net.yoshinorin.qualtet.config.SearchConfig -import net.yoshinorin.qualtet.infrastructure.db.Transactor +import net.yoshinorin.qualtet.infrastructure.db.Executer import net.yoshinorin.qualtet.message.Fail.UnprocessableEntity import net.yoshinorin.qualtet.message.{Error => Err} import net.yoshinorin.qualtet.types.Points @@ -17,7 +17,7 @@ import scala.annotation.tailrec class SearchService[F[_]: Monad]( searchConfig: SearchConfig, searchRepository: SearchRepository[F] -)(using transactor: Transactor[F, IO]) { +)(using transactor: Executer[F, IO]) { def actions(query: List[String]): Action[Seq[(Int, ResponseSearch)]] = { Continue(searchRepository.search(query), Action.done[Seq[(Int, ResponseSearch)]]) diff --git a/src/main/scala/net/yoshinorin/qualtet/domains/series/SeriesService.scala b/src/main/scala/net/yoshinorin/qualtet/domains/series/SeriesService.scala index 7a5eef1e..08d3a2ef 100644 --- a/src/main/scala/net/yoshinorin/qualtet/domains/series/SeriesService.scala +++ b/src/main/scala/net/yoshinorin/qualtet/domains/series/SeriesService.scala @@ -5,7 +5,7 @@ import cats.Monad import net.yoshinorin.qualtet.actions.Action.* import net.yoshinorin.qualtet.actions.{Action, Continue} import net.yoshinorin.qualtet.domains.articles.ArticleService -import net.yoshinorin.qualtet.infrastructure.db.Transactor +import net.yoshinorin.qualtet.infrastructure.db.Executer import net.yoshinorin.qualtet.message.Fail.NotFound import net.yoshinorin.qualtet.syntax.* import wvlet.airframe.ulid.ULID @@ -13,7 +13,7 @@ import wvlet.airframe.ulid.ULID class SeriesService[F[_]: Monad]( seriesRepository: SeriesRepository[F], articleService: ArticleService[F] -)(using transactor: Transactor[F, IO]) { +)(using transactor: Executer[F, IO]) { def upsertActions(data: Series): Action[Int] = { Continue(seriesRepository.upsert(data), Action.done[Int]) diff --git a/src/main/scala/net/yoshinorin/qualtet/domains/sitemaps/SitemapService.scala b/src/main/scala/net/yoshinorin/qualtet/domains/sitemaps/SitemapService.scala index 19e454b9..2f9cf367 100644 --- a/src/main/scala/net/yoshinorin/qualtet/domains/sitemaps/SitemapService.scala +++ b/src/main/scala/net/yoshinorin/qualtet/domains/sitemaps/SitemapService.scala @@ -5,13 +5,13 @@ import cats.Monad import net.yoshinorin.qualtet.actions.Action.* import net.yoshinorin.qualtet.actions.{Action, Continue} import net.yoshinorin.qualtet.cache.CacheModule -import net.yoshinorin.qualtet.infrastructure.db.Transactor +import net.yoshinorin.qualtet.infrastructure.db.Executer import net.yoshinorin.qualtet.domains.Cacheable class SitemapService[F[_]: Monad]( sitemapRepository: SitemapsRepository[F], cache: CacheModule[String, Seq[Url]] -)(using transactor: Transactor[F, IO]) +)(using transactor: Executer[F, IO]) extends Cacheable { private val cacheKey = "sitemaps-full-cache" diff --git a/src/main/scala/net/yoshinorin/qualtet/domains/tags/TagService.scala b/src/main/scala/net/yoshinorin/qualtet/domains/tags/TagService.scala index 76b7f910..62b7d438 100644 --- a/src/main/scala/net/yoshinorin/qualtet/domains/tags/TagService.scala +++ b/src/main/scala/net/yoshinorin/qualtet/domains/tags/TagService.scala @@ -6,7 +6,7 @@ import cats.implicits.* import net.yoshinorin.qualtet.actions.Action.* import net.yoshinorin.qualtet.actions.{Action, Continue} import net.yoshinorin.qualtet.domains.contentTaggings.ContentTaggingService -import net.yoshinorin.qualtet.infrastructure.db.Transactor +import net.yoshinorin.qualtet.infrastructure.db.Executer import net.yoshinorin.qualtet.message.Fail.NotFound import net.yoshinorin.qualtet.domains.contents.ContentId import net.yoshinorin.qualtet.syntax.* @@ -14,7 +14,7 @@ import net.yoshinorin.qualtet.syntax.* class TagService[F[_]: Monad]( tagRepository: TagRepository[F], contentTaggingService: ContentTaggingService[F] -)(using transactor: Transactor[F, IO]) { +)(using transactor: Executer[F, IO]) { def bulkUpsertActions(data: Option[List[Tag]]): Action[Int] = { data match { diff --git a/src/main/scala/net/yoshinorin/qualtet/infrastructure/db/Transactor.scala b/src/main/scala/net/yoshinorin/qualtet/infrastructure/db/Executer.scala similarity index 92% rename from src/main/scala/net/yoshinorin/qualtet/infrastructure/db/Transactor.scala rename to src/main/scala/net/yoshinorin/qualtet/infrastructure/db/Executer.scala index d76da671..59ea6d6a 100644 --- a/src/main/scala/net/yoshinorin/qualtet/infrastructure/db/Transactor.scala +++ b/src/main/scala/net/yoshinorin/qualtet/infrastructure/db/Executer.scala @@ -3,7 +3,7 @@ package net.yoshinorin.qualtet.infrastructure.db import cats.Monad import net.yoshinorin.qualtet.actions.Action -trait Transactor[F[_], G[_]: Monad] { +trait Executer[F[_], G[_]: Monad] { def perform[R](a: Action[R]): F[R] def transact[T](t: F[T]): G[T] def transact[R](a: Action[R]): G[R] diff --git a/src/main/scala/net/yoshinorin/qualtet/infrastructure/db/doobie/DoobieTransactor.scala b/src/main/scala/net/yoshinorin/qualtet/infrastructure/db/doobie/DoobieExecuter.scala similarity index 94% rename from src/main/scala/net/yoshinorin/qualtet/infrastructure/db/doobie/DoobieTransactor.scala rename to src/main/scala/net/yoshinorin/qualtet/infrastructure/db/doobie/DoobieExecuter.scala index 075583a6..89e637b6 100644 --- a/src/main/scala/net/yoshinorin/qualtet/infrastructure/db/doobie/DoobieTransactor.scala +++ b/src/main/scala/net/yoshinorin/qualtet/infrastructure/db/doobie/DoobieExecuter.scala @@ -10,9 +10,9 @@ import cats.effect.* import cats.effect.IO import net.yoshinorin.qualtet.actions.{Action, Continue, Done} import net.yoshinorin.qualtet.config.DBConfig -import net.yoshinorin.qualtet.infrastructure.db.Transactor +import net.yoshinorin.qualtet.infrastructure.db.Executer -class DoobieTransactor(config: DBConfig) extends Transactor[ConnectionIO, IO] { +class DoobieExecuter(config: DBConfig) extends Executer[ConnectionIO, IO] { val executors: ExecutorService = Executors.newCachedThreadPool() val executionContexts: ExecutionContextExecutor = scala.concurrent.ExecutionContext.fromExecutor(executors) diff --git a/src/main/scala/net/yoshinorin/qualtet/tasks/CreateAuthor.scala b/src/main/scala/net/yoshinorin/qualtet/tasks/CreateAuthor.scala index f8941365..2deac733 100644 --- a/src/main/scala/net/yoshinorin/qualtet/tasks/CreateAuthor.scala +++ b/src/main/scala/net/yoshinorin/qualtet/tasks/CreateAuthor.scala @@ -6,7 +6,7 @@ import doobie.ConnectionIO import org.slf4j.LoggerFactory import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder import net.yoshinorin.qualtet.domains.authors.{Author, AuthorDisplayName, AuthorName, AuthorRepository, AuthorService, BCryptPassword} -import net.yoshinorin.qualtet.infrastructure.db.doobie.DoobieTransactor +import net.yoshinorin.qualtet.infrastructure.db.doobie.DoobieExecuter import net.yoshinorin.qualtet.Modules.* import net.yoshinorin.qualtet.syntax.* import net.yoshinorin.qualtet.domains.authors.ResponseAuthor @@ -17,7 +17,7 @@ object CreateAuthor { private val logger = LoggerFactory.getLogger(this.getClass) - given dbContext: DoobieTransactor = new DoobieTransactor(config.db) + given dbContext: DoobieExecuter = new DoobieExecuter(config.db) val authorRepository: AuthorRepository[ConnectionIO] = summon[AuthorRepository[ConnectionIO]] val authorService = new AuthorService(authorRepository) diff --git a/src/test/scala/net/yoshinorin/qualtet/auth/AuthServiceSpec.scala b/src/test/scala/net/yoshinorin/qualtet/auth/AuthServiceSpec.scala index 9fcf86fa..47f130ca 100644 --- a/src/test/scala/net/yoshinorin/qualtet/auth/AuthServiceSpec.scala +++ b/src/test/scala/net/yoshinorin/qualtet/auth/AuthServiceSpec.scala @@ -5,14 +5,14 @@ import net.yoshinorin.qualtet.domains.authors.ResponseAuthor import net.yoshinorin.qualtet.message.Fail.{NotFound, Unauthorized} import net.yoshinorin.qualtet.Modules.* import net.yoshinorin.qualtet.fixture.Fixture.* -import net.yoshinorin.qualtet.infrastructure.db.doobie.DoobieTransactor +import net.yoshinorin.qualtet.infrastructure.db.doobie.DoobieExecuter import org.scalatest.wordspec.AnyWordSpec import cats.effect.unsafe.implicits.global // testOnly net.yoshinorin.qualtet.auth.AuthServiceSpec class AuthServiceSpec extends AnyWordSpec { - given dbContext: DoobieTransactor = new DoobieTransactor(config.db) + given dbContext: DoobieExecuter = new DoobieExecuter(config.db) val a: ResponseAuthor = authorService.findByName(author.name).unsafeRunSync().get val a2: ResponseAuthor = authorService.findByName(author2.name).unsafeRunSync().get diff --git a/src/test/scala/net/yoshinorin/qualtet/domains/contentSerializing/ContentSerializingServiceSpec.scala b/src/test/scala/net/yoshinorin/qualtet/domains/contentSerializing/ContentSerializingServiceSpec.scala index f3789eac..1e24f37a 100644 --- a/src/test/scala/net/yoshinorin/qualtet/domains/contentSerializing/ContentSerializingServiceSpec.scala +++ b/src/test/scala/net/yoshinorin/qualtet/domains/contentSerializing/ContentSerializingServiceSpec.scala @@ -4,7 +4,7 @@ import net.yoshinorin.qualtet.domains.contents.{Path, RequestContent} import net.yoshinorin.qualtet.domains.robots.Attributes import net.yoshinorin.qualtet.domains.series.* import net.yoshinorin.qualtet.fixture.Fixture.* -import net.yoshinorin.qualtet.infrastructure.db.doobie.DoobieTransactor +import net.yoshinorin.qualtet.infrastructure.db.doobie.DoobieExecuter import net.yoshinorin.qualtet.Modules.* import org.scalatest.wordspec.AnyWordSpec import org.scalatest.BeforeAndAfterAll @@ -15,7 +15,7 @@ import org.scalatest.Ignore @Ignore // TODO: write testcode when implement delete feature class ContentSerializingServiceSpec extends AnyWordSpec with BeforeAndAfterAll { - given dbContext: DoobieTransactor = new DoobieTransactor(config.db) + given dbContext: DoobieExecuter = new DoobieExecuter(config.db) val requestSeries: RequestSeries = RequestSeries( title = "Content Serializing Service Spec", diff --git a/src/test/scala/net/yoshinorin/qualtet/domains/contentTaggings/ContentTaggingServiceSpec.scala b/src/test/scala/net/yoshinorin/qualtet/domains/contentTaggings/ContentTaggingServiceSpec.scala index b07e7258..92c628a5 100644 --- a/src/test/scala/net/yoshinorin/qualtet/domains/contentTaggings/ContentTaggingServiceSpec.scala +++ b/src/test/scala/net/yoshinorin/qualtet/domains/contentTaggings/ContentTaggingServiceSpec.scala @@ -3,7 +3,7 @@ package net.yoshinorin.qualtet.domains.contentTaggings import net.yoshinorin.qualtet.domains.contents.{Path, RequestContent} import net.yoshinorin.qualtet.domains.robots.Attributes import net.yoshinorin.qualtet.fixture.Fixture.* -import net.yoshinorin.qualtet.infrastructure.db.doobie.DoobieTransactor +import net.yoshinorin.qualtet.infrastructure.db.doobie.DoobieExecuter import net.yoshinorin.qualtet.Modules.* import org.scalatest.wordspec.AnyWordSpec import org.scalatest.BeforeAndAfterAll @@ -13,7 +13,7 @@ import cats.effect.unsafe.implicits.global // testOnly net.yoshinorin.qualtet.domains.contentTaggings.ContentTaggingServiceSpec class ContentTaggingServiceSpec extends AnyWordSpec with BeforeAndAfterAll { - given dbContext: DoobieTransactor = new DoobieTransactor(config.db) + given dbContext: DoobieExecuter = new DoobieExecuter(config.db) val requestContents: List[RequestContent] = { List(1, 2) diff --git a/src/test/scala/net/yoshinorin/qualtet/domains/series/SeriesServiceSpec.scala b/src/test/scala/net/yoshinorin/qualtet/domains/series/SeriesServiceSpec.scala index bf944cee..48cc9478 100644 --- a/src/test/scala/net/yoshinorin/qualtet/domains/series/SeriesServiceSpec.scala +++ b/src/test/scala/net/yoshinorin/qualtet/domains/series/SeriesServiceSpec.scala @@ -3,7 +3,7 @@ package net.yoshinorin.qualtet.domains.tags import net.yoshinorin.qualtet.domains.contents.Path import net.yoshinorin.qualtet.domains.series.{RequestSeries, SeriesName} import net.yoshinorin.qualtet.fixture.Fixture.* -import net.yoshinorin.qualtet.infrastructure.db.doobie.DoobieTransactor +import net.yoshinorin.qualtet.infrastructure.db.doobie.DoobieExecuter import net.yoshinorin.qualtet.Modules.* import org.scalatest.wordspec.AnyWordSpec import org.scalatest.BeforeAndAfterAll @@ -13,7 +13,7 @@ import cats.effect.unsafe.implicits.global // testOnly net.yoshinorin.qualtet.domains.SeriesServiceSpec class SeriesServiceSpec extends AnyWordSpec with BeforeAndAfterAll { - given dbContext: DoobieTransactor = new DoobieTransactor(config.db) + given dbContext: DoobieExecuter = new DoobieExecuter(config.db) val requestSeries: List[RequestSeries] = List( RequestSeries( diff --git a/src/test/scala/net/yoshinorin/qualtet/domains/tags/TagServiceSpec.scala b/src/test/scala/net/yoshinorin/qualtet/domains/tags/TagServiceSpec.scala index f1d06e0e..ac992adb 100644 --- a/src/test/scala/net/yoshinorin/qualtet/domains/tags/TagServiceSpec.scala +++ b/src/test/scala/net/yoshinorin/qualtet/domains/tags/TagServiceSpec.scala @@ -2,7 +2,7 @@ package net.yoshinorin.qualtet.domains.tags import net.yoshinorin.qualtet.domains.contents.Path import net.yoshinorin.qualtet.fixture.Fixture.* -import net.yoshinorin.qualtet.infrastructure.db.doobie.DoobieTransactor +import net.yoshinorin.qualtet.infrastructure.db.doobie.DoobieExecuter import net.yoshinorin.qualtet.Modules.* import org.scalatest.wordspec.AnyWordSpec import org.scalatest.BeforeAndAfterAll @@ -13,7 +13,7 @@ import cats.effect.unsafe.implicits.global // testOnly net.yoshinorin.qualtet.domains.TagServiceSpec class TagServiceSpec extends AnyWordSpec with BeforeAndAfterAll { - given dbContext: DoobieTransactor = new DoobieTransactor(config.db) + given dbContext: DoobieExecuter = new DoobieExecuter(config.db) val requestContents = makeRequestContents(10, "tagService") diff --git a/src/test/scala/net/yoshinorin/qualtet/fixture/Fixture.scala b/src/test/scala/net/yoshinorin/qualtet/fixture/Fixture.scala index c6e0eaa4..8f419811 100644 --- a/src/test/scala/net/yoshinorin/qualtet/fixture/Fixture.scala +++ b/src/test/scala/net/yoshinorin/qualtet/fixture/Fixture.scala @@ -41,7 +41,7 @@ import net.yoshinorin.qualtet.domains.feeds.FeedService import net.yoshinorin.qualtet.domains.articles.ResponseArticleWithCount import net.yoshinorin.qualtet.Modules import net.yoshinorin.qualtet.syntax.* -import net.yoshinorin.qualtet.infrastructure.db.doobie.DoobieTransactor +import net.yoshinorin.qualtet.infrastructure.db.doobie.DoobieExecuter import cats.effect.unsafe.implicits.global import net.yoshinorin.qualtet.domains.series.{RequestSeries, SeriesName} @@ -56,7 +56,7 @@ object Fixture { val p: String = Modules.config.http.port.toString() val host = Uri.unsafeFromString(s"http://${h}:${p}") - given dbContext: DoobieTransactor = new DoobieTransactor(Modules.config.db) + given dbContext: DoobieExecuter = new DoobieExecuter(Modules.config.db) given log4catsLogger: Log4CatsLoggerFactory[IO] = Log4CatsSlf4jFactory.create[IO] // TODO: from config for cache options diff --git a/src/test/scala/net/yoshinorin/qualtet/infrastructure/db/MigratorSpec.scala b/src/test/scala/net/yoshinorin/qualtet/infrastructure/db/MigratorSpec.scala index 55502523..a19b7b04 100644 --- a/src/test/scala/net/yoshinorin/qualtet/infrastructure/db/MigratorSpec.scala +++ b/src/test/scala/net/yoshinorin/qualtet/infrastructure/db/MigratorSpec.scala @@ -2,7 +2,7 @@ package net.yoshinorin.qualtet.infrastructure.db import net.yoshinorin.qualtet.fixture.Fixture.contentTypeService import net.yoshinorin.qualtet.Modules -import net.yoshinorin.qualtet.infrastructure.db.doobie.DoobieTransactor +import net.yoshinorin.qualtet.infrastructure.db.doobie.DoobieExecuter import org.scalatest.wordspec.AnyWordSpec import cats.effect.unsafe.implicits.global @@ -10,7 +10,7 @@ import cats.effect.unsafe.implicits.global // testOnly net.yoshinorin.qualtet.infrastructure.db.MigratorSpec class MigratorSpec extends AnyWordSpec { - given dbContext: DoobieTransactor = new DoobieTransactor(Modules.config.db) + given dbContext: DoobieExecuter = new DoobieExecuter(Modules.config.db) "Migrator" should {