Example #1
0
 def construct(self):
     query = "FOR "
     query += construct(self.target)
     query += " in "
     query += construct(self.iterator)
     query += " UNION "
     query += construct(self.generator)
     return query
Example #2
0
 def construct(self):
     query = "WITH"
     query += " __items := "
     query += construct(self.items)
     query += ", "
     query += "FOR __item IN {enumerate(__items)} "
     query += "UNION (SELECT __item.1 { @index := __item.0 })"
     return query
Example #3
0
    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
Example #4
0
 def construct(self):
     left = construct(self.left)
     right = construct(self.right)
     operator = construct(self.operator)
     return left + " " + operator + " " + right
Example #5
0
 def construct(self):
     key = construct(self.key)
     value = construct(self.value)
     operator = construct(self.operator)
     return key + " " + operator + " " + value
Example #6
0
 def construct(self):
     return construct(self.left) + " UNION " + construct(self.right)
Example #7
0
 def construct(self):
     query = construct(self.query)
     check = construct(self.operator) + " " + construct(self.argument)
     return query + with_parens(check, combo="[]")
Example #8
0
 def construct(self):
     return "not " + construct(self.value)
Example #9
0
 def construct(self):
     return construct(EdgeQLCast("uuid", repr(str(self.value.id))))
Example #10
0
 def construct(self):
     return construct(self.base) + "." + self.attr