(c *gin.Context)
| 129 | Name string |
| 130 | } |
| 131 | |
| 132 | func (a autoTable) key() string { return autoKeyPrefix + a.Schema + "." + a.Name } |
| 133 | func (a autoTable) label() string { return a.Name } |
| 134 | |
| 135 | // discoverTables lists every base table in the config schema (current_schema) |
| 136 | // and the CP runtime schema that is NOT already covered by a typed descriptor. |
| 137 | // Reading information_schema fresh per request keeps the explorer honest: a |
| 138 | // table created by a migration or AutoMigrate after boot appears immediately. |
| 139 | func (h *modelsHandler) discoverTables() ([]autoTable, error) { |
| 140 | covered := map[string]struct{}{} |
| 141 | for _, d := range modelDescriptors() { |
| 142 | covered[d.Table] = struct{}{} |
| 143 | } |
| 144 | runtimeSchema := h.store.RuntimeSchema() |
| 145 | |
| 146 | type row struct { |
| 147 | TableSchema string |
| 148 | TableName string |
| 149 | } |
| 150 | var rows []row |
| 151 | err := h.store.DB().Raw(` |
| 152 | SELECT table_schema, table_name |
| 153 | FROM information_schema.tables |
no test coverage detected