Record table column(s) and primary key columns by specified order.

def order_table_columns(table: Table, column_names: list) -> Table:
    """Record table column(s) and primary key columns by specified order."""

    unordered_columns = table.column_names
    index_order = (unordered_columns.index(name) for name in column_names)
    ordered_columns = [table.columns[i] for i in index_order]
    ordered_pkey_names = [column for column in column_names
                          if column in table.primary_key_columns]
    primary_key = PrimaryKey(ordered_pkey_names)

    return Table(table.name, ordered_columns, primary_key, table.schema)