MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / set_encode_state

Method set_encode_state

src/pgwire/src/codec.rs:141–146  ·  view source on GitHub ↗

Injects state that affects how certain backend messages are encoded. Specifically, the encoding of `BackendMessage::DataRow` depends upon the types of the datums in the row. To avoid including the same type information in each message, we use this side channel to install the type information in the codec before sending any data row messages. This violates the abstraction boundary a bit but result

(
        &mut self,
        encode_state: Vec<(mz_pgrepr::Type, mz_pgwire_common::Format)>,
    )

Source from the content-addressed store, hash-verified

139 /// violates the abstraction boundary a bit but results in much better
140 /// performance.
141 pub fn set_encode_state(
142 &mut self,
143 encode_state: Vec<(mz_pgrepr::Type, mz_pgwire_common::Format)>,
144 ) {
145 self.inner.get_mut().codec_mut().encode_state = encode_state;
146 }
147
148 /// Enables or disables copy mode on the codec.
149 ///

Callers 1

send_rowsMethod · 0.80

Calls 1

get_mutMethod · 0.45

Tested by

no test coverage detected