Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 4
0
 def construct(self):
     left = construct(self.left)
     right = construct(self.right)
     operator = construct(self.operator)
     return left + " " + operator + " " + right
Exemplo n.º 5
0
 def construct(self):
     key = construct(self.key)
     value = construct(self.value)
     operator = construct(self.operator)
     return key + " " + operator + " " + value
Exemplo n.º 6
0
 def construct(self):
     return construct(self.left) + " UNION " + construct(self.right)
Exemplo n.º 7
0
 def construct(self):
     query = construct(self.query)
     check = construct(self.operator) + " " + construct(self.argument)
     return query + with_parens(check, combo="[]")
Exemplo n.º 8
0
 def construct(self):
     return "not " + construct(self.value)
Exemplo n.º 9
0
 def construct(self):
     return construct(EdgeQLCast("uuid", repr(str(self.value.id))))
Exemplo n.º 10
0
 def construct(self):
     return construct(self.base) + "." + self.attr