Add SQLite TradeLogger
akshualy opened this issue ยท 1 comments
From #749 (this comment specificially)
The development task is to create a TradeLogger which uses SQLite.
The first iteration of this logger should only implement:
- A 1:1 parity to CSV logging (as in, things logged/log style).
- A timestamp, which should be stored in UTC and then later be converted to local time zones for users.
- A config migration for
log-trades-to-csv
->trade-log-storage
with values'none'
(default),'csv'
and'sqlite'
.
The comment mentions a newenable-trade-log: false
option, which I feel is sufficiently covered with a'none'
option in the above.
Implementation thoughts/details:
- A use of a pooling library is not needed, as we only interface with a local file database.
- The driver does not need to be shaded, as Spigot comes pre-packaged in all versions Shopkeepers targets.
- I'd like to avoid sharing some of the probably common variables between the two trade logger implementations, for now. Keep everything in its own class for easier modification.
- I'd like to make the connection to the database on every call to it, I think guaranteeing that the data is written is more important than the little keeping the connection open saves in overhead.
Other than that, I think all implementation details should be straight-forward, but I am open for other opinions.
This issue has been created to improve discussion over this feature, before and or while implementation happens.