Skip to content

Commit

Permalink
adds columns list variable without default value columns
Browse files Browse the repository at this point in the history
  • Loading branch information
charlie committed Oct 2, 2024
1 parent d17ab3d commit 51fcd35
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
15 changes: 15 additions & 0 deletions generator/metadata/table_meta_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,18 @@ func (t Table) MutableColumns() []Column {

return ret
}

// MutableNonDefaultColumns returns list of mutable non-default columns for table
func (t Table) MutableNonDefaultColumns() []Column {
var ret []Column

for _, column := range t.Columns {
if column.IsPrimaryKey || column.IsGenerated || column.HasDefault {
continue
}

ret = append(ret, column)
}

return ret
}
15 changes: 9 additions & 6 deletions generator/template/file_templates.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 51fcd35

Please sign in to comment.