You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41-23Lines changed: 41 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,48 +54,50 @@ Currently, the library is developed with Postgres as the target DB. But the appr
54
54
55
55
#### Sbt
56
56
57
+
Import one of the two available module at the moment. Slick module works with Scala Futures. Doobie module works with any effect type (typically IO or ZIO) provided cats effect's Async instance is available.
@@ -109,13 +111,15 @@ Text about status codes returned from the database function can be found [here](
109
111
110
112
## Slick module
111
113
112
-
Slick module is the first (and so far only) implementation of fa-db able to execute. As the name suggests it runs on
113
-
[Slick library](https://github.com/slick/slick) and also brings in the [Slickpg library](https://github.com/tminglei/slick-pg/) for extended Postgres type support.
114
+
As the name suggests it runs on [Slick library](https://github.com/slick/slick) and also brings in the [Slickpg library](https://github.com/tminglei/slick-pg/) for extended Postgres type support.
114
115
115
116
It brings:
116
117
117
118
*`class SlickPgEngine` - implementation of _Core_'s `DBEngine` executing the queries via Slick
118
-
*`trait SlickFunction` and `trait SlickFunctionWithStatusSupport` - mix-in traits to use with `FaDbFunction` descendants
119
+
*`class SlickSingleResultFunction` - abstract class for DB functions returning single result
120
+
*`class SlickMultipleResultFunction` - abstract class for DB functions returning sequence of results
121
+
*`class SlickOptionalResultFunction` - abstract class for DB functions returning optional result
122
+
*`class SlickSingleResultFunctionWithStatus` - abstract class for DB functions with status handling; it requires an implementation of `StatusHandling` to be mixed-in (`StandardStatusHandling` available out-of-the-box)
119
123
*`trait FaDbPostgresProfile` - to bring support for Postgres and its extended data types in one class (except JSON, as there are multiple implementations for this data type in _Slick-Pg_)
120
124
*`object FaDbPostgresProfile` - instance of the above trait for direct use
121
125
@@ -137,6 +141,20 @@ val hStore: Option[Map[String, String]] = pr.nextHStoreOption
As the name suggests it runs on [Doobie library](https://tpolecat.github.io/doobie/). The main benefit of the module is that it allows to use any effect type (typically IO or ZIO) therefore is more suitable for functional programming. It also brings in the [Doobie-Postgres library](https://tpolecat.github.io/doobie/docs/14-PostgreSQL.html) for extended Postgres type support.
147
+
148
+
It brings:
149
+
150
+
*`class DoobieEngine` - implementation of _Core_'s `DBEngine` executing the queries via Doobie. The class is type parameterized with the effect type.
151
+
*`class DoobieSingleResultFunction` - abstract class for DB functions returning single result
152
+
*`class DoobieMultipleResultFunction` - abstract class for DB functions returning sequence of results
153
+
*`class DoobieOptionalResultFunction` - abstract class for DB functions returning optional result
154
+
*`class DoobieSingleResultFunctionWithStatus` - abstract class for DB functions with status handling; it requires an implementation of `StatusHandling` to be mixed-in (`StandardStatusHandling` available out-of-the-box)
155
+
156
+
Since Doobie also interoperates with ZIO, there is an example of how a database connection can be properly established within a ZIO application. Please see [this file](doobie/zio-setup.md) for more details.
157
+
140
158
## Testing
141
159
142
160
### How to generate unit tests code coverage report
0 commit comments