jsonpath

package
v0.42.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func BaseSingleTokens() map[rune]tokens.TokenType

BaseSingleTokens returns a copy of the base single-character token table, so a dialect can subtract an entry (snowflake removes '$').

func Parse

func Parse(path string, cfg Config) (exp.Expression, error)

Parse ports jsonpath.parse (jsonpath.py:48-201).

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).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL