summaryrefslogtreecommitdiff
path: root/pygments/lexers/_postgres_builtins.py
diff options
context:
space:
mode:
authorAdrien nayrat <adrien.nayrat@gmail.com>2023-04-04 12:49:08 +0200
committerGitHub <noreply@github.com>2023-04-04 12:49:08 +0200
commitef0abbaece522732031d61391567c017d48d87b7 (patch)
treef392c944eb11f8d271aa686deef2ffa66031c58d /pygments/lexers/_postgres_builtins.py
parent3c6e2af8fbc44bb1ef77389d09118c37faea8746 (diff)
downloadpygments-git-ef0abbaece522732031d61391567c017d48d87b7.tar.gz
Add PostgreSQL Explain lexer (#2398)
This lexer add support for PostgreSQL Explain plan : https://www.postgresql.org/docs/current/sql-explain.html This was heavily inspired by Maxence Ahlouche work, thanks to him : https://github.com/maahl/pg_explain_lexer Co-authored-by: Jean Abou Samra <jean@abou-samra.fr>
Diffstat (limited to 'pygments/lexers/_postgres_builtins.py')
-rw-r--r--pygments/lexers/_postgres_builtins.py55
1 files changed, 55 insertions, 0 deletions
diff --git a/pygments/lexers/_postgres_builtins.py b/pygments/lexers/_postgres_builtins.py
index 86fd3998..ecc2a7ee 100644
--- a/pygments/lexers/_postgres_builtins.py
+++ b/pygments/lexers/_postgres_builtins.py
@@ -571,6 +571,61 @@ PLPGSQL_KEYWORDS = (
'RETURN', 'REVERSE', 'SQLSTATE', 'WHILE',
)
+# Most of these keywords are from ExplainNode function
+# in src/backend/commands/explain.c
+
+EXPLAIN_KEYWORDS = (
+ 'Aggregate',
+ 'Append',
+ 'Bitmap Heap Scan',
+ 'Bitmap Index Scan',
+ 'BitmapAnd',
+ 'BitmapOr',
+ 'CTE Scan',
+ 'Custom Scan',
+ 'Delete',
+ 'Foreign Scan',
+ 'Function Scan',
+ 'Gather Merge',
+ 'Gather',
+ 'Group',
+ 'GroupAggregate',
+ 'Hash Join',
+ 'Hash',
+ 'HashAggregate',
+ 'Incremental Sort',
+ 'Index Only Scan',
+ 'Index Scan',
+ 'Insert',
+ 'Limit',
+ 'LockRows',
+ 'Materialize',
+ 'Memoize',
+ 'Merge Append',
+ 'Merge Join',
+ 'Merge',
+ 'MixedAggregate',
+ 'Named Tuplestore Scan',
+ 'Nested Loop',
+ 'ProjectSet',
+ 'Recursive Union',
+ 'Result',
+ 'Sample Scan',
+ 'Seq Scan',
+ 'SetOp',
+ 'Sort',
+ 'SubPlan',
+ 'Subquery Scan',
+ 'Table Function Scan',
+ 'Tid Range Scan',
+ 'Tid Scan',
+ 'Unique',
+ 'Update',
+ 'Values Scan',
+ 'WindowAgg',
+ 'WorkTable Scan',
+)
+
if __name__ == '__main__': # pragma: no cover
import re