()
| 844 | } |
| 845 | } |
| 846 | func (m *Column) ToPB() *ColumnPb { |
| 847 | n := ColumnPb{} |
| 848 | n.SourceQuote = []byte{m.sourceQuoteByte} |
| 849 | n.AsQuoteByte = []byte{m.asQuoteByte} |
| 850 | if len(m.originalAs) > 0 { |
| 851 | n.OriginalAs = &m.originalAs |
| 852 | } |
| 853 | if len(m.left) > 0 { |
| 854 | n.Left = &m.left |
| 855 | } |
| 856 | if len(m.right) > 0 { |
| 857 | n.Right = &m.right |
| 858 | } |
| 859 | n.ParentIndex = int32(m.ParentIndex) |
| 860 | n.Index = int32(m.Index) |
| 861 | n.SourceIndex = int32(m.SourceIndex) |
| 862 | if len(m.SourceField) > 0 { |
| 863 | n.SourceField = &m.SourceField |
| 864 | } |
| 865 | n.As = m.As |
| 866 | if len(m.Comment) > 0 { |
| 867 | n.Comment = &m.Comment |
| 868 | } |
| 869 | if len(m.Order) > 0 { |
| 870 | n.Order = &m.Order |
| 871 | } |
| 872 | if m.Star { |
| 873 | n.Star = &m.Star |
| 874 | } |
| 875 | if m.Expr != nil { |
| 876 | n.Expr = m.Expr.NodePb() |
| 877 | } |
| 878 | if m.Guard != nil { |
| 879 | n.Guard = m.Guard.NodePb() |
| 880 | } |
| 881 | return &n |
| 882 | } |
| 883 | func columnFromPb(c *ColumnPb) *Column { |
| 884 | return &Column{ |
| 885 | sourceQuoteByte: optionalByte(c.GetSourceQuote()), |
no test coverage detected