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

Function encode_row_description

src/pgwire/src/message.rs:95–114  ·  view source on GitHub ↗
(
    desc: &RelationDesc,
    formats: &[mz_pgwire_common::Format],
)

Source from the content-addressed store, hash-verified

93}
94
95pub fn encode_row_description(
96 desc: &RelationDesc,
97 formats: &[mz_pgwire_common::Format],
98) -> Vec<FieldDescription> {
99 desc.iter()
100 .zip_eq(formats)
101 .map(|((name, typ), format)| {
102 let pg_type = mz_pgrepr::Type::from(&typ.scalar_type);
103 FieldDescription {
104 name: name.clone(),
105 table_id: 0,
106 column_id: 0,
107 type_oid: pg_type.oid(),
108 type_len: pg_type.typlen(),
109 type_mod: pg_type.typmod(),
110 format: *format,
111 }
112 })
113 .collect()
114}

Callers 2

one_queryMethod · 0.85
describe_rowsFunction · 0.85

Calls 7

typlenMethod · 0.80
typmodMethod · 0.80
collectMethod · 0.45
mapMethod · 0.45
iterMethod · 0.45
cloneMethod · 0.45
oidMethod · 0.45

Tested by

no test coverage detected