Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 165: Misc database issue #63

Merged
merged 43 commits into from
Jul 11, 2017
Merged

Conversation

ohinckel
Copy link
Member

@ohinckel ohinckel commented Jul 9, 2017

Fixes for the issue smarthomeNG/smarthome#165. The left-overs will be handled in separate issues.

# the "start" parameter needs to be set to the "end" to return only following
# values in the next update query
  LIMIT & ORDER-BY to use MAX()
# the latter seems to be faster and more compatible with other RDBMS
  . add current value of items to internal buffer to log them into database
    use NULL as duration (indicating no duration available, last value)
  . change update_item() to update the NULL-duration value or add a new one
    as done before
  . change update_item() to add a new NULL-duration item for the current value
  . in _dump() reuse create timestamp for "end" value
  . change fetch_log() to query data for three different types of item logs:
    * items intersecting the query-range at the beginning
    * items intersecting the query-range at the ending (NULL-duration)
    * items completely within query-range
…series()

  to make it possible to pass int values
…rse_item()

# fixes concurrent database access problems
… and

  _execute() methods which will create a lock if no cursor is given already
- change cursor handling in parse_item() to always free them after processing
- fix last_change timestamp appinding to buffer in parse_item()
  . add current value of items to internal buffer to log them into database
    use NULL as duration (indicating no duration available, last value)
  . change update_item() to update the NULL-duration value or add a new one
    as done before
  . change update_item() to add a new NULL-duration item for the current value
  . in _dump() reuse create timestamp for "end" value
  . change fetch_log() to query data for three different types of item logs:
    * items intersecting the query-range at the beginning
    * items intersecting the query-range at the ending (NULL-duration)
    * items completely within query-range
…series()

  to make it possible to pass int values
…rse_item()

# fixes concurrent database access problems
@psilo909 psilo909 merged commit f24dfc0 into smarthomeNG:develop Jul 11, 2017
@ohinckel ohinckel deleted the issue-165 branch December 8, 2017 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants