Skip to content

Releases: zio/zio-query

0.5.0

27 Sep 03:06
3d6f023
Compare
Choose a tag to compare

This release allows data sources to fail with defects in addition to errors and translates those back into defects in requests. This ensures that all errors from a data source are preserved and allows these to be handled with normal ZIO operators that recover from defects.

To support this change, this release does include a couple of breaking changes.

CompletedRequestMap#insert now takes an Exit[E, A] instead of an Either[E, A], which allows the CompletedRequestMap to handle the possibility of defects in addition to errors. If you are implementing a DataSource directly by extending DataSource or DataSource.Batched you should replace usages of Left with Exit.fail and usages of Right with Exit.succeed. If you are using higher level constructors to define your data sources you do not need to make any changes.

The signature of some operators on Cache have been changed similarly to replace Either with Exit though this will only impact users who are working with the Cache interface directly.

0.4.0

06 Mar 18:20
45b3ae6
Compare
Choose a tag to compare

This release implements query aspects, which are like data source aspects but let you transform how an entire query is executed instead of just how a data source is executed. You can think of them as like a ZIOAspect for ZQuery. You apply query aspects with the @@ syntax just like other aspects and the QueryAspect companion object contains query aspects you can use.

This release also implements the acquireReleaseWith constructor for ZQuery for resource handling just like acquireReleaseWith in ZIO. Just like in ZIO, the acquire and release workflows are uninterruptible and the guarantee is that if the acquire workflow completes execution the release workflow will be run as soon as the use query completes execution, whether by success, failure or interruption.

To support these improvements, this release does include a couple of breaking changes.

First, the @@ syntax for applying aspect on ZQuery now expects a QueryAspect rather than a DataSourceAspect. You can use QueryAspect.fromDataSourceAspect to transform a DataSourceAspect to a QueryAspect so if you previously had this:

query @@ dataSourceAspect

You can now do this:

val queryAspect = QueryAspect.fromDataSourceAspect(dataSourceAspect)

query @@ queryAspect

Second, the signature of ZQuery#ensuring has changed to accept a finalizer that is a ZIO workflow rather than a ZQuery. This is consistent with other ZIO operators such as ZSteam#ensuring and brings the same guarantee that ensuring does for ZIO that if the workflow begins execution the finalizer will be executed when the workflow completes execution, whether by success, failure, or interruption.

0.3.6

16 Feb 00:24
c5ce857
Compare
Choose a tag to compare

This release contains bug fixes.

0.3.5

13 Feb 19:55
dba288a
Compare
Choose a tag to compare

This release implements support for bounded parallelism, which can be significantly more efficient than unbounded parallelism.

You can use ZQuery.withParallelism to specify the maximum number of fibers for concurrent operations. So you can do ZQuery.foreachPar(queries)(f).withParallelism(n) to run a collection of queries with bounded parallelism. This is implemented in terms of ZIO's compositional parallelism so you can also control parallelism at a higher level of your application with the ZIO.withParallism operators.

As always thank you for your support!

0.3.4

11 Dec 16:09
4e444b0
Compare
Choose a tag to compare

This release fixes a publishing issue on Scala 3 JS.

0.3.3

06 Dec 21:54
ba111ad
Compare
Choose a tag to compare

This release contains dependency updates.

0.3.2

16 Nov 16:17
7a6c00c
Compare
Choose a tag to compare

This release contains bug fixes.

0.3.1

28 Jul 01:03
d707caa
Compare
Choose a tag to compare

This release optimizes the performance of collectAllPar for very small collections.

0.3.0

26 Jun 16:06
798ee35
Compare
Choose a tag to compare

This release contains support for ZIO 2.0.0.

0.3.0-RC5

03 May 23:06
d2d807a
Compare
Choose a tag to compare

This release contains support for ZIO 2.0.0-RC6.