MCPcopy Create free account
hub / github.com/araddon/qlbridge / MarshalTo

Method MarshalTo

rel/sql.pb.go:713–752  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

711}
712
713func (m *SqlStatementPb) MarshalTo(data []byte) (int, error) {
714 var i int
715 _ = i
716 var l int
717 _ = l
718 if m.Select != nil {
719 data[i] = 0xa
720 i++
721 i = encodeVarintSql(data, i, uint64(m.Select.Size()))
722 n1, err := m.Select.MarshalTo(data[i:])
723 if err != nil {
724 return 0, err
725 }
726 i += n1
727 }
728 if m.Source != nil {
729 data[i] = 0x12
730 i++
731 i = encodeVarintSql(data, i, uint64(m.Source.Size()))
732 n2, err := m.Source.MarshalTo(data[i:])
733 if err != nil {
734 return 0, err
735 }
736 i += n2
737 }
738 if m.Projection != nil {
739 data[i] = 0x22
740 i++
741 i = encodeVarintSql(data, i, uint64(m.Projection.Size()))
742 n3, err := m.Projection.MarshalTo(data[i:])
743 if err != nil {
744 return 0, err
745 }
746 i += n3
747 }
748 if m.XXX_unrecognized != nil {
749 i += copy(data[i:], m.XXX_unrecognized)
750 }
751 return i, nil
752}
753
754func (m *SqlSelectPb) Marshal() (data []byte, err error) {
755 size := m.Size()

Callers 1

MarshalMethod · 0.95

Calls 3

encodeVarintSqlFunction · 0.85
SizeMethod · 0.45
MarshalToMethod · 0.45

Tested by

no test coverage detected