SQLite Forum

Serious problems with STORED columns
Login
That is easy.

```
create table log
(
  jdt real not null on conflict replace default (julianday()),
  dt text as (datetime(jdt)) STORED,
  msg text not null collate nocase,
  unique (dt, msg)
);
```

Now when you insert your msg and use dump and restore the value of the dt column is preserved because its value is computed based on a persistent value inherent in the record and not an ephemeral value.

Why you would do this and not just make the dt column a default is beyond me, but you are the one with the problem that needs solving.