JSON support

The JSON atomic type is a subtype of String. The module ensures that all strings are valid JSON. The module uses its own JSON parser.

The operations are exported into the SQL layer.

MODULE json;

PATTERN json.dump(X_0:json):bat[:str];
COMMENT "";

COMMAND json.filter(X_0:json, X_1:str):json;
COMMENT "";

COMMAND json.filter(X_0:json, X_1:bte, X_2:str):json;
COMMENT "";

COMMAND json.filter(X_0:json, X_1:int, X_2:str):json;
COMMENT "";

COMMAND json.filter(X_0:json, X_1:lng, X_2:str):json;
COMMENT "";

COMMAND json.filter(X_0:json, X_1:sht, X_2:str):json;
COMMENT "";

COMMAND json.filter(X_0:json, X_1:bte):json;
COMMENT "";

COMMAND json.filter(X_0:json, X_1:int):json;
COMMENT "";

COMMAND json.filter(X_0:json, X_1:lng):json;
COMMENT "";

COMMAND json.filter(X_0:json, X_1:sht):json;
COMMENT "";

PATTERN json.fold(X_0:bat[:any]):json;
COMMENT "";

PATTERN json.fold(X_0:bat[:oid], X_1:bat[:str], X_2:bat[:any]):json;
COMMENT "";

PATTERN json.fold(X_0:bat[:str], X_1:bat[:any]):json;
COMMENT "";

COMMAND json.integer(X_0:json):lng;
COMMENT "";

COMMAND json.isarray(X_0:json):bit;
COMMENT "";

COMMAND json.isobject(X_0:json):bit;
COMMENT "";

COMMAND json.isvalid(X_0:str):bit;
COMMENT "";

COMMAND json.keyarray(X_0:json):json;
COMMENT "";

COMMAND json.keys(X_0:json):bat[:str];
COMMENT "";

COMMAND json.length(X_0:json):int;
COMMENT "";

COMMAND json.new(X_0:str):json;
COMMENT "";

COMMAND json.number(X_0:json):dbl;
COMMENT "";

COMMAND json.prelude():void;
COMMENT "";

PATTERN json.renderarray(X_0:any...):json;
COMMENT "";

PATTERN json.renderobject(X_0:any...):json;
COMMENT "";

COMMAND json.resultSet(X_0:bat[:uuid], X_1:bat[:lng], X_2:bat[:json]):json;
COMMENT "";

COMMAND json.str(X_0:json):str;
COMMENT "";

COMMAND json.text(X_0:json):str;
COMMENT "";

COMMAND json.text(X_0:json, X_1:str):str;
COMMENT "";

PATTERN json.unfold(X_0:json) (X_1:bat[:oid], X_2:bat[:str], X_3:bat[:json]);
COMMENT "";

PATTERN json.unfold(X_0:json) (X_1:bat[:str], X_2:bat[:json]);
COMMENT "";

COMMAND json.valuearray(X_0:json):json;
COMMENT "";

COMMAND json.values(X_0:json):bat[:json];
COMMENT "";