(data []byte)
| 762 | } |
| 763 | |
| 764 | func (m *SqlSelectPb) MarshalTo(data []byte) (int, error) { |
| 765 | var i int |
| 766 | _ = i |
| 767 | var l int |
| 768 | _ = l |
| 769 | data[i] = 0xa |
| 770 | i++ |
| 771 | i = encodeVarintSql(data, i, uint64(len(m.Db))) |
| 772 | i += copy(data[i:], m.Db) |
| 773 | data[i] = 0x12 |
| 774 | i++ |
| 775 | i = encodeVarintSql(data, i, uint64(len(m.Raw))) |
| 776 | i += copy(data[i:], m.Raw) |
| 777 | data[i] = 0x18 |
| 778 | i++ |
| 779 | if m.Star { |
| 780 | data[i] = 1 |
| 781 | } else { |
| 782 | data[i] = 0 |
| 783 | } |
| 784 | i++ |
| 785 | data[i] = 0x20 |
| 786 | i++ |
| 787 | if m.Distinct { |
| 788 | data[i] = 1 |
| 789 | } else { |
| 790 | data[i] = 0 |
| 791 | } |
| 792 | i++ |
| 793 | if len(m.Columns) > 0 { |
| 794 | for _, msg := range m.Columns { |
| 795 | data[i] = 0x2a |
| 796 | i++ |
| 797 | i = encodeVarintSql(data, i, uint64(msg.Size())) |
| 798 | n, err := msg.MarshalTo(data[i:]) |
| 799 | if err != nil { |
| 800 | return 0, err |
| 801 | } |
| 802 | i += n |
| 803 | } |
| 804 | } |
| 805 | if len(m.From) > 0 { |
| 806 | for _, msg := range m.From { |
| 807 | data[i] = 0x32 |
| 808 | i++ |
| 809 | i = encodeVarintSql(data, i, uint64(msg.Size())) |
| 810 | n, err := msg.MarshalTo(data[i:]) |
| 811 | if err != nil { |
| 812 | return 0, err |
| 813 | } |
| 814 | i += n |
| 815 | } |
| 816 | } |
| 817 | if m.Into != nil { |
| 818 | data[i] = 0x3a |
| 819 | i++ |
| 820 | i = encodeVarintSql(data, i, uint64(len(*m.Into))) |
| 821 | i += copy(data[i:], *m.Into) |
no test coverage detected