From 171f4b45559b19857d4afbb2cf23f9e404bd8f8a Mon Sep 17 00:00:00 2001 From: andrew Date: Fri, 22 Nov 2024 18:10:32 +0300 Subject: [PATCH 1/3] more keywords to id --- mindsdb_sql_parser/parser.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/mindsdb_sql_parser/parser.py b/mindsdb_sql_parser/parser.py index 44aa2dc..8dd87d8 100644 --- a/mindsdb_sql_parser/parser.py +++ b/mindsdb_sql_parser/parser.py @@ -1847,8 +1847,26 @@ def function_name(self, p): 'HANDLERS', 'BINARY', 'KNOWLEDGE_BASES', + 'KNOWLEDGE_BASE', 'ALL', 'CREATE', + 'SKILL', + 'FINETUNE', + 'IF', + 'EXISTS', + 'EVERY', + 'ANOMALY', + 'ML_ENGINE', + 'EVALUATE', + 'DETECTION', + 'JOB', + # fixme + # 'EXCEPT', + # 'INTERSECT', + 'PROJECT', + 'TRIGGER', + 'CHATBOT', + 'SEARCH_PATH' ) def id(self, p): return p[0] From d74ae8d0faf39a72852e899a3d1daf92b808ecd4 Mon Sep 17 00:00:00 2001 From: andrew Date: Fri, 22 Nov 2024 18:12:18 +0300 Subject: [PATCH 2/3] dialect arg for back compatibility --- mindsdb_sql_parser/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mindsdb_sql_parser/__init__.py b/mindsdb_sql_parser/__init__.py index 3ecc30f..f185268 100644 --- a/mindsdb_sql_parser/__init__.py +++ b/mindsdb_sql_parser/__init__.py @@ -161,7 +161,7 @@ def query_is_valid(self, tokens): return ast is not None -def parse_sql(sql): +def parse_sql(sql, dialect=None): from mindsdb_sql_parser.lexer import MindsDBLexer from mindsdb_sql_parser.parser import MindsDBParser lexer, parser = MindsDBLexer(), MindsDBParser() From f9681913b485933f87f9f989f3353968436b1332 Mon Sep 17 00:00:00 2001 From: andrew Date: Fri, 22 Nov 2024 18:14:18 +0300 Subject: [PATCH 3/3] bump version --- mindsdb_sql_parser/__about__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mindsdb_sql_parser/__about__.py b/mindsdb_sql_parser/__about__.py index 1ec9c61..6d808bc 100644 --- a/mindsdb_sql_parser/__about__.py +++ b/mindsdb_sql_parser/__about__.py @@ -1,6 +1,6 @@ __title__ = 'mindsdb_sql_parser' __package_name__ = 'mindsdb_sql_parser' -__version__ = '0.0.1' +__version__ = '0.0.2' __description__ = "Mindsdb SQL parser" __email__ = "jorge@mindsdb.com" __author__ = 'MindsDB Inc'