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

Method doc_webhook_check

src/sql-pretty/src/doc.rs:160–193  ·  view source on GitHub ↗
(
        &'a self,
        v: &'a CreateWebhookSourceCheck<T>,
    )

Source from the content-addressed store, hash-verified

158 }
159
160 fn doc_webhook_check<'a, T: AstInfo>(
161 &'a self,
162 v: &'a CreateWebhookSourceCheck<T>,
163 ) -> RcDoc<'a> {
164 let mut inner = Vec::new();
165
166 if let Some(options) = &v.options {
167 let mut with_items = Vec::new();
168
169 for header in &options.headers {
170 with_items.push(self.doc_display_pass(header));
171 }
172 for body in &options.bodies {
173 with_items.push(self.doc_display_pass(body));
174 }
175 for secret in &options.secrets {
176 with_items.push(self.doc_display_pass(secret));
177 }
178
179 if !with_items.is_empty() {
180 inner.push(bracket("WITH (", comma_separated(with_items), ")"));
181 inner.push(RcDoc::line());
182 }
183 }
184
185 inner.push(self.doc_display_pass(&v.using));
186
187 bracket_doc(
188 RcDoc::text("CHECK ("),
189 RcDoc::concat(inner),
190 RcDoc::text(")"),
191 RcDoc::line(),
192 )
193 }
194
195 pub(crate) fn doc_create_table<'a, T: AstInfo>(
196 &'a self,

Callers 1

Calls 7

bracketFunction · 0.85
bracket_docFunction · 0.85
concatFunction · 0.85
doc_display_passMethod · 0.80
comma_separatedFunction · 0.70
pushMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected