fix: parser no longer breaks on encountering indexes that contain expression columns
All checks were successful
CI / build-docker (push) Successful in 16s
CI / build-docker-bootstrap (push) Has been skipped
CI / release-test (push) Successful in 47s

This commit is contained in:
wispem-wantex 2025-12-12 21:54:46 -08:00
parent f74da53c37
commit 89db9e14e2
3 changed files with 4 additions and 1 deletions

View File

@ -39,6 +39,7 @@ type Index struct {
Columns []string Columns []string
IsUnique bool `db:"is_unique"` IsUnique bool `db:"is_unique"`
// TODO: `where ...` for partial indexes // TODO: `where ...` for partial indexes
// TODO: identify columns that are expressions
} }
type Schema struct { type Schema struct {

View File

@ -33,7 +33,8 @@ create temporary view indexes as
create temporary view index_columns as create temporary view index_columns as
select indexes.index_name, select indexes.index_name,
idx_cols.name as column_name, idx_cols.cid as column_idx,
ifnull(idx_cols.name, '') as column_name,
idx_cols.seqno as rank idx_cols.seqno as rank
from indexes from indexes
join pragma_index_info(indexes.index_name) as idx_cols; join pragma_index_info(indexes.index_name) as idx_cols;

View File

@ -43,6 +43,7 @@ create table foods (rowid integer primary key,
cook_ratio real not null default 1 cook_ratio real not null default 1
) strict; ) strict;
create index foods_protein on foods(protein); create index foods_protein on foods(protein);
create index foods_fake_index on foods(protein + 1);
create table units (rowid integer primary key, create table units (rowid integer primary key,