MCPcopy Create free account
hub / github.com/erans/pgsqlite / parse_parse

Method parse_parse

src/protocol/parser.rs:236–255  ·  view source on GitHub ↗
(&self, cursor: &mut Cursor<&[u8]>, _length: u32)

Source from the content-addressed store, hash-verified

234 }
235
236 async fn parse_parse(&self, cursor: &mut Cursor<&[u8]>, _length: u32) -> Result<FrontendMessage, ParseError> {
237 let statement_name = self.read_cstring(cursor).await?;
238 let query = self.read_cstring(cursor).await?;
239 let param_count = cursor.read_u16::<BigEndian>()? as usize;
240
241 if param_count > self.max_param_count {
242 return Err(ParseError::ProtocolViolation("Too many parameters".to_string()));
243 }
244
245 let mut param_types = Vec::with_capacity(param_count);
246 for _ in 0..param_count {
247 param_types.push(cursor.read_u32::<BigEndian>()? as i32);
248 }
249
250 Ok(FrontendMessage::Parse {
251 name: statement_name,
252 query,
253 param_types,
254 })
255 }
256
257 async fn parse_bind(&self, cursor: &mut Cursor<&[u8]>, _length: u32) -> Result<FrontendMessage, ParseError> {
258 let portal_name = self.read_cstring(cursor).await?;

Callers 1

parse_messageMethod · 0.80

Calls 1

read_cstringMethod · 0.80

Tested by

no test coverage detected