Exemple #1
0
class Client(object):
    def __init__(self, host="localhost", port=6379, verbose=False):
        self.engine = Engine(host=host, port=port, verbose=verbose)
        self.lexer = SqlLexer().build()
        self.parser = SqlParser().build()

    def query(self, sql):
        ast = self.parser.parse(sql, lexer=self.lexer)
        if ast:
            result = self.engine.execute(ast)
            return result
Exemple #2
0
class Client(object):
    def __init__(self, host="localhost", port=6379, verbose=False):
        self.engine = Engine(host=host, port=port, verbose=verbose)
        self.lexer = SqlLexer().build()
        self.parser = SqlParser().build()

    def query(self, sql):
        ast = self.parser.parse(sql, lexer=self.lexer)
        if ast:
            result = self.engine.execute(ast)
            return result
Exemple #3
0
 def __init__(self, host="localhost", port=6379, verbose=False):
     self.engine = Engine(host=host, port=port, verbose=verbose)
     self.lexer = SqlLexer().build()
     self.parser = SqlParser().build()
Exemple #4
0
 def __init__(self, host="localhost", port=6379, verbose=False):
     self.engine = Engine(host=host, port=port, verbose=verbose)
     self.lexer = SqlLexer().build()
     self.parser = SqlParser().build()
Exemple #5
0
 def _process(self, sql, parsed_sql, select_clause, from_clause):
     p = SqlParser()
     results = p.parse(sql)
     self.assertEqual(str(results), str(parsed_sql))
     self.assertEqual(str(results.select_clause), str(select_clause))
     self.assertEqual(list(results.from_clause), from_clause)
Exemple #6
0
 def _process(self, sql, parsed_sql, select_clause, from_clause):
     p = SqlParser()
     results = p.parse(sql)
     self.assertEqual(str(results), str(parsed_sql))
     self.assertEqual(str(results.select_clause), str(select_clause))
     self.assertEqual(list(results.from_clause), from_clause)