diff options
| author | Vik <vmuriart@users.noreply.github.com> | 2016-06-06 06:29:25 -0700 |
|---|---|---|
| committer | Vik <vmuriart@users.noreply.github.com> | 2016-06-06 06:29:25 -0700 |
| commit | b9d81ac4fe49114f57dc33c0d635f99ff56e62f2 (patch) | |
| tree | 88642eeb84d318511191a822fd781b44e1d63df1 /sqlparse/functions.py | |
| parent | c6a5e7ac2a5ecc993f4e5292ab16e6df6b84f26c (diff) | |
| parent | 5747015634a39191511de8db576f2cd0aa5eafc9 (diff) | |
| download | sqlparse-b9d81ac4fe49114f57dc33c0d635f99ff56e62f2.tar.gz | |
Merge pull request #251 from andialbrecht/filters_sql
Update Filters sql
Diffstat (limited to 'sqlparse/functions.py')
| -rw-r--r-- | sqlparse/functions.py | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/sqlparse/functions.py b/sqlparse/functions.py deleted file mode 100644 index e54457e..0000000 --- a/sqlparse/functions.py +++ /dev/null @@ -1,44 +0,0 @@ -''' -Created on 17/05/2012 - -@author: piranna - -Several utility functions to extract info from the SQL sentences -''' - -from sqlparse.filters import ColumnsSelect, Limit -from sqlparse.pipeline import Pipeline -from sqlparse.tokens import Keyword, Whitespace - - -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 - - -def getcolumns(stream): - """Function that return the colums of a SELECT query""" - pipe = Pipeline() - - pipe.append(ColumnsSelect()) - - return pipe(stream) - - -class IsType(object): - """Functor that return is the statement is of a specific type""" - def __init__(self, type): - self.type = type - - def __call__(self, stream): - for token_type, value in stream: - if token_type not in Whitespace: - return token_type in Keyword and value == self.type |
