You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at bindings for other languages, the transaction options are usually accessed via an "Options" property or field, so would look something like this in c#
Currently, the SetOptions(...) methods are directly on the IFdbReadOnlyTransaction itself, and there is a set of extensions methods that target this interface to add the fluent versions of WithWriteAccessToSystemKeys(...) or WithNextWriteNoWriteConflictRange(..) etc..
These methods would be moved to a new IFdbTransactionOptions interface, and accessible via the tr.Options field.
To keep an easy way to perform fluent configuration and query of a transaction (combined with the QueryAsync(...) helper, we would add a WithOptions(Action<IFdbTranscationOptions>) on the transaction itself, that would return the transaction instance. This would allow the caller to have the transaction handler expressed as a single expression, without the need to create a statement or block.
less intellisense clutter on the transaction instance itself, with most of the options moved away into the tr.Options property
easier to mock or provide an alternative implementation (if not using the fdb_c client library).
Drawbacks:
is a breaking change for existing code that would call tr.WithXYZ(...) which need to change change to either tr.Options.WithXYZ(..) or use tr.WithOptions(options => options.WithXYZ()) instead.
The text was updated successfully, but these errors were encountered:
- Add Options field on transcations that return an IFdbTransactionOptions
- This interface has the SetOption(...) has well as most of the extension methods WithXYZ()
- Add missing values in enum FdbTransactionOption, up to API level 720
- Similar to the work for transaction options, add an IFdbDatabaseOptions interface
- expose this via the "db.Options" field
- add extension methods on this new interface
- add missing FdbDatabaseOption values for up to API level 720
- Rename all "SetXYZ" into "WithXYZ" to be in line with the rest of the API
- Fix unit tests
Looking at bindings for other languages, the transaction options are usually accessed via an "Options" property or field, so would look something like this in c#
Currently, the
SetOptions(...)
methods are directly on theIFdbReadOnlyTransaction
itself, and there is a set of extensions methods that target this interface to add the fluent versions ofWithWriteAccessToSystemKeys(...)
orWithNextWriteNoWriteConflictRange(..)
etc..These methods would be moved to a new
IFdbTransactionOptions
interface, and accessible via thetr.Options
field.Typical usage:
To keep an easy way to perform fluent configuration and query of a transaction (combined with the
QueryAsync(...)
helper, we would add aWithOptions(Action<IFdbTranscationOptions>)
on the transaction itself, that would return the transaction instance. This would allow the caller to have the transaction handler expressed as a single expression, without the need to create a statement or block.Pro:
Drawbacks:
tr.WithXYZ(...)
which need to change change to eithertr.Options.WithXYZ(..)
or usetr.WithOptions(options => options.WithXYZ())
instead.The text was updated successfully, but these errors were encountered: