diff --git a/doobie/src/main/scala/za/co/absa/fadb/doobie/DoobieEngine.scala b/doobie/src/main/scala/za/co/absa/fadb/doobie/DoobieEngine.scala index 0acc5877..dfb8e3d2 100644 --- a/doobie/src/main/scala/za/co/absa/fadb/doobie/DoobieEngine.scala +++ b/doobie/src/main/scala/za/co/absa/fadb/doobie/DoobieEngine.scala @@ -27,7 +27,7 @@ import za.co.absa.fadb.exceptions.StatusException import scala.language.higherKinds /** - * [[DoobieEngine]] is a class that extends [[DBEngine]] with `F` as the effect type. + * [[DoobieEngine]] is a class that extends [[za.co.absa.fadb.DBEngine]] with `F` as the effect type. * It uses [[doobie.Transactor]] to execute SQL queries. * * [[cats.effect.Async]] is needed because Doobie requires it for non-blocking database operations. @@ -45,7 +45,7 @@ class DoobieEngine[F[_]: Async](val transactor: Transactor[F]) extends DBEngine[ * Executes a Doobie query and returns the result as an `F[Seq[R]]`. * * @param query the Doobie query to execute - * @param readR the [[Read]] instance used to read the query result into `R` + * @param readR the [[doobie.Read]] instance used to read the query result into `R` * @return the query result as an `F[Seq[R]]` */ private def executeQuery[R](query: QueryType[R])(implicit readR: Read[R]): F[Seq[R]] = { @@ -56,7 +56,7 @@ class DoobieEngine[F[_]: Async](val transactor: Transactor[F]) extends DBEngine[ * Executes a Doobie query and returns the result as an `F[Either[StatusException, R]]`. * * @param query the Doobie query to execute - * @param readStatusWithDataR the [[Read]] instance used to read the query result into `StatusWithData[R]` + * @param readStatusWithDataR the [[doobie.Read]] instance used to read the query result into `StatusWithData[R]` * @return the query result as an `F[Either[StatusException, R]]` */ private def executeQueryWithStatus[R]( diff --git a/doobie/src/main/scala/za/co/absa/fadb/doobie/DoobieFunction.scala b/doobie/src/main/scala/za/co/absa/fadb/doobie/DoobieFunction.scala index 41ce7516..32584bce 100644 --- a/doobie/src/main/scala/za/co/absa/fadb/doobie/DoobieFunction.scala +++ b/doobie/src/main/scala/za/co/absa/fadb/doobie/DoobieFunction.scala @@ -28,56 +28,56 @@ import scala.language.higherKinds trait DoobieFunctionBase[R] { /** - * The `Read[R]` instance used to read the query result into `R`. + * The [[doobie.Read]] instance used to read the query result into `R`. */ implicit val readR: Read[R] } /** - * `DoobieFunction` provides support for executing database functions using Doobie. + * [[DoobieFunction]] provides support for executing database functions using Doobie. * * @tparam I the input type of the function * @tparam R the result type of the function */ private[doobie] trait DoobieFunction[I, R] extends DoobieFunctionBase[R] { /** - * Generates a Doobie `Fragment` representing the SQL query for the function. + * Generates a [[doobie.Fragment]] representing the SQL query for the function. * * @param values the input values for the function - * @return the Doobie `Fragment` representing the SQL query + * @return the [[doobie.Fragment]] representing the SQL query */ def sql(values: I)(implicit read: Read[R]): Fragment /** - * Generates a `DoobieQuery[R]` representing the SQL query for the function. + * Generates a [[DoobieQuery]] for type `R` representing the SQL query for the function. * * @param values the input values for the function - * @return the `DoobieQuery[R]` representing the SQL query + * @return the [[DoobieQuery]] for type `R` representing the SQL query */ protected def query(values: I): DoobieQuery[R] = new DoobieQuery[R](sql(values)) } private[doobie] trait DoobieFunctionWithStatus[I, R] extends DoobieFunctionBase[R] { /** - * The `Read[StatusWithData[R]]` instance used to read the query result with status into `StatusWithData[R]`. + * The [[doobie.Read]] instance used to read the query result with status into `StatusWithData[R]`. */ implicit def readStatusWithDataR(implicit readR: Read[R]): Read[StatusWithData[R]] = Read[(Int, String, R)].map { case (status, status_text, data) => StatusWithData(status, status_text, data) } /** - * Generates a Doobie `Fragment` representing the SQL query for the function. + * Generates a [[doobie.Fragment]] representing the SQL query for the function. * * @param values the input values for the function - * @return the Doobie `Fragment` representing the SQL query + * @return the [[doobie.Fragment]] representing the SQL query */ def sql(values: I)(implicit read: Read[StatusWithData[R]]): Fragment /** - * Generates a `DoobieQueryWithStatus[R]` representing the SQL query for the function. + * Generates a [[DoobieQueryWithStatus]] for type `R` representing the SQL query for the function. * * @param values the input values for the function - * @return the `DoobieQueryWithStatus[R]` representing the SQL query + * @return the [[DoobieQueryWithStatus]] for type `R` representing the SQL query */ protected def query(values: I): DoobieQueryWithStatus[R] = new DoobieQueryWithStatus[R](sql(values), checkStatus) @@ -86,21 +86,21 @@ private[doobie] trait DoobieFunctionWithStatus[I, R] extends DoobieFunctionBase[ } /** - * `DoobieFunction` is an object that contains several abstract classes extending different types of database functions. - * These classes use Doobie's `Fragment` to represent SQL queries and `DoobieEngine` to execute them. + * [[DoobieFunction]] is an object that contains several abstract classes extending different types of database functions. + * These classes use [[doobie.Fragment]] to represent SQL queries and [[DoobieEngine]] to execute them. */ object DoobieFunction { /** - * `DoobieSingleResultFunctionWithStatus` is an abstract class that extends `DBSingleResultFunctionWithStatus` - * with `DoobieEngine` as the engine type. + * [[DoobieSingleResultFunctionWithStatus]] is an abstract class that extends + * [[za.co.absa.fadb.DBFunction.DBSingleResultFunctionWithStatus]] with [[DoobieEngine]] as the engine type. * It represents a database function that returns a single result with status. * * @param functionNameOverride the optional override for the function name * @param schema the database schema - * @param dbEngine the `DoobieEngine` instance used to execute SQL queries - * @param readR the `Read[R]` instance used to read the query result into `R` - * @param readSelectWithStatus the `Read[StatusWithData[R]]` instance used to read the query result with status into `StatusWithData[R]` - * @tparam F the effect type, which must have an `Async` and a `Monad` instance + * @param dbEngine the [[DoobieEngine]] instance used to execute SQL queries + * @param readR the [[doobie.Read]] instance used to read the query result into `R` + * @param readSelectWithStatus the [[doobie.Read]] instance used to read the query result into `StatusWithData[R]` + * @tparam F the effect type, which must have an [[cats.effect.Async]] instance */ abstract class DoobieSingleResultFunctionWithStatus[I, R, F[_]: Async]( functionNameOverride: Option[String] = None @@ -112,14 +112,15 @@ object DoobieFunction { with DoobieFunctionWithStatus[I, R] /** - * `DoobieSingleResultFunction` is an abstract class that extends `DBSingleResultFunction` with `DoobieEngine` as the engine type. + * [[DoobieSingleResultFunction]] is an abstract class that extends + * [[za.co.absa.fadb.DBFunction.DBSingleResultFunction]] with [[DoobieEngine]] as the engine type. * It represents a database function that returns a single result. * * @param functionNameOverride the optional override for the function name * @param schema the database schema - * @param dbEngine the `DoobieEngine` instance used to execute SQL queries - * @param readR the `Read[R]` instance used to read the query result into `R` - * @tparam F the effect type, which must have an `Async` and a `Monad` instance + * @param dbEngine the [[DoobieEngine]] instance used to execute SQL queries + * @param readR the [[doobie.Read]] instance used to read the query result into `R` + * @tparam F the effect type, which must have an [[cats.effect.Async]] instance */ abstract class DoobieSingleResultFunction[I, R, F[_]: Async](functionNameOverride: Option[String] = None)( implicit override val schema: DBSchema, @@ -129,8 +130,8 @@ object DoobieFunction { with DoobieFunction[I, R] /** - * `DoobieMultipleResultFunction` is an abstract class that extends `DBMultipleResultFunction` - * with `DoobieEngine` as the engine type. + * [[DoobieMultipleResultFunction]] is an abstract class that extends + * [[za.co.absa.fadb.DBFunction.DBMultipleResultFunction]] with [[DoobieEngine]] as the engine type. * It represents a database function that returns multiple results. */ abstract class DoobieMultipleResultFunction[I, R, F[_]: Async](functionNameOverride: Option[String] = None)( @@ -141,8 +142,8 @@ object DoobieFunction { with DoobieFunction[I, R] /** - * `DoobieStreamingResultFunction` is an abstract class that extends `DBStreamingFunction` - * with `DoobieStreamingEngine` as the engine type. + * [[DoobieStreamingResultFunction]] is an abstract class that extends + * [[za.co.absa.fadb.streaming.DBStreamingFunction]] with [[DoobieStreamingEngine]] as the engine type. * It represents a database function that returns a stream of results. */ abstract class DoobieStreamingResultFunction[I, R, F[_]: Async](functionNameOverride: Option[String] = None)( @@ -153,8 +154,8 @@ object DoobieFunction { with DoobieFunction[I, R] /** - * `DoobieOptionalResultFunction` is an abstract class that extends `DBOptionalResultFunction` - * with `DoobieEngine` as the engine type. + * [[DoobieOptionalResultFunction]] is an abstract class that extends + * [[za.co.absa.fadb.DBFunction.DBOptionalResultFunction]] with [[DoobieEngine]] as the engine type. * It represents a database function that returns an optional result. */ abstract class DoobieOptionalResultFunction[I, R, F[_]: Async](functionNameOverride: Option[String] = None)( diff --git a/doobie/src/main/scala/za/co/absa/fadb/doobie/DoobieQuery.scala b/doobie/src/main/scala/za/co/absa/fadb/doobie/DoobieQuery.scala index f4560333..f670ad6b 100644 --- a/doobie/src/main/scala/za/co/absa/fadb/doobie/DoobieQuery.scala +++ b/doobie/src/main/scala/za/co/absa/fadb/doobie/DoobieQuery.scala @@ -27,7 +27,7 @@ import za.co.absa.fadb.{FunctionStatusWithData, Query, QueryWithStatus} * It uses [[doobie.Fragment]] to represent SQL queries. * * @param fragment the [[doobie.Fragment]] representing the SQL query - * @param readR the [[Read]] instance used to read the query result into `R` + * @param readR the [[doobie.Read]] instance used to read the query result into `R` */ class DoobieQuery[R](val fragment: Fragment)(implicit val readR: Read[R]) extends Query[R] @@ -37,7 +37,7 @@ class DoobieQuery[R](val fragment: Fragment)(implicit val readR: Read[R]) extend * * @param fragment the [[doobie.Fragment]] representing the SQL query * @param checkStatus the function to check the status of the query - * @param readStatusWithDataR the [[Read]] instance used to read the query result into `StatusWithData[R]` + * @param readStatusWithDataR the [[doobie.Read]] instance used to read the query result into `StatusWithData[R]` */ class DoobieQueryWithStatus[R]( val fragment: Fragment, diff --git a/doobie/src/main/scala/za/co/absa/fadb/doobie/DoobieStreamingEngine.scala b/doobie/src/main/scala/za/co/absa/fadb/doobie/DoobieStreamingEngine.scala index 4eca0785..52b5f2c0 100644 --- a/doobie/src/main/scala/za/co/absa/fadb/doobie/DoobieStreamingEngine.scala +++ b/doobie/src/main/scala/za/co/absa/fadb/doobie/DoobieStreamingEngine.scala @@ -25,7 +25,7 @@ import za.co.absa.fadb.streaming.DBStreamingEngine import scala.language.higherKinds /** - * `DoobieStreamingEngine` is a class that represents a database engine. + * [[DoobieStreamingEngine]] is a class that represents a database engine. * It provides methods to execute streaming queries from a database. * @tparam F - The type of the context in which the database queries are executed. */ @@ -38,8 +38,8 @@ class DoobieStreamingEngine[F[_]: Async](val transactor: Transactor[F], defaultC /** * Executes a Doobie query and returns the result as an `fs2.Stream[F, R]`. * - * @param query the Doobie query to execute - * @param readR the `Read[R]` instance used to read the query result into `R` + * @param query the [[DoobieQuery]] to execute + * @param readR the [[Read]] instance used to read the query result into `R` * @return the query result as an `fs2.Stream[F, R]` */ override def runStreaming[R](query: QueryType[R]): fs2.Stream[F, R] = @@ -50,7 +50,7 @@ class DoobieStreamingEngine[F[_]: Async](val transactor: Transactor[F], defaultC * * @param query the Doobie query to execute * @param chunkSize the chunk size to use when streaming the query result - * @param readR the `Read[R]` instance used to read the query result into `R` + * @param readR the [[Read]] instance used to read the query result into `R` * @return the query result as an `fs2.Stream[F, R]` */ override def runStreamingWithChunkSize[R](query: QueryType[R], chunkSize: Int): fs2.Stream[F, R] = @@ -61,7 +61,7 @@ class DoobieStreamingEngine[F[_]: Async](val transactor: Transactor[F], defaultC * * @param query the Doobie query to execute * @param chunkSize the chunk size to use when streaming the query result - * @param readR the `Read[R]` instance used to read the query result into `R` + * @param readR the [[Read]] instance used to read the query result into `R` * @return the query result as an `fs2.Stream[F, R]` */ private def executeStreamingQuery[R](query: QueryType[R], chunkSize: Int)(implicit readR: Read[R]): fs2.Stream[F, R] = {