Skip to content

Commit

Permalink
documented various directives including the new rds_json_format.
Browse files Browse the repository at this point in the history
  • Loading branch information
agentzh committed Nov 18, 2010
1 parent 2e15cde commit e41118e
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions README
Expand Up @@ -36,6 +36,56 @@ Description
This module provides an output filter that can format the RDS outputs This module provides an output filter that can format the RDS outputs
generated by ngx_drizzle and ngx_postgres modules. generated by ngx_drizzle and ngx_postgres modules.


Directives
rds_json
syntax: rds_json on|off
default: rds_json off

Enables or disables the output filter of this module.

rds_json_buffer_size
syntax: rds_json_buffer_size <bytes>
default: rds_json_buffer_size <page-size>

Controls the buffer size used by this module. default to the page size (4k/8k).
The bigger the buffer size, the less streammy the conversion
will be. But usually increasing the buffer size
does help reduce CPU time.

rds_json_format
syntax: rds_json_format normal|compact
default: rds_json_format normal

Controls the output JSON format. A sample of the default "normal" format
looks like this

[{"id":1,"name":"marry"},{"id":2,"name":"bob"}]

while it looks like below when in the "compact" format

[["id","name"],[1,"marry"],[2,"bob"]]

that is, the first row holds the column name list.

rds_json_ret
syntax: rds_json_ret <error-code> <descrption>
default: none

This directive enables a content handler that simply emits
an response body like this:

{"errcode":<error-code>,"errstr":"<description>"}

while the <description> string will be properly quoted as
a JSON string.

rds_json_content_type
syntax: rds_json_content_type <mime-type>
default: rds_json_content_type application/json

Controls the Content-Type header of the response generated by
this module's output filter.

Installation Installation
Grab the nginx source code from nginx.net (<http://nginx.net/>), for Grab the nginx source code from nginx.net (<http://nginx.net/>), for
example, the version 0.8.36 (see nginx compatibility), and then build example, the version 0.8.36 (see nginx compatibility), and then build
Expand Down

0 comments on commit e41118e

Please sign in to comment.