MCPcopy Create free account
hub / github.com/tobymao/sqlglot / parse

Method parse

sqlglot/parser.py:2038–2052  ·  view source on GitHub ↗

Parses a list of tokens and returns a list of syntax trees, one tree per parsed SQL statement. Args: raw_tokens: The list of tokens. sql: The original SQL string. Returns: The list of the produced syntax trees.

(self, raw_tokens: list[Token], sql: str)

Source from the content-addressed store, hash-verified

2036 return this
2037
2038 def parse(self, raw_tokens: list[Token], sql: str) -> list[exp.Expr | None]:
2039 """
2040 Parses a list of tokens and returns a list of syntax trees, one tree
2041 per parsed SQL statement.
2042
2043 Args:
2044 raw_tokens: The list of tokens.
2045 sql: The original SQL string.
2046
2047 Returns:
2048 The list of the produced syntax trees.
2049 """
2050 return self._parse(
2051 parse_method=self.__class__._parse_statement, raw_tokens=raw_tokens, sql=sql
2052 )
2053
2054 def parse_into(
2055 self,

Callers 6

__main__.pyFile · 0.45
parseFunction · 0.45
parse_oneFunction · 0.45
sqlparse_parseFunction · 0.45
moz_sql_parser_parseFunction · 0.45
sqlfluff_parseFunction · 0.45

Calls 1

_parseMethod · 0.95

Tested by

no test coverage detected