Performing various database operations
In this section, we are going to extend our Database API to provide additional capabilities such as creating tables, dropping tables, returning query results as collections, and so on. But before we proceed, we need to update our dependencies by adding doobie
:
object Version { Â val spark = "3.3.1" Â val deequ = "2.0.4-spark-3.3" Â val pureconfig = "0.17.2" Â val doobie = "1.0.0-RC1" Â } val mainDeps: Seq[ModuleID] = spark ++ Seq(deequ, pureconfig, doobie)
Example 4.23
doobie
is a functional JDBC layer for Scala and is based on design patterns such as functional I/O, monadic effects, and so on. We are not going to do a deep dive to understand how the library works or all of the functionalities it offers. We will instead focus on aspects of the library that allow us to write a database API with desired functionalities.
In this section, we updated our dependencies in order to...