MCPcopy Index your code
hub / github.com/geldata/gel / visit_UpdateStmt

Method visit_UpdateStmt

edb/pgsql/codegen.py:503–544  ·  view source on GitHub ↗
(self, node: pgast.UpdateStmt)

Source from the content-addressed store, hash-verified

501 self.indentation -= 1
502
503 def visit_UpdateStmt(self, node: pgast.UpdateStmt) -> None:
504 if node.ctes:
505 self.write('WITH ')
506 self.gen_ctes(node.ctes)
507
508 self.write('UPDATE ')
509 self.new_lines = 1
510 self.indentation += 1
511 self.visit(node.relation)
512 self.indentation -= 1
513 self.new_lines = 1
514 self.write('SET')
515
516 self.new_lines = 1
517 self.indentation += 1
518 self.visit_list(node.targets)
519 self.indentation -= 1
520
521 if node.from_clause:
522 self.new_lines = 1
523 self.write('FROM')
524 self.new_lines = 1
525 self.indentation += 1
526 self.visit_list(node.from_clause)
527 self.indentation -= 1
528
529 if node.where_clause:
530 self.new_lines = 1
531 self.write('WHERE')
532 self.new_lines = 1
533 self.indentation += 1
534 self.visit(node.where_clause)
535 self.new_lines = 1
536 self.indentation -= 1
537
538 if node.returning_list:
539 self.new_lines = 1
540 self.write('RETURNING')
541 self.new_lines = 1
542 self.indentation += 1
543 self.visit_list(node.returning_list)
544 self.indentation -= 1
545
546 def visit_DeleteStmt(self, node: pgast.DeleteStmt) -> None:
547 if node.ctes:

Callers

nothing calls this directly

Calls 4

writeMethod · 0.95
gen_ctesMethod · 0.95
visitMethod · 0.95
visit_listMethod · 0.80

Tested by

no test coverage detected