Sounds like you want the newly-implemented [generated columns](https://www.sqlite.org/gencol.html) feature.