MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / print_query

Function print_query

graphlite/src/ast/pretty_printer.rs:131–210  ·  view source on GitHub ↗
(query: &Query, indent: usize)

Source from the content-addressed store, hash-verified

129}
130
131fn print_query(query: &Query, indent: usize) {
132 match query {
133 Query::Basic(basic_query) => {
134 debug!("{}{}", get_indent(indent), "Basic Query");
135 print_basic_query(basic_query, indent + 1);
136 }
137 Query::SetOperation(set_op) => {
138 debug!("{}{}", get_indent(indent), "Set Operation Query");
139 print_set_operation(set_op, indent + 1);
140 }
141 Query::Limited {
142 query,
143 order_clause,
144 limit_clause,
145 } => {
146 debug!("{}{}", get_indent(indent), "Limited Query");
147 print_query(query, indent + 1);
148 if order_clause.is_some() {
149 debug!("{}ORDER BY clause", get_indent(indent + 1));
150 }
151 if limit_clause.is_some() {
152 debug!("{}LIMIT clause", get_indent(indent + 1));
153 }
154 }
155 Query::WithQuery(with_query) => {
156 debug!("{}{}", get_indent(indent), "WITH Query");
157 debug!(
158 "{}WITH query with {} segments",
159 get_indent(indent + 1),
160 with_query.segments.len()
161 );
162 // TODO: Implement full WITH query pretty printing
163 }
164 Query::Let(let_stmt) => {
165 debug!("{}{}", get_indent(indent), "LET Statement");
166 debug!(
167 "{}LET statement with {} variable definitions",
168 get_indent(indent + 1),
169 let_stmt.variable_definitions.len()
170 );
171 }
172 Query::For(for_stmt) => {
173 debug!("{}{}", get_indent(indent), "FOR Statement");
174 debug!(
175 "{}FOR statement with variable '{}'",
176 get_indent(indent + 1),
177 for_stmt.variable
178 );
179 }
180 Query::Filter(stmt) => {
181 debug!("{}{}", get_indent(indent), "FILTER Statement");
182 debug!("{}Where Clause", get_indent(indent + 1));
183 print_where_clause(&stmt.where_clause, indent + 2);
184 }
185 Query::Return(return_query) => {
186 debug!("{}{}", get_indent(indent), "RETURN Query");
187 print_return_query(return_query, indent + 1);
188 }

Callers 3

print_statementFunction · 0.85
print_set_operationFunction · 0.85
print_expressionFunction · 0.85

Calls 4

print_basic_queryFunction · 0.85
print_set_operationFunction · 0.85
print_where_clauseFunction · 0.85
print_return_queryFunction · 0.85

Tested by

no test coverage detected