On Tue, Feb 25, 2020 at 1:18 PM Keith Medcalf <kmedc...@dessus.com> wrote:
> create table data
> (
>     key    text primary key,
>     data   integer not null
> )
> without rowid;
>
> -- insert into data select (?, ? as value where value IS NOT (select data 
> from (select max(key), data from data));
>..
> Constraints:
>
> (1) Will only work for appending data (new key > all keys in table)
> (2) Types of key and data are immaterial as long as you are only inserting 
> (appending) new keys.

Awesome---exactly what's needed.
The monotonicity of the time key variable is assured by how the data
is collected---but  is there a way to express that in sqlite?
create table data (
  key text primary key check
(julianday(key) > julianday(select max(key) from data),
  data integer not null);
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to