diff options
| author | Demetrio92 <Demetrio.Rodriguez.T@gmail.com> | 2017-09-14 15:09:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-14 15:09:38 +0200 |
| commit | bd017ce9d9324bc1d6fada3e36401e7a7641e6fb (patch) | |
| tree | 639ee699c334312556e48bccd728bfc3a3cafb3e /sqlparse | |
| parent | 7d91d361ad8c26af3fe0a15b807db4cefa5d000a (diff) | |
| parent | c48a221e72dfc0a6631a16e5e42e768249919090 (diff) | |
| download | sqlparse-bd017ce9d9324bc1d6fada3e36401e7a7641e6fb.tar.gz | |
Merge pull request #1 from Demetrio92/plpgsql-syntax
add PL/pgSQL syntax
Diffstat (limited to 'sqlparse')
| -rw-r--r-- | sqlparse/keywords.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sqlparse/keywords.py b/sqlparse/keywords.py index 40022b9..c9b41d6 100644 --- a/sqlparse/keywords.py +++ b/sqlparse/keywords.py @@ -14,6 +14,7 @@ def is_keyword(value): val = value.upper() return (KEYWORDS_COMMON.get(val) or KEYWORDS_ORACLE.get(val) or + KEYWORDS_PLPGSQL.get(val) or KEYWORDS.get(val, tokens.Name)), value @@ -800,3 +801,18 @@ KEYWORDS_ORACLE = { 'UNLIMITED': tokens.Keyword, 'UNLOCK': tokens.Keyword, } + +# PostgreSQL Syntax +KEYWORDS_PLPGSQL = { + 'PARTITION': tokens.Keyword, + 'OVER': tokens.Keyword, + 'PERFORM': tokens.Keyword, + 'NOTICE': tokens.Keyword, + 'PLPGSQL': tokens.Keyword, + 'INHERIT': tokens.Keyword, + 'INDEXES': tokens.Keyword, + + 'FOR': tokens.Keyword, + 'IN': tokens.Keyword, + 'LOOP': tokens.Keyword, +} |
