pathToState = (relation, getRowVal) => {
  const sourceTbl = Table.findOne({ name: relation.sourceTblName });
  const pkName = sourceTbl?.pk_name || "id";
  const path = relation.path;
  switch (relation.type) {
    case RelationType.CHILD_LIST:
    case RelationType.ONE_TO_ONE_SHOW:
      return path.length === 1
        ? { [path[0].inboundKey]: getRowVal(pkName) }
        : {
            [`${path[1].table}.${path[1].inboundKey}.${path[0].table}.${path[0].inboundKey}`]:
              getRowVal(pkName),
          };
    case RelationType.PARENT_SHOW:
      const targetTable = Table.findOne({ name: relation.targetTblName });
      return { [targetTable?.pk_name || "id"]: getRowVal(path[0].fkey) };
    case RelationType.OWN:
      return { [pkName]: getRowVal(pkName) };
    case RelationType.INDEPENDENT:
    case RelationType.NONE:
      return {};
    case RelationType.RELATION_PATH:
      return relation.isFixedRelation()
        ? {
            [pkName]: getRowVal(pkName),
          }
        : {
            [relation.relationString]:
              getRowVal(path[0].fkey ? path[0].fkey : pkName) || "NULL",
          };
  }
}
@param {Relation} relation
@param {function} getRowVal