(&self, f: &mut AstFormatter<W>)
| 44 | |
| 45 | impl<T: AstInfo> AstDisplay for Query<T> { |
| 46 | fn fmt<W: fmt::Write>(&self, f: &mut AstFormatter<W>) { |
| 47 | f.write_node(&self.ctes); |
| 48 | f.write_node(&self.body); |
| 49 | if !self.order_by.is_empty() { |
| 50 | f.write_str(" ORDER BY "); |
| 51 | f.write_node(&display::comma_separated(&self.order_by)); |
| 52 | } |
| 53 | |
| 54 | let write_offset = |f: &mut AstFormatter<W>| { |
| 55 | if let Some(offset) = &self.offset { |
| 56 | f.write_str(" OFFSET "); |
| 57 | f.write_node(offset); |
| 58 | } |
| 59 | }; |
| 60 | |
| 61 | if let Some(limit) = &self.limit { |
| 62 | if limit.with_ties { |
| 63 | write_offset(f); |
| 64 | f.write_str(" FETCH FIRST "); |
| 65 | f.write_node(&limit.quantity); |
| 66 | f.write_str(" ROWS WITH TIES"); |
| 67 | } else { |
| 68 | f.write_str(" LIMIT "); |
| 69 | f.write_node(&limit.quantity); |
| 70 | write_offset(f); |
| 71 | } |
| 72 | } else { |
| 73 | write_offset(f); |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | impl_display_t!(Query); |
| 78 |
nothing calls this directly
no test coverage detected