def build_db_query(fields_names, field_values):
    """ method builds query dictionary by zipping together DB field names with the field values """
    if not isinstance(field_values, (list, tuple)):
        field_values = [field_values]
    if len(fields_names) != len(field_values):
        raise ValueError(
            f'Error: unable to build a primary key query due to mismatch in number of fields {len(fields_names)} vs {len(field_values)}'
            )
    query = dict()
    for k, v in zip(fields_names, field_values):
        query[k] = v
    return query
