Skip to main content

encode_rows

Function encode_rows 

Source
pub fn encode_rows(rows: &[Value], project: &[Col]) -> Vec<u8> 
Expand description

Encode just the rows: T followed by one D per row, and NO CommandComplete.

Split out because a write with RETURNING must emit T/D* and then its OWN tag (INSERT 0 3, UPDATE 1). The first cut called encode_result there, which appends CommandComplete("SELECT n") — so one statement sent TWO CommandComplete messages. That is a protocol violation, and the visible symptom was RETURNING silently yielding no rows at all: the client took the first tag as the end of the statement and discarded the description.