Documentation ¶
Overview ¶
Package parser includes the actual parsing logic using cgo to access libpg_query.
Index ¶
- func DeparseFromProtobuf(input []byte) (result string, err error)
- func FingerprintToHexStr(input string) (result string, err error)
- func FingerprintToUInt64(input string) (result uint64, err error)
- func HashXXH3_64(input []byte, seed uint64) (result uint64)
- func Normalize(input string) (result string, err error)
- func NormalizeUtility(input string) (result string, err error)
- func ParsePlPgSqlToJSON(input string) (result string, err error)
- func ParseToJSON(input string) (result string, err error)
- func ParseToProtobuf(input string) (result []byte, err error)
- func ScanToProtobuf(input string) (result []byte, err error)
- func SplitWithParser(input string, trimSpace bool) (result []string, err error)
- func SplitWithScanner(input string, trimSpace bool) (result []string, err error)
- type Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeparseFromProtobuf ¶
DeparseFromProtobuf - Deparses the given Protobuf format parse tree into a SQL statement
func FingerprintToHexStr ¶
FingerprintToHexStr - Fingerprint the passed SQL statement using the C extension and returns result as hex string
func FingerprintToUInt64 ¶
FingerprintToUInt64 - Fingerprint the passed SQL statement using the C extension and returns result as uint64
func HashXXH3_64 ¶
HashXXH3_64 - Helper method to run XXH3 hash function (64-bit variant) on the given bytes, with the specified seed
func NormalizeUtility ¶
Normalize the passed utility statement to replace constant values with ? characters
func ParsePlPgSqlToJSON ¶
ParsePlPgSqlToJSON - Parses the given PL/pgSQL function statement into a parse tree (JSON format)
func ParseToJSON ¶
ParseToJSON - Parses the given SQL statement into a parse tree (JSON format)
func ParseToProtobuf ¶
ParseToProtobuf - Parses the given SQL statement into a parse tree (Protobuf format)
func ScanToProtobuf ¶
Scans the given SQL statement into a protobuf ScanResult
func SplitWithParser ¶
Types ¶
type Error ¶
type Error struct { Message string // exception message Funcname string // source function of exception (e.g. SearchSysCache) Filename string // source of exception (e.g. parse.l) Lineno int // source of exception (e.g. 104) Cursorpos int // char in query at which exception occurred Context string // additional context (optional, can be NULL) }