(tables schema.Tables)
| 44 | } |
| 45 | |
| 46 | func sortTables(tables schema.Tables) { |
| 47 | sort.SliceStable(tables, func(i, j int) bool { |
| 48 | return tables[i].Name < tables[j].Name |
| 49 | }) |
| 50 | |
| 51 | for _, table := range tables { |
| 52 | sortTables(table.Relations) |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | // NewGenerator creates a new generator for the given tables. |
| 57 | // The tables are sorted by name. pluginName is optional and is used in markdown only |