fix (codegen): don't duplicate the primary-key getter for 'without rowid' tables

This commit is contained in:
2026-09-19 21:36:31 -07:00
parent 40bc0db036
commit 9d4a1eab10
4 changed files with 17 additions and 3 deletions

View File

@@ -87,6 +87,10 @@ var generate_model = &cobra.Command{
// Skip expression indexes; there's no way to resolve an expression to a real column
continue
}
if index.Origin == "pk" && table.IsWithoutRowid {
// Already generated above, as the primary-key getter
continue
}
cols := make([]schema.Column, len(index.Columns))
for i, colName := range index.Columns {
cols[i] = table.GetColumnByName(colName)