-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpg_simdjson.h
44 lines (39 loc) · 1.27 KB
/
pg_simdjson.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
extern "C" {
#include <postgres.h>
#include <fmgr.h>
#include <utils/jsonb.h>
#include "utils/numeric.h"
#include "utils/fmgrprotos.h"
#ifdef PG_MODULE_MAGIC
PG_MODULE_MAGIC;
#endif
PG_FUNCTION_INFO_V1(pg_simdjson_parse);
Datum pg_simdjson_parse(PG_FUNCTION_ARGS);
typedef struct JsonbInState
{
JsonbParseState *parseState;
JsonbValue *res;
} JsonbInState;
Jsonb *JsonbValueToJsonb(JsonbValue *val);
const char *Errors[] = {
"No errors",
"No errors and buffer still has more data",
"This ParsedJson can't support a document that big",
"Error allocating memory, we're most likely out of memory",
"Something went wrong while writing to the tape",
"Document exceeds the user-specified depth limitation",
"Problem while parsing a string",
"Problem while parsing an atom starting with the letter 't'",
"Problem while parsing an atom starting with the letter 'f'",
"Problem while parsing an atom starting with the letter 'n'",
"Problem while parsing a number",
"The input is not valid UTF-8",
"Unitialized",
"Empty",
"Within strings, some characters must be escapted, we "
"found unescapted characters",
"Missing quote at the end",
"Unexpected error, consider reporting this problem as "
"you may have found a bug in simdjson",
};
}