Releases: gaelrenoux/tranzactio
v3.0.0-M3
Fixes a bug on exponential retries (max-delay was always 10 seconds).
v4.0.0-M1
Upgrades TranzactIO for ZIO 2.0.0-RC5. This comes with a bunch of improvements. The biggest change from a user's perspective is the deprecation of the transactionR
/autoCommitR
/etc. functions. You can now directly use transaction
, whether or not you have an additional environment in the ZIO instance.
v3.0.0-M2
Support Doobie's 1.0.0-RC2. Note that this version has both 2.12 and 2.13 artifacts again (3.0.0-M1 only had the 2.13 artifact due to a publishing mistake).
v3.0.0-M1
Supporting Doobie's 1.0.0-RC1 (and therefore Cats-Effect 3). Will upgrade to 3.0.0 when Doobie's 1.0.0 is out of the RC status.
v2.1.0
Now cross-building for Scala 2.12 and 2.13!
Also includes a dependencies upgrade.
v2.0.0
The 2.0.0 removes the methods deprecated in 1.3.0.
The Doobie version is increased from 0.9.4 to 0.12.1.
Migration
Migration from 1.X is easy. Just remove the explicit type parameters on all calls to the *R methods (transactionR, transactionOrDieR, autoCommitR, etc.) and you will be fine.
v1.3.0
Thanks to @kitlangton, I was able to remove the need for the explicit environment when calling the *R methods (such as transactionR
). The old methods requiring an environment have been deprecated and will be removed in 2.0.0. Note that if you are using IntelliJ as you IDE, it will mark usage of these methods as an error (or sometimes as deprecated even though you are using the correct one). The issue comes from the IntelliJ Scala plugin, and will be fixed when the deprecated methods are removed in 2.0.0.
v1.2.0
- Adds support for Doobie streams (they are converted into a
ZStream[Connection, DbException, A]
). - Adds a Database layer for unit-testing, when you need one to satisfy the compiler but it's not going to be used (because queries are stubbed).
v1.1.0
The main changes in this release cover the ErrorStrategies
, and the way to handle them. If migrating from 1.0.x, it is likely you will encounter compilation issues, but they should be trivial to fix.
- Timeouts no longer affect
openConnection
, unless you specify it manually. This is due to Tranzactio-side timeouts onopenConnection
causing connection leaks. See #19 for details. The README also includes some instructions. - The
ErrorStrategy
class was reworked as simply a transformation on a ZIO, which gives more flexibility about how to handle errors. You can now access the full set of ZIO methods if you want to, while still having a set of easily accessible methods for the most frequent use cases. - The default
ErrorStrategies
is nowNothing
: no timeout, no retry. It used to beBrutal
, which had a 1-second timeout. - There is no more predefined
RetryForever
andBrutal
error strategies.RetryForever
can be easily rewritten toErrorStrategies.retryForeverExponential(10.milliseconds, maxDelay = 10.seconds)
. - You can create the
Database
orConnectionSource
layer passing the ErrorStrategies as an argument, instead of having it as a dependent layer. This should make things simpler if yourErrorStrategies
is directly available (e.g. it is hard-coded). The layer-based functions still exist, as they are useful when loading the configuration from a previous layer.
Other than that, the following changes are included:
- The run of the transaction was moved from the
Database
to theConnectionSource
service. This shouldn't impact most users, as it only changes something in user code if you are using a customConnectionSource
. - Adds a
ConnectionSource
based on a single connection. This was required in #16. - Dependencies updates (ZIO and Doobie).
v1.0.1
Bugfix: the ErrorStrategies in the environment were not used when creating a ZLayer using Database.fromDatasourceAndErrorStrategies
or ConnectionSource.fromDatasourceAndErrorStrategies
.