-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
on-connected hook for custom query #18
Comments
Multiple result sets support is still a TODO. However, you can use ngx_echo module's echo_location or echo_subrequest directives to do the combinations yourself: |
Thanks @agentzh! I gave it a quick try, it seems postgres_pass can't be used with echo_location, so i have to create a wrapper route that contains two echo_location to the to routes for doing bootstrap and the actual query. I then use |
@clkao echo_location should work with ngx_postgres but you need separate locations because you're doing Nginx subrequests here. For a single location, you cannot enable two Nginx module's content handlers at the same time, that is, you cannot use echo_location and proxy_pass in a single location. |
It seems there's no such hook in ngx_postgres to allow custom queries to be sent upon upstream connection establishment.
I am trying out ngx_postgres with pgrest (http://github.com/clkao/pgrest). However for each connection, we need to call a postgresql function via select, something like: SELECT pgrest_boot('{...bootstrap_json}').
I also tried calling the bootstrap function along with other queries mapped from GET requests, but ngx_postgres is not handling multiple queries very well.
The text was updated successfully, but these errors were encountered: