schToColMap returns a map of columns, keyed by their name, for the specified schema |sch|.
(sch sql.Schema)
| 106 | // schToColMap returns a map of columns, keyed by their name, for the specified |
| 107 | // schema |sch|. |
| 108 | func schToColMap(sch sql.Schema) map[string]*sql.Column { |
| 109 | colMap := make(map[string]*sql.Column, len(sch)) |
| 110 | for _, col := range sch { |
| 111 | colMap[strings.ToLower(col.Name)] = col |
| 112 | } |
| 113 | return colMap |
| 114 | } |
| 115 | |
| 116 | // validateIndex ensures that the Index Definition is valid for the table schema. |
| 117 | // This function will throw errors and warnings as needed. |
no outgoing calls
no test coverage detected