parse_view_select = (view, relation) => {
  if (relation) {
    const { sourcetable, path } =
      relation === Relation.fixedUserRelation
        ? { sourcetable: "users", path: [] }
        : parseRelationPath(relation);
    return {
      type: "RelationPath",
      viewname: view,
      sourcetable,
      path,
    };
  } else {
    // legacy relation path
    const colonSplit = view.split(":");
    if (colonSplit.length === 1) return { type: "Own", viewname: view };
    const [type, vrest] = colonSplit;
    switch (type) {
      case "Own":
        return { type, viewname: vrest };
      case "ChildList":
      case "OneToOneShow":
        const [viewnm, tbl, fld, throughTable, through] = vrest.split(".");
        return {
          type,
          viewname: viewnm,
          table_name: tbl,
          field_name: fld,
          throughTable,
          through,
        };
      case "ParentShow":
        const [pviewnm, ptbl, pfld] = vrest.split(".");
        return { type, viewname: pviewnm, table_name: ptbl, field_name: pfld };
      case "Independent":
        return { type, viewname: vrest };
    }
  }
}
@param {string} view name of the view or a legacy relation (type:telation)
@param {string} relation new relation path syntax
@returns {object}