Hello!
Liseen Wan has been working on the "errstr_key" branch in
ngx_rds_json's git repository, which added new configure directives
rds_json_errcode_key and rds_json_errstr_key:
https://github.com/agentzh/rds-json-nginx-module/commits/errstr_key
Here is a small example demonstrating its basic usage:
location /mysql {
drizzle_pass backend;
drizzle_query "update cats set name='bob' where name='bob'";
rds_json on;
rds_json_errcode_key "code";
rds_json_errstr_key "str";
set $name 'Jimmy';
set $age 32;
rds_json_user_property name $name;
rds_json_user_property age $age;
}
Then accessing /mysql may yield something like this:
{"name":"Jimmy","age":"32","code":0,"str":"Rows matched: 1
Changed: 0 Warnings: 0"}
That is, the default key names "errcode" and "errstr" can be
configured to custom keys like "code" and "str", respectively.
Comments will be highly appreciated on the changes on this branch :)
Thanks!
-agentzh