SQLite Forum

Strange generated column behaviour

Strange generated column behaviour

(1) By Gorbit99 on 2021-10-04 03:14:34 [source]

Hi, I'm currently trying to use generated columns in sqlite, and I've run into a few oddities that I don't think are documented.

First of all, generated columns don't appear in table_info, only in table_xinfo. Looking at the code, this is because it uses the hidden flag location for generated columns as well, just with different values. Haven't found a mention for this in the official docs.

Secondly, even with table_xinfo, the output of the type column can be a lot of values, anything, anything that was put in inbetween the column name and "as" in the create table statement, so these values:

  • empty string
  • generated always
  • <type>
  • <type> generated always

It would be great if this could show up just as the computed type, but even being more consistent would work.

Hope you can shine some light onto these issues.