Skip to content
This repository has been archived by the owner on Apr 11, 2019. It is now read-only.

Missing history support #12

Closed
errnoh opened this issue Dec 30, 2015 · 2 comments
Closed

Missing history support #12

errnoh opened this issue Dec 30, 2015 · 2 comments

Comments

@errnoh
Copy link

errnoh commented Dec 30, 2015

Everything in the library works really well and it's easy to use. Only thing I'm missing is support for History objects. I wrote a simple version that does what I need, but I don't think it's complete enough to be added to master.

Couple things that need to be considered:

  • This version handles all Values as strings. This was trivial to implement since the reflector works great. It would also be quite easy to add version that checks history parameter and passes proper struct type to reflector. Problem with this is that it would need to either return interface{} (or an actual interface with getters), which is not how rest of the system works and is ugly. Another version would be to have Value as interface{}, in which case it would need to be casted to proper value each time, which is even worse.
  • I wrote a test, but since I'm using actual db and not an empty one it doesn't create new History object, thus it would fail on an empty db.

You can see the commit here: errnoh@9e6d3a1

@errnoh
Copy link
Author

errnoh commented Dec 30, 2015

There's also the possibility of having separate GetHistoriesFloat(), GetHistoriesText() (or GetTextHistories()), etc. That would allow one to have separate return types for each of the different history types.

@AlekSi
Copy link
Owner

AlekSi commented Jan 22, 2019

See #24.

@AlekSi AlekSi closed this as completed Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants