PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | JsonPath |
struct | JsonPathItem |
struct | JsonPathParseItem |
struct | JsonPathParseResult |
Macros | |
#define | JSONPATH_VERSION (0x01) |
#define | JSONPATH_LAX (0x80000000) |
#define | JSONPATH_HDRSZ (offsetof(JsonPath, data)) |
#define | PG_GETARG_JSONPATH_P(x) DatumGetJsonPathP(PG_GETARG_DATUM(x)) |
#define | PG_GETARG_JSONPATH_P_COPY(x) DatumGetJsonPathPCopy(PG_GETARG_DATUM(x)) |
#define | PG_RETURN_JSONPATH_P(p) PG_RETURN_POINTER(p) |
#define | jspIsScalar(type) ((type) >= jpiNull && (type) <= jpiBool) |
#define | JSP_REGEX_ICASE 0x01 /* i flag, case insensitive */ |
#define | JSP_REGEX_DOTALL 0x02 /* s flag, dot matches newline */ |
#define | JSP_REGEX_MLINE 0x04 /* m flag, ^/$ match at newlines */ |
#define | JSP_REGEX_WSPACE 0x08 /* x flag, ignore whitespace in pattern */ |
#define | JSP_REGEX_QUOTE 0x10 /* q flag, no special characters */ |
#define | jspHasNext(jsp) ((jsp)->nextPos > 0) |
Typedefs | |
typedef enum JsonPathItemType | JsonPathItemType |
typedef struct JsonPathItem | JsonPathItem |
typedef struct JsonPathParseItem | JsonPathParseItem |
typedef struct JsonPathParseResult | JsonPathParseResult |
Enumerations | |
enum | JsonPathItemType { jpiNull = jbvNull , jpiString = jbvString , jpiNumeric = jbvNumeric , jpiBool = jbvBool , jpiAnd , jpiOr , jpiNot , jpiIsUnknown , jpiEqual , jpiNotEqual , jpiLess , jpiGreater , jpiLessOrEqual , jpiGreaterOrEqual , jpiAdd , jpiSub , jpiMul , jpiDiv , jpiMod , jpiPlus , jpiMinus , jpiAnyArray , jpiAnyKey , jpiIndexArray , jpiAny , jpiKey , jpiCurrent , jpiRoot , jpiVariable , jpiFilter , jpiExists , jpiType , jpiSize , jpiAbs , jpiFloor , jpiCeiling , jpiDouble , jpiDatetime , jpiKeyValue , jpiSubscript , jpiLast , jpiStartsWith , jpiLikeRegex } |
Functions | |
static JsonPath * | DatumGetJsonPathP (Datum d) |
static JsonPath * | DatumGetJsonPathPCopy (Datum d) |
void | jspInit (JsonPathItem *v, JsonPath *js) |
void | jspInitByBuffer (JsonPathItem *v, char *base, int32 pos) |
bool | jspGetNext (JsonPathItem *v, JsonPathItem *a) |
void | jspGetArg (JsonPathItem *v, JsonPathItem *a) |
void | jspGetLeftArg (JsonPathItem *v, JsonPathItem *a) |
void | jspGetRightArg (JsonPathItem *v, JsonPathItem *a) |
Numeric | jspGetNumeric (JsonPathItem *v) |
bool | jspGetBool (JsonPathItem *v) |
char * | jspGetString (JsonPathItem *v, int32 *len) |
bool | jspGetArraySubscript (JsonPathItem *v, JsonPathItem *from, JsonPathItem *to, int i) |
const char * | jspOperationName (JsonPathItemType type) |
JsonPathParseResult * | parsejsonpath (const char *str, int len, struct Node *escontext) |
bool | jspConvertRegexFlags (uint32 xflags, int *result, struct Node *escontext) |
Definition at line 30 of file jsonpath.h.
#define JSONPATH_LAX (0x80000000) |
Definition at line 29 of file jsonpath.h.
#define JSONPATH_VERSION (0x01) |
Definition at line 28 of file jsonpath.h.
Definition at line 102 of file jsonpath.h.
Definition at line 101 of file jsonpath.h.
#define JSP_REGEX_MLINE 0x04 /* m flag, ^/$ match at newlines */ |
Definition at line 103 of file jsonpath.h.
#define JSP_REGEX_QUOTE 0x10 /* q flag, no special characters */ |
Definition at line 105 of file jsonpath.h.
Definition at line 104 of file jsonpath.h.
#define jspHasNext | ( | jsp | ) | ((jsp)->nextPos > 0) |
Definition at line 174 of file jsonpath.h.
Definition at line 48 of file jsonpath.h.
#define PG_GETARG_JSONPATH_P | ( | x | ) | DatumGetJsonPathP(PG_GETARG_DATUM(x)) |
Definition at line 44 of file jsonpath.h.
#define PG_GETARG_JSONPATH_P_COPY | ( | x | ) | DatumGetJsonPathPCopy(PG_GETARG_DATUM(x)) |
Definition at line 45 of file jsonpath.h.
#define PG_RETURN_JSONPATH_P | ( | p | ) | PG_RETURN_POINTER(p) |
Definition at line 46 of file jsonpath.h.
typedef struct JsonPathItem JsonPathItem |
typedef enum JsonPathItemType JsonPathItemType |
typedef struct JsonPathParseItem JsonPathParseItem |
Definition at line 188 of file jsonpath.h.
typedef struct JsonPathParseResult JsonPathParseResult |
enum JsonPathItemType |
Definition at line 53 of file jsonpath.h.
Referenced by executeLikeRegex().
void jspGetArg | ( | JsonPathItem * | v, |
JsonPathItem * | a | ||
) |
Definition at line 959 of file jsonpath.c.
References a, JsonPathItem::arg, Assert(), JsonPathItem::base, JsonPathItem::content, jpiDatetime, jpiExists, jpiFilter, jpiIsUnknown, jpiMinus, jpiNot, jpiPlus, jspInitByBuffer(), and JsonPathItem::type.
Referenced by executeBoolItem(), executeDateTimeMethod(), executeItemOptUnwrapTarget(), executeUnaryArithmExpr(), extract_jsp_bool_expr(), extract_jsp_path_expr_nodes(), and printJsonPathItem().
bool jspGetArraySubscript | ( | JsonPathItem * | v, |
JsonPathItem * | from, | ||
JsonPathItem * | to, | ||
int | i | ||
) |
Definition at line 1099 of file jsonpath.c.
References JsonPathItem::array, Assert(), JsonPathItem::base, JsonPathItem::content, i, jpiIndexArray, jspInitByBuffer(), and JsonPathItem::type.
Referenced by executeItemOptUnwrapTarget(), and printJsonPathItem().
bool jspGetBool | ( | JsonPathItem * | v | ) |
Definition at line 1071 of file jsonpath.c.
References Assert(), JsonPathItem::content, jpiBool, JsonPathItem::type, and JsonPathItem::value.
Referenced by getJsonPathItem(), and printJsonPathItem().
void jspGetLeftArg | ( | JsonPathItem * | v, |
JsonPathItem * | a | ||
) |
Definition at line 1029 of file jsonpath.c.
References a, JsonPathItem::args, Assert(), JsonPathItem::base, JsonPathItem::content, jpiAdd, jpiAnd, jpiDiv, jpiEqual, jpiGreater, jpiGreaterOrEqual, jpiLess, jpiLessOrEqual, jpiMod, jpiMul, jpiNotEqual, jpiOr, jpiStartsWith, jpiSub, jspInitByBuffer(), and JsonPathItem::type.
Referenced by executeBinaryArithmExpr(), executeBoolItem(), extract_jsp_bool_expr(), and printJsonPathItem().
bool jspGetNext | ( | JsonPathItem * | v, |
JsonPathItem * | a | ||
) |
Definition at line 973 of file jsonpath.c.
References a, Assert(), JsonPathItem::base, jpiAbs, jpiAdd, jpiAnd, jpiAny, jpiAnyArray, jpiAnyKey, jpiBool, jpiCeiling, jpiCurrent, jpiDatetime, jpiDiv, jpiDouble, jpiEqual, jpiExists, jpiFilter, jpiFloor, jpiGreater, jpiGreaterOrEqual, jpiIndexArray, jpiIsUnknown, jpiKey, jpiKeyValue, jpiLast, jpiLess, jpiLessOrEqual, jpiLikeRegex, jpiMinus, jpiMod, jpiMul, jpiNot, jpiNotEqual, jpiNull, jpiNumeric, jpiOr, jpiPlus, jpiRoot, jpiSize, jpiStartsWith, jpiString, jpiSub, jpiType, jpiVariable, jspHasNext, jspInitByBuffer(), JsonPathItem::nextPos, and JsonPathItem::type.
Referenced by appendBoolResult(), executeBinaryArithmExpr(), executeDateTimeMethod(), executeItemOptUnwrapTarget(), executeKeyValueMethod(), executeNextItem(), executeNumericItemMethod(), executeUnaryArithmExpr(), extract_jsp_path_expr_nodes(), and printJsonPathItem().
Numeric jspGetNumeric | ( | JsonPathItem * | v | ) |
Definition at line 1079 of file jsonpath.c.
References Assert(), JsonPathItem::content, jpiNumeric, JsonPathItem::type, and JsonPathItem::value.
Referenced by getJsonPathItem(), and printJsonPathItem().
void jspGetRightArg | ( | JsonPathItem * | v, |
JsonPathItem * | a | ||
) |
Definition at line 1050 of file jsonpath.c.
References a, JsonPathItem::args, Assert(), JsonPathItem::base, JsonPathItem::content, jpiAdd, jpiAnd, jpiDiv, jpiEqual, jpiGreater, jpiGreaterOrEqual, jpiLess, jpiLessOrEqual, jpiMod, jpiMul, jpiNotEqual, jpiOr, jpiStartsWith, jpiSub, jspInitByBuffer(), and JsonPathItem::type.
Referenced by executeBinaryArithmExpr(), executeBoolItem(), extract_jsp_bool_expr(), and printJsonPathItem().
char* jspGetString | ( | JsonPathItem * | v, |
int32 * | len | ||
) |
Definition at line 1087 of file jsonpath.c.
References Assert(), JsonPathItem::content, jpiKey, jpiString, jpiVariable, len, JsonPathItem::type, and JsonPathItem::value.
Referenced by executeDateTimeMethod(), executeItemOptUnwrapTarget(), getJsonPathItem(), getJsonPathVariable(), jsonb_ops__add_path_item(), jsonb_path_ops__add_path_item(), and printJsonPathItem().
void jspInit | ( | JsonPathItem * | v, |
JsonPath * | js | ||
) |
Definition at line 869 of file jsonpath.c.
References Assert(), JsonPath::data, JsonPath::header, JSONPATH_LAX, JSONPATH_VERSION, and jspInitByBuffer().
Referenced by executeJsonPath(), extract_jsp_query(), and jsonPathToCstring().
void jspInitByBuffer | ( | JsonPathItem * | v, |
char * | base, | ||
int32 | pos | ||
) |
Definition at line 879 of file jsonpath.c.
References JsonPathItem::anybounds, JsonPathItem::arg, JsonPathItem::args, JsonPathItem::array, JsonPathItem::base, JsonPathItem::content, elog(), ERROR, INTALIGN, jpiAbs, jpiAdd, jpiAnd, jpiAny, jpiAnyArray, jpiAnyKey, jpiBool, jpiCeiling, jpiCurrent, jpiDatetime, jpiDiv, jpiDouble, jpiEqual, jpiExists, jpiFilter, jpiFloor, jpiGreater, jpiGreaterOrEqual, jpiIndexArray, jpiIsUnknown, jpiKey, jpiKeyValue, jpiLast, jpiLess, jpiLessOrEqual, jpiLikeRegex, jpiMinus, jpiMod, jpiMul, jpiNot, jpiNotEqual, jpiNull, jpiNumeric, jpiOr, jpiPlus, jpiRoot, jpiSize, jpiStartsWith, jpiString, jpiSub, jpiType, jpiVariable, JsonPathItem::like_regex, JsonPathItem::nextPos, read_byte, read_int32, read_int32_n, JsonPathItem::type, and JsonPathItem::value.
Referenced by executeBoolItem(), jspGetArg(), jspGetArraySubscript(), jspGetLeftArg(), jspGetNext(), jspGetRightArg(), jspInit(), and printJsonPathItem().
const char* jspOperationName | ( | JsonPathItemType | type | ) |
Definition at line 754 of file jsonpath.c.
References elog(), ERROR, jpiAbs, jpiAdd, jpiAnd, jpiCeiling, jpiDatetime, jpiDiv, jpiDouble, jpiEqual, jpiFloor, jpiGreater, jpiGreaterOrEqual, jpiKeyValue, jpiLess, jpiLessOrEqual, jpiLikeRegex, jpiMinus, jpiMod, jpiMul, jpiNotEqual, jpiOr, jpiPlus, jpiSize, jpiStartsWith, jpiSub, jpiType, and type.
Referenced by executeBinaryArithmExpr(), executeDateTimeMethod(), executeItemOptUnwrapTarget(), executeKeyValueMethod(), executeNumericItemMethod(), executeUnaryArithmExpr(), and printJsonPathItem().
JsonPathParseResult* parsejsonpath | ( | const char * | str, |
int | len, | ||
struct Node * | escontext | ||
) |
Referenced by jsonPathFromCstring().