<s> from engine import Engine <EOL> from sqlparser import SqlLexer , SqlParser <EOL> class Client ( object ) : <EOL> def __init__ ( self , host = "<STR_LIT:localhost>" , port = <NUM_LIT> , verbose = False ) : <EOL> self . engine = Engine ( host = host , port = port , verbose = verbose ) <EOL> self . lexer = SqlLexer ( ) . build ( ) <EOL> self . parser = SqlParser ( ) . build ( ) <EOL> def query ( self , sql ) : <EOL> ast = self . parser . parse ( sql , lexer = self . lexer ) <EOL> if ast : <EOL> result = self . engine . execute ( ast ) <EOL> return result <EOL> def unittest ( ) : <EOL> import pprint <EOL> c = Client ( "<STR_LIT>" ) <EOL> c . query ( "<STR_LIT>" ) <EOL> c . query ( "<STR_LIT>" ) <EOL> c . query ( "<STR_LIT>" ) <EOL> c . query ( "<STR_LIT>" ) <EOL> c . query ( "<STR_LIT>" ) <EOL> pprint . pprint ( c . query ( "<STR_LIT>" ) ) <EOL> print "<STR_LIT:->" * <NUM_LIT> <EOL> pprint . pprint ( c . query ( "<STR_LIT>" ) ) <EOL> print "<STR_LIT:->" * <NUM_LIT> <EOL> pprint . pprint ( c . query ( "<STR_LIT>" ) ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest ( ) </s>
