(pb *SqlSourcePb)
| 1660 | return &s |
| 1661 | } |
| 1662 | func SqlSourceFromPb(pb *SqlSourcePb) *SqlSource { |
| 1663 | s := SqlSource{ |
| 1664 | final: pb.GetFinal(), |
| 1665 | alias: pb.GetAliasInner(), |
| 1666 | colIndex: MapIntFromPb(pb.GetColIndex()), |
| 1667 | joinNodes: expr.NodesFromNodesPbPtr(pb.GetJoinNodes()), |
| 1668 | Raw: pb.GetRaw(), |
| 1669 | Name: pb.GetName(), |
| 1670 | Alias: pb.GetAlias(), |
| 1671 | Op: lex.TokenType(pb.GetOp()), |
| 1672 | LeftOrRight: lex.TokenType(pb.GetLeftOrRight()), |
| 1673 | JoinType: lex.TokenType(pb.GetJoinType()), |
| 1674 | JoinExpr: expr.NodeFromNodePb(pb.GetJoinExpr()), |
| 1675 | Seekable: pb.GetSeekable(), |
| 1676 | } |
| 1677 | if pb.Source != nil { |
| 1678 | s.Source = SqlSelectFromPb(pb.Source) |
| 1679 | } else { |
| 1680 | //u.Debugf("no source for SqlSource? %+v", pb) |
| 1681 | } |
| 1682 | if pb.SubQuery != nil { |
| 1683 | s.SubQuery = SqlSelectFromPb(pb.SubQuery) |
| 1684 | } |
| 1685 | if len(pb.Columns) > 0 { |
| 1686 | s.cols = make(map[string]*Column, len(pb.Columns)) |
| 1687 | for _, pbc := range pb.Columns { |
| 1688 | col := columnFromPb(pbc) |
| 1689 | s.cols[col.As] = col |
| 1690 | } |
| 1691 | } |
| 1692 | return &s |
| 1693 | } |
| 1694 | |
| 1695 | func (m *SqlWhere) Keyword() lex.TokenType { return m.Op } |
| 1696 | func (m *SqlWhere) writeDialectDepth(depth int, w expr.DialectWriter) { |
no test coverage detected