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

Method join

src/ore/src/sql.rs:169–181  ·  view source on GitHub ↗

Joins SQL fragments with a static separator.

(parts: impl IntoIterator<Item = Sql>, separator: &'static str)

Source from the content-addressed store, hash-verified

167
168 /// Joins SQL fragments with a static separator.
169 pub fn join(parts: impl IntoIterator<Item = Sql>, separator: &'static str) -> Self {
170 let mut iter = parts.into_iter();
171 let Some(first) = iter.next() else {
172 return Self(Cow::Borrowed(""));
173 };
174
175 let mut out = first.0;
176 for part in iter {
177 out.to_mut().push_str(separator);
178 out.to_mut().push_str(part.as_str());
179 }
180 Self(out)
181 }
182
183 /// Formats this SQL fragment by replacing each `{}` with the next SQL argument.
184 ///

Callers 15

buildCspFunction · 0.45
labelFromQueryKeyFunction · 0.45
labelRequestFunction · 0.45
printConcurrencySummaryFunction · 0.45
summarizeActiveQueriesFunction · 0.45
kebabToSentenceCaseFunction · 0.45
kebabToTitleCaseFunction · 0.45
snakeToCamelCaseFunction · 0.45
snakeToSentenceCaseFunction · 0.45
buildRegexFunction · 0.45

Calls 3

into_iterMethod · 0.45
nextMethod · 0.45
as_strMethod · 0.45

Tested by 15

insertActivityLogFunction · 0.36
populateFunction · 0.36
validateFunction · 0.36
populateFunction · 0.36
timeoutFunction · 0.36
test_large_catalog_itemFunction · 0.36
test_get_users_v3Function · 0.36
test_balancerFunction · 0.36