Hacker News new | ask | show | jobs
by jmull 1500 days ago
I think the way the article does it just provides an easy, symbolic way to reference the computed value... so it gives a little readability, it's maybe easier to ensure your where clause and index match up.

Also, depending on your access patterns, you might want the generated column to be stored (evaluated on write) rather than virtual (evaluated on read).

1 comments

SQLite doesn't support adding generated stored columns to a table once the table has been created, so you basically have to decide upfront which generated columns must be stored, and then you can't touch it anymore (short of dropping it).
That’s normal DBA for SQLite - you can’t even rename columns without dropping the table. So not such an obstacle.
You can rename it now, unless I'm missing something

https://www.sqlite.org/lang_altertable.html