Skip to content

Releases: gaelrenoux/tranzactio

v3.0.0-M3

18 Apr 12:20
Compare
Choose a tag to compare
v3.0.0-M3 Pre-release
Pre-release

Fixes a bug on exponential retries (max-delay was always 10 seconds).

v4.0.0-M1

14 Apr 16:32
Compare
Choose a tag to compare
v4.0.0-M1 Pre-release
Pre-release

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

14 Apr 16:37
Compare
Choose a tag to compare
v3.0.0-M2 Pre-release
Pre-release

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

14 Apr 16:38
a71d92d
Compare
Choose a tag to compare
v3.0.0-M1 Pre-release
Pre-release

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

12 Jun 14:19
Compare
Choose a tag to compare

Now cross-building for Scala 2.12 and 2.13!
Also includes a dependencies upgrade.

v2.0.0

21 Mar 14:47
Compare
Choose a tag to compare

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

21 Mar 14:28
Compare
Choose a tag to compare

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

17 Jan 17:03
27c3467
Compare
Choose a tag to compare
  • 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

15 Nov 13:56
Compare
Choose a tag to compare

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 on openConnection 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 now Nothing: no timeout, no retry. It used to be Brutal, which had a 1-second timeout.
  • There is no more predefined RetryForever and Brutal error strategies. RetryForever can be easily rewritten to ErrorStrategies.retryForeverExponential(10.milliseconds, maxDelay = 10.seconds).
  • You can create the Database or ConnectionSource layer passing the ErrorStrategies as an argument, instead of having it as a dependent layer. This should make things simpler if your ErrorStrategies 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 the ConnectionSource service. This shouldn't impact most users, as it only changes something in user code if you are using a custom ConnectionSource.
  • Adds a ConnectionSource based on a single connection. This was required in #16.
  • Dependencies updates (ZIO and Doobie).

v1.0.1

18 Oct 11:22
Compare
Choose a tag to compare

Bugfix: the ErrorStrategies in the environment were not used when creating a ZLayer using Database.fromDatasourceAndErrorStrategies or ConnectionSource.fromDatasourceAndErrorStrategies.