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

Function relation_desc

src/clusterd-test-driver/src/script.rs:207–219  ·  view source on GitHub ↗

Build a [`RelationDesc`] from column specs.

(columns: &[ColumnSpec])

Source from the content-addressed store, hash-verified

205
206/// Build a [`RelationDesc`] from column specs.
207fn relation_desc(columns: &[ColumnSpec]) -> anyhow::Result<RelationDesc> {
208 let mut builder = RelationDesc::builder();
209 for col in columns {
210 builder = builder.with_column(
211 col.name.as_str(),
212 SqlColumnType {
213 scalar_type: scalar_type_from_str(&col.ty)?,
214 nullable: col.nullable,
215 },
216 );
217 }
218 Ok(builder.finish())
219}
220
221/// Strip surrounding double quotes from a token, if present.
222fn unquote(s: &str) -> &str {

Callers 2

executeMethod · 0.85
schema_parse_and_synthFunction · 0.85

Calls 4

scalar_type_from_strFunction · 0.85
with_columnMethod · 0.80
as_strMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected