Make Session an interface for easy decoration
Closed this issue · 3 comments
root-talis commented
I have ran into a situation when I need to do two things:
- Log all queries - for debug;
- Make queries frequency report - for throughput monitoring, queries per second.
The most straightforward way to implement his would be to wrap the Session object into a decorator. In order to use Kotlin decoration syntax, both the original Session class and the decorator need to implement the same interface.
vsch commented
@root-talis, good idea.
- Fix: factor out
Session
andTransaction
functions into interfaces. Implementation renamed
toSessionImpl
andTransactionImpl
I will be making a release 0.4.2 with these changes.
vsch commented
@root-talis, repo updated. Maven update done but will take some time to propagate.
root-talis commented
Thanks for the update! Works like a charm :)