Documentation
¶
Overview ¶
Package jsonpath ports sqlglot/jsonpath.py (pinned v30.17.0): the JSONPath tokenizer and parser that turn a JSON path string into an exp.JSONPath AST.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BaseSingleTokens ¶
BaseSingleTokens returns a copy of the base single-character token table, so a dialect can subtract an entry (snowflake removes '$').
Types ¶
type Config ¶
type Config struct {
// SingleTokens overrides the base single-character map when non-nil. Snowflake removes
// "$" from it (dialects/snowflake.py:130-132).
SingleTokens map[rune]tokens.TokenType
// VarTokens holds the token types _parse_var_text merges; nil means {VAR}. BigQuery adds
// DASH and NUMBER, hive adds DASH.
VarTokens map[tokens.TokenType]bool
// IdentifierDelims overrides the identifier delimiters; nil means {'"'}. Databricks adds
// the backtick.
IdentifierDelims map[rune]bool
// SingleDotIsWildcard mirrors Dialect.JSON_PATH_SINGLE_DOT_IS_WILDCARD: when true a bare
// `.` with no key is not an error.
SingleDotIsWildcard bool
}
Config is a dialect's JSONPathTokenizer surface (jsonpath.py:15-45 plus the per-dialect VAR_TOKENS/IDENTIFIERS/SINGLE_TOKENS overrides).