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

Function encode_data_row

src/protocol/codec.rs:266–292  ·  view source on GitHub ↗
(values: &[Option<Vec<u8>>], dst: &mut BytesMut)

Source from the content-addressed store, hash-verified

264}
265
266fn encode_data_row(values: &[Option<Vec<u8>>], dst: &mut BytesMut) {
267 // Debug logging for array fields
268 if values.len() == 1
269 && let Some(Some(data)) = values.first()
270 && data.len() == 41 {
271 println!("DEBUG: encode_data_row sending 41-byte field (likely array with nulls)");
272 println!(" Data length being written: {}", data.len());
273 }
274
275 dst.put_u8(b'D');
276 let len_pos = dst.len();
277 dst.put_i32(0); // Placeholder
278
279 dst.put_i16(values.len() as i16);
280
281 for value in values {
282 match value {
283 None => dst.put_i32(-1),
284 Some(data) => {
285 dst.put_i32(data.len() as i32);
286 dst.put_slice(data);
287 }
288 }
289 }
290
291 update_message_length(dst, len_pos);
292}
293
294fn encode_command_complete(tag: &str, dst: &mut BytesMut) {
295 dst.put_u8(b'C');

Callers 1

encodeMethod · 0.70

Calls 2

update_message_lengthFunction · 0.85
lenMethod · 0.45

Tested by

no test coverage detected