<commit_before>package com.nulabinc.backlog.migration.common.interpreters

import cats.implicits._
import com.nulabinc.backlog.migration.common.domain.exports.ExportedBacklogStatus
import com.nulabinc.backlog.migration.common.domain.{BacklogStatus, BacklogStatuses}
import com.nulabinc.backlog.migration.common.dsl.StoreDSL
import com.nulabinc.backlog.migration.common.persistence.store.sqlite.ops.{
  BacklogStatusOps,
  ExportedStatusTableOps
}
import doobie.implicits._
import doobie.util.transactor.Transactor
import monix.eval.Task
import monix.execution.Scheduler

import java.nio.file.Path

class SQLiteStoreDSL(private val dbPath: Path)(implicit sc: Scheduler) extends StoreDSL[Task] {

  private val xa: Transactor[Task] = Transactor.fromDriverManager[Task](
    "org.sqlite.JDBC",
    s"jdbc:sqlite:${dbPath.toAbsolutePath}",
    "",
    ""
  )

  def findBacklogStatus(id: Int): Task[Option[BacklogStatus]] =
    BacklogStatusOps.find(id).option.transact(xa)

  def allBacklogStatuses(): Task[BacklogStatuses] =
    Task
      .from(
        BacklogStatusOps.getAll().to[Seq].transact(xa)<commit_msg>fix: must be visible<commit_after>package com.nulabinc.backlog.migration.common.interpreters

import cats.implicits._
import com.nulabinc.backlog.migration.common.domain.exports.ExportedBacklogStatus
import com.nulabinc.backlog.migration.common.domain.{BacklogStatus, BacklogStatuses}
import com.nulabinc.backlog.migration.common.dsl.StoreDSL
import com.nulabinc.backlog.migration.common.persistence.store.sqlite.ops.{
  BacklogStatusOps,
  ExportedStatusTableOps
}
import doobie.implicits._
import doobie.util.transactor.Transactor
import monix.eval.Task
import monix.execution.Scheduler

import java.nio.file.Path

class SQLiteStoreDSL(private val dbPath: Path)(implicit sc: Scheduler) extends StoreDSL[Task] {

  protected val xa: Transactor[Task] = Transactor.fromDriverManager[Task](
    "org.sqlite.JDBC",
    s"jdbc:sqlite:${dbPath.toAbsolutePath}",
    "",
    ""
  )

  def findBacklogStatus(id: Int): Task[Option[BacklogStatus]] =
    BacklogStatusOps.find(id).option.transact(xa)

  def allBacklogStatuses(): Task[BacklogStatuses] =
    Task
      .from(
        BacklogStatusOps.getAll().to[Seq].transact(xa)
{'fraction_non_alphanumeric': 0.1134020618556701, 'fraction_numerical': 0.0, 'mean_word_length': 5.377142857142857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3145638', 'n_tokens_mistral': 779, 'n_tokens_neox': 767, 'n_words': 106}