jet/generator/metadata/table_meta_data.go
Jupp Mueller bffec36917
Improve performance of mysql generator
This change improves performance for generating mysql models
for databases with large number of tables. In my local testing
for a database with about 1000 tables and 140k columns, generation
time was reduced from about 1h to less than one second.
2024-02-17 05:35:56 -08:00

22 lines
390 B
Go

package metadata
// Table metadata struct
type Table struct {
Name string `sql:"primary_key"`
Columns []Column
}
// MutableColumns returns list of mutable columns for table
func (t Table) MutableColumns() []Column {
var ret []Column
for _, column := range t.Columns {
if column.IsPrimaryKey || column.IsGenerated {
continue
}
ret = append(ret, column)
}
return ret
}