(
&'a self,
v: &'a CreateConnectionStatement<T>,
)
| 309 | } |
| 310 | |
| 311 | pub(crate) fn doc_create_connection<'a, T: AstInfo>( |
| 312 | &'a self, |
| 313 | v: &'a CreateConnectionStatement<T>, |
| 314 | ) -> RcDoc<'a> { |
| 315 | let mut docs = Vec::new(); |
| 316 | |
| 317 | let mut title = "CREATE CONNECTION".to_string(); |
| 318 | if v.if_not_exists { |
| 319 | title.push_str(" IF NOT EXISTS"); |
| 320 | } |
| 321 | docs.push(nest_title(title, self.doc_display_pass(&v.name))); |
| 322 | |
| 323 | let connection_with_values = nest( |
| 324 | RcDoc::concat([ |
| 325 | RcDoc::text("TO "), |
| 326 | self.doc_display_pass(&v.connection_type), |
| 327 | ]), |
| 328 | bracket( |
| 329 | "(", |
| 330 | comma_separate(|val| self.doc_display_pass(val), &v.values), |
| 331 | ")", |
| 332 | ), |
| 333 | ); |
| 334 | docs.push(connection_with_values); |
| 335 | |
| 336 | if !v.with_options.is_empty() { |
| 337 | docs.push(bracket( |
| 338 | "WITH (", |
| 339 | comma_separate(|wo| self.doc_display_pass(wo), &v.with_options), |
| 340 | ")", |
| 341 | )); |
| 342 | } |
| 343 | |
| 344 | RcDoc::intersperse(docs, Doc::line()).group() |
| 345 | } |
| 346 | |
| 347 | pub(crate) fn doc_create_sink<'a, T: AstInfo>( |
| 348 | &'a self, |
no test coverage detected