Version 0.17.0
Pre-releaseThis release features some bug fixes, API changes, and new features. It is not backwards compatible with previous versions.
You can now run queries inside a transaction via the Transaction.Query
method. It returns a TransactionQuery
type which works similarly to a regular Query
. The only real difference is how the queries are actually executed. Specifically, the finisher methods (e.g. Run
, RunOne
, Count
, etc) do not return anything. Instead they accept arguments which are then mutated after the transaction is executed with Transaction.Exec
.
There is a new query finisher method called StoreIds
on both Query
and TransactionQuery
. StoreIds
allows you to store the ids of models that match the query criteria in a Redis list, which allows for more low-level operations.
Zoom now uses a different approach for both PoolOptions
and CollectionOptions
. In the past, Zoom has relied on zero types and nil
to implicitly convey defaults. Now, Zoom explicitly provides values for DefaultPoolOptions
and DefaultCollectionOptions
. To modify the options, you can create a copy of the options and modify the fields directly. There are also helper methods (e.g. PoolOptions.WithPassword
for modifying the default values without mutating.
Full Changelog
- Added new
StoreIds
method toQuery
andTransactionQuery
- Added an explicit test for leaked temporary ids
- Implemented
TransactionQuery
for running queries inside a transaction - Implemented
Transaction.FindModelsByIdsKey
for finding models by the ids in a Redis set - Fixed a bug which caused fields of type
time.Duration
to not be saved correctly - Improved clarity of the
ModelNotFoundError
message - Fixed a bug where errors that occurred during a transaction were sometimes not returned
- Renamed
UpdateFields
toSaveFields
- Changed the way
PoolOptions
andCollectionOptions
work - Various README updates