db crate support for updating signals (#28)

This is a definite work in progress. In particular,

* there's no src/web.rs support yet so it can't be used,
* the code is surprisingly complex, and there's almost no tests so far.
  I want to at least get complete branch coverage.
* I may still go back to time_sec rather than time_90k to save RAM and
  flash.

I simplified the approach a bit from the earlier goal in design/api.md.
In particular, there's no longer the separate concept of "observation"
vs "prediction". Now the predictions are just observations that extend a
bit beyond now. They may be flushed prematurely and I'll try living with
that to avoid making things even more complex.
This commit is contained in:
Scott Lamb
2019-06-13 21:55:15 -07:00
parent d232ca55fa
commit 7dd98bb76a
8 changed files with 538 additions and 132 deletions

View File

@@ -59,7 +59,7 @@ pub fn run(_args: &super::Args, tx: &rusqlite::Transaction) -> Result<(), Error>
) without rowid;
create table signal_state (
time_sec integer primary key,
time_90k integer primary key,
changes blob
);
"#)?;