SQLite Forum

Enabling JSON1 extension in the sqlite3.c amalgamation at compile time
Login
Thank you for responding to my question.  I tried as you suggested and the statement you provided processed without error.  In the sqlite3.txt file generated, it appears that the extension is enabled and there are JSON functions in it. Does this mean it is enabled?  Thank you.


# 1 "sqlite3.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "sqlite3.c"
# 72 "sqlite3.c"
static const char * const sqlite3azCompileOpt[] = {
# 111 "sqlite3.c"
  "COMPILER=gcc-" "8.1.0",
# 279 "sqlite3.c"
  "ENABLE_JSON1",
# 748 "sqlite3.c"
  "THREADSAFE=1",
# 780 "sqlite3.c"
};

One function for example.

# 187964 "sqlite3.c"
static int sqlite3Json1Init(sqlite3 *db){
  int rc = 0;
  unsigned int i;
  static const struct {
     const char *zName;
     int nArg;
     int flag;
     void (*xFunc)(sqlite3_context*,int,sqlite3_value**);
  } aFunc[] = {
    { "json", 1, 0, jsonRemoveFunc },
    { "json_array", -1, 0, jsonArrayFunc },
    { "json_array_length", 1, 0, jsonArrayLengthFunc },
    { "json_array_length", 2, 0, jsonArrayLengthFunc },
    { "json_extract", -1, 0, jsonExtractFunc },
    { "json_insert", -1, 0, jsonSetFunc },
    { "json_object", -1, 0, jsonObjectFunc },
    { "json_patch", 2, 0, jsonPatchFunc },
    { "json_quote", 1, 0, jsonQuoteFunc },
    { "json_remove", -1, 0, jsonRemoveFunc },
    { "json_replace", -1, 0, jsonReplaceFunc },
    { "json_set", -1, 1, jsonSetFunc },
    { "json_type", 1, 0, jsonTypeFunc },
    { "json_type", 2, 0, jsonTypeFunc },
    { "json_valid", 1, 0, jsonValidFunc },
  };