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.
This commit is contained in:
Jupp Mueller 2024-02-03 14:35:28 -08:00
parent 61841dcfbe
commit bffec36917
No known key found for this signature in database
GPG key ID: 5867D889265636BC
3 changed files with 16 additions and 41 deletions

View file

@ -6,7 +6,7 @@ import (
// Column struct
type Column struct {
Name string
Name string `sql:"primary_key"`
IsPrimaryKey bool
IsNullable bool
IsGenerated bool

View file

@ -2,7 +2,7 @@ package metadata
// Table metadata struct
type Table struct {
Name string
Name string `sql:"primary_key"`
Columns []Column
}