Releases: konveyor/controller
v0.12.0
Add model DB.With() syntax.
Add DB.With() transaction syntax patterned after the Python with
(context) statement.
err := DB.With(func(tx *Tx) (err error) {
err = tx.Insert(&person)
return
})
This simplified syntax ensures that the transaction is always committed/ended.
The user only needs to implement the function performing the DB operations.
Add (optional) model update predicates.
Add (optional) model update predicates.
Example will update the model by PK and revision=44:
db.Update(&m, model.Eq("revision",44)
Enhanced Eq() predicate.
Add support for list values for Eq() predicate.
Example:
err = DB.List(
&list,
ListOptions{
Predicate: Eq("ID", []int{2, 4}),
})
Adjusted detail level.
Correct default model.DetailLevel to 0.
Better support for cascade delete.
Better support cascade delete based on foreign keys.
This needs to be done by the model layer instead of in the DB using ON CASCADE DELETE foreign key constraints to support event generation. Enhanced FK tag: fk(
table, +must +cascade)
makes enforcement (with constraint) and cascade delete optional.
Upgrade to gin 1.7.2 for CVE-2020-28483
Minor model enhancements.
Minor model enhancements.
- Add support for transaction labels to be passed though to model
Event
. Primarily used to identify and ignore echo events generated when anEventHandler
updates the DB. - Adjust logging level of
Client
insert, update and delete operations to: 3.
Improved API
Improved API.
Renamed Reconciler
to: Collector
in the container package. The name reconciler was more appropriate but overloaded with OpenShift controllers.
Renamed: DB.Iter() to be a verb: DB.Find().
Enhanced the model layer to no longer require the sql:""
tag on all model fields. All exported fields are included unless omitted using sql:"-"
much like the json lib. The tag is only required to modify default behavior.
Fixed an issue with Updated events having the Event.Model
and Event.Updated
fields reversed. The regression introduced in 0.5.0.
Includes some logging (level) adjustments.
sqlite3 journal-mode=WAL
Improved model concurrency by using the sqlite3 WAL (write-ahead logging) journal.
The WAL journal supports concurrent read/write among separate DB connections. As a result, the MUTEX used by the model.Client is no longer needed. Instead, the Client sets the WAL pragma and maintains a pool of DB Session which encapsulates a actual DB connection and provides DB connection reservation.
The model.Journal no longer maintains the list of staged events. Its interface has slimmed down accordingly.
Instead, each transaction (Tx) contains the list of staged events which are reported (to the journal) in Tx.Commit().
Reduced memory footprint in container.Collection.
Add support for direct access in filebacked List
and Iterator
. Adds At() and AtWith().
Greatly reduced memory footprint in container.Collection.
Fixes error in Client.List() logging.