def construct(self): selector = self.selector if self.inner_selections: selector += ": " selector += with_parens( ", ".join(construct_sequence(self.inner_selections)), combo="{}", ) return selector
def construct(self): query = "INSERT" query += " " + protected_name(self.name) if self.fields: query += " " + with_parens( ", ".join( f"{protected_name(key, prefix=False)} := {construct(value)}" for key, value in self.fields.items()), combo="{}", ) return query
def construct(self): query = "UPDATE" query += " " + protected_name(self.name) if self.filters is not None: query += f" FILTER {construct(self.filters)}" query += " SET" query += " " + with_parens( ", ".join( f"{protected_name(key, prefix=False)} := {construct(value)}" for key, value in self.assigns.items()), combo="{}", ) return query
def construct(self): if self.with_block: query = construct(self.with_block, top_level=True) + " SELECT" else: query = "SELECT" query += " " + protected_construct(self.name) if self.selections: query += with_parens(", ".join(construct_sequence( self.selections)), combo="{}") if self.filters is not None: query += f" FILTER {construct(self.filters)}" if self.ordered is not None: query += f" ORDER BY {construct(self.ordered)}" if self.offset is not None: query += f" OFFSET {self.offset}" if self.limit is not None: query += f" LIMIT {self.limit}" return query
def construct(self): query = construct(self.query) check = construct(self.operator) + " " + construct(self.argument) return query + with_parens(check, combo="[]")
def construct(self): body = ", ".join(construct_sequence(self.items)) return with_parens(body, combo=self.PARENS)
def construct(self): body = ", ".join(construct_sequence(self.args)) return self.func + with_parens(body)