Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions core/query_parser.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from core.ast.node import QueryNode

class QueryParser:

def parse(self, query: str) -> QueryNode:
# Implement parsing logic using self.rules
pass

# [1] Call mo_sql_parser
# str -> Any (JSON)

# [2] Our new code
# Any (JSON) -> AST (QueryNode)

def format(self, query: QueryNode) -> str:
# Implement formatting logic to convert AST back to SQL string
pass

# [1] Our new code
# AST (QueryNode) -> JSON

# [2] Call mo_sql_format
# Any (JSON) -> str
Loading