Skip to content

Commit

Permalink
mv
Browse files Browse the repository at this point in the history
  • Loading branch information
RekGRpth committed Feb 6, 2025
1 parent 3071ee0 commit 38d34e3
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

# Directives

pq_empty
-------------
* Syntax: **pq_empty** *200* | *204* | *400* | *401* | *403* | *404*
* Default: 200
* Context: main, server, location, if in location

Sets HTTP status code for empty response. Status code will be set to given value only if all queries inside location returns nothing.
```nginx
location =/postgres {
pq_empty 404; # returns 404 (not found), when 0 rows
pq_query "SELECT 1 WHERE false"; # returns 0 rows
}
```
pq_execute
-------------
* Syntax: **pq_execute** *$query_name* [ *$argument_value* ] [ output=*csv* | output=*plain* | output=*value* | output=*$variable* ]
Expand Down Expand Up @@ -134,19 +147,6 @@ location =/postgres {
pq_pass $postgres; # upstream is taken from $postgres variable
}
```
pq_empty
-------------
* Syntax: **pq_empty** *200* | *204* | *400* | *401* | *403* | *404*
* Default: 200
* Context: main, server, location, if in location

Sets HTTP status code for empty response. Status code will be set to given value only if all queries inside location returns nothing.
```nginx
location =/postgres {
pq_empty 404; # returns 404 (not found), when 0 rows
pq_query "SELECT 1 WHERE false"; # returns 0 rows
}
```
pq_query
-------------
* Syntax: **pq_query** *sql* [ *$argument_value* | *$argument_value*::*$argument_oid* ] [ output=*csv* | output=*plain* | output=*value* | output=*$variable* ]
Expand Down

0 comments on commit 38d34e3

Please sign in to comment.