Doobie is a multi-module SBT project. There is some code generation (project/FreeGen2.scala) which generates the free algebra (e.g. kleisliinterpreter.scala) from JDBC driver classes definitions.
Running the tests or building the documentation site requires connection to the example Postgres docker contains, which you can spin up using docker-compose:
docker-compose up -d --force-update
or
docker compose up -d --force-recreate
After that, in SBT you can run test
to run tests, and makeSite
to build the doc site
If you're editing code generation related code, you should reload the SBT project and then run the freeGen2
SBT task
before compiling or running tests.
For end users, doobie provides the aliases for high and low level APIs
such as doobie.hi.HC
, doobie.free.FPS
.
Due to how the module depends on one another, internally in doobie we cannot use
these aliases because it'll lead to cyclic module dependencies and cause runtime errors.
We recommend instead to use alias the imports like doobie.hi.{connection => IHC}
(I
prefix stands for Internal and helps to avoid accidentally using e.g. doobie.hi.HC
)
doobie uses sbt-ci-release which means all merges to master
are pushed to Sonatype as snapshots and there's nothing to do.
To make a release, make sure you're on the right commit, then tag it using the format here. This will trigger a release build.
git tag -a v1.2.3 -m v1.2.3
git push --tags
To update the doc site, check out the tag first.
git checkout v1.2.3
sbt docs/publishMicrosite