common/schema: use an ordered map for columns

For ClickHouse, we can iterate, but for other aspects, we need a direct
access.
This commit is contained in:
Vincent Bernat
2023-01-03 17:45:50 +01:00
parent 4dcde85523
commit aae92e7fe0
7 changed files with 47 additions and 44 deletions

View File

@@ -6,9 +6,12 @@
// will use it.
package schema
import orderedmap "github.com/elliotchance/orderedmap/v2"
// Schema is the data schema.
type Schema struct {
Columns []Column
// We use an ordered map for direct access to columns.
Columns *orderedmap.OrderedMap[string, Column]
// For ClickHouse. This is the set of primary keys (order is important and
// may not follow column order).