jet icon indicating copy to clipboard operation
jet copied to clipboard

[sqlite] GENERATED columns not being recognized

Open go-jet opened this issue 1 year ago • 1 comments

Discussed in https://github.com/go-jet/jet/discussions/297

Originally posted by yuphing-ong December 14, 2023 I tried a table like this:

CREATE TABLE test (
    jvalues TEXT NOT NULL,
    -- virtual column for json extracted column to be indexed
   column1 STRING GENERATED ALWAYS as (JSON_EXTRACT(jvalues, "$.column1")) STORED,
);

but go-jet only generates this model (and associated table):

type TEST struct {
        Jvalues       string
 }

I tried both virtual and stored, in case go-jet needed it to be STORED but no difference.

Is this a limitation of the driver, or go-jet?

go-jet avatar Dec 16 '23 10:12 go-jet

It turned out to be a small change. I've made a fix on sqlite_gen_col branch.

go-jet avatar Dec 16 '23 10:12 go-jet

Sqlite support for generated columns added in Release v2.11.0.

go-jet avatar Feb 28 '24 13:02 go-jet