func writeQueryMsg(buf *pool.Buffer, query interface{}, params ...interface{}) error { buf.StartMessage(queryMsg) bytes, err := orm.AppendQuery(buf.Bytes, query, params...) if err != nil { buf.Reset() return err } buf.Bytes = bytes buf.WriteByte(0x0) buf.FinishMessage() return nil }
func writeParseDescribeSyncMsg(buf *pool.Buffer, name, q string) { buf.StartMessage(parseMsg) buf.WriteString(name) buf.WriteString(q) buf.WriteInt16(0) buf.FinishMessage() buf.StartMessage(describeMsg) buf.WriteByte('S') buf.WriteString(name) buf.FinishMessage() buf.StartMessage(syncMsg) buf.FinishMessage() }