def getcolumns(stream): """Function that return the colums of a SELECT query""" pipe = Pipeline() pipe.append(ColumnsSelect()) return pipe(stream)
def compact(stream): """Function that return a compacted version of the stream""" pipe = Pipeline() pipe.append(StripComments()) pipe.append(StripWhitespace) return pipe(stream)
def getlimit(stream): """Function that return the LIMIT of a input SQL """ pipe = Pipeline() pipe.append(Limit()) result = pipe(stream) try: return int(result) except ValueError: return result