checkPrimaryKeys checks whether primary key is missing
(schema *TableSchema, columnNames []string)
| 248 | |
| 249 | // checkPrimaryKeys checks whether primary key is missing |
| 250 | func checkPrimaryKeys(schema *TableSchema, columnNames []string) error { |
| 251 | for _, columnID := range schema.Table.PrimaryKeyColumns { |
| 252 | pkColumn := schema.Table.Columns[columnID] |
| 253 | index := utils.IndexOfStr(columnNames, pkColumn.Name) |
| 254 | if index < 0 { |
| 255 | return utils.StackError(nil, "Missing primary key column") |
| 256 | } |
| 257 | } |
| 258 | return nil |
| 259 | } |
| 260 | |
| 261 | // checkTimeColumnExistence checks if time column is missing for fact table |
| 262 | func checkTimeColumnExistence(schema *TableSchema, columnNames []string) error { |
no test coverage detected