def get_id_constraints(pkname, pkey):
    """Returns primary key consraints.

  :pkname: if a string, returns a dict with pkname=pkey. pkname and pkey must be enumerables of
  matching length.
  """
    if isinstance(pkname, str):
        return {pkname: pkey}
    else:
        return dict(zip(pkname, pkey))
