| 1 | use crate::io::ProtocolEncode; |
| 2 | use crate::protocol::Capabilities; |
| 3 | |
| 4 | // https://dev.mysql.com/doc/internals/en/com-query.html |
| 5 | |
| 6 | #[derive(Debug)] |
| 7 | pub(crate) struct Query<'q>(pub(crate) &'q str); |
| 8 | |
| 9 | impl ProtocolEncode<'_, Capabilities> for Query<'_> { |
| 10 | fn encode_with(&self, buf: &mut Vec<u8>, _: Capabilities) -> Result<(), crate::Error> { |
| 11 | buf.push(0x03); // COM_QUERY |
| 12 | buf.extend(self.0.as_bytes()); |
| 13 | Ok(()) |
| 14 | } |
| 15 | } |