You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "rnewson (via GitHub)" <gi...@apache.org> on 2026/06/25 22:03:43 UTC

[PR] add QUERY method support [couchdb]

rnewson opened a new pull request, #6051:
URL: https://github.com/apache/couchdb/pull/6051

   ## Overview
   
   Accept QUERY method wherever POST is allowed when querying the database. Only endpoints that make no state changes are eligible. Send Accept-Query: "application/json" for all requests to such endpoints to aid discovery.
   
   ## Testing recommendations
   
   TBD
   
   ## Related Issues or Pull Requests
   
   N/A
   
   ## Checklist
   
   - [x] This is my own work, I did not use AI, LLM's or similar technology
   - [x] Code is written and works correctly
   - [ ] Changes are covered by tests
   - [ ] Any new configurable parameters are documented in `rel/overlay/etc/default.ini`
   - [ ] Documentation changes were made in the `src/docs` folder
   - [ ] Documentation changes were backported (separated PR) to affected branches
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] add QUERY method support [couchdb]

Posted by "rnewson (via GitHub)" <gi...@apache.org>.
rnewson commented on PR #6051:
URL: https://github.com/apache/couchdb/pull/6051#issuecomment-4804554553

   c.f https://datatracker.ietf.org/doc/rfc10008/


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] add QUERY method support [couchdb]

Posted by "rnewson (via GitHub)" <gi...@apache.org>.
rnewson commented on code in PR #6051:
URL: https://github.com/apache/couchdb/pull/6051#discussion_r3623395340


##########
src/couch/include/couch_db.hrl:
##########
@@ -36,6 +36,9 @@
 -define(term_to_bin(T, O), term_to_binary(T, O ++ [{minor_version, 1}])).
 -define(term_size(T), erlang:external_size(T, [{minor_version, 1}])).
 
+-define(POST_OR_QUERY(Method), Method == 'POST'; Method == 'QUERY').

Review Comment:
   good point



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] add QUERY method support [couchdb]

Posted by "nickva (via GitHub)" <gi...@apache.org>.
nickva commented on code in PR #6051:
URL: https://github.com/apache/couchdb/pull/6051#discussion_r3623263179


##########
src/couch/include/couch_db.hrl:
##########
@@ -36,6 +36,9 @@
 -define(term_to_bin(T, O), term_to_binary(T, O ++ [{minor_version, 1}])).
 -define(term_size(T), erlang:external_size(T, [{minor_version, 1}])).
 
+-define(POST_OR_QUERY(Method), Method == 'POST'; Method == 'QUERY').

Review Comment:
   With `;` binding weaker than `,` we should warp the macro in parentheses



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] add QUERY method support [couchdb]

Posted by "rnewson (via GitHub)" <gi...@apache.org>.
rnewson commented on code in PR #6051:
URL: https://github.com/apache/couchdb/pull/6051#discussion_r3629619819


##########
src/couch/include/couch_db.hrl:
##########
@@ -36,6 +36,9 @@
 -define(term_to_bin(T, O), term_to_binary(T, O ++ [{minor_version, 1}])).
 -define(term_size(T), erlang:external_size(T, [{minor_version, 1}])).
 
+-define(POST_OR_QUERY(Method), Method == 'POST'; Method == 'QUERY').

Review Comment:
   updated



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] add QUERY method support [couchdb]

Posted by "rnewson (via GitHub)" <gi...@apache.org>.
rnewson commented on PR #6051:
URL: https://github.com/apache/couchdb/pull/6051#issuecomment-4929424112

   added query method for _find and _explain.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] add QUERY method support [couchdb]

Posted by "rnewson (via GitHub)" <gi...@apache.org>.
rnewson commented on PR #6051:
URL: https://github.com/apache/couchdb/pull/6051#issuecomment-4929291728

   hm, I guess i missed a few spots, but certainly `_index` is not a query, it creates an index.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] add QUERY method support [couchdb]

Posted by "rnewson (via GitHub)" <gi...@apache.org>.
rnewson commented on PR #6051:
URL: https://github.com/apache/couchdb/pull/6051#issuecomment-4929432901

   (noting this is still draft. I haven't written docs or tests, or ensured all QUERY-able endpoints can take all their arguments exclusively from the request body and not the query string).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] add QUERY method support [couchdb]

Posted by "vanshhhhh (via GitHub)" <gi...@apache.org>.
vanshhhhh commented on PR #6051:
URL: https://github.com/apache/couchdb/pull/6051#issuecomment-4925107653

   I compiled and tested the draft PR #6051 branch locally on Windows (Python 3.13.7, Erlang OTP 29) at head commit 34c2e9a079d978bf3d5c81911046e521f52316c1.
   
   I noticed that:
   
   -   Requests to QUERY /db/_find and QUERY /db/_partition/{partition}/_find returned 405 Method Not Allowed with the header Allow: POST.
   -   Requests to QUERY /db/_explain returned 405 Method Not Allowed with the header Allow: POST.
   -   Requests to QUERY /db/_index returned 405 Method Not Allowed with the header Allow: GET,POST.
   
   I wanted to coordinate on the planned scope:
   
   1.  Is extending QUERY method support to standard and partitioned Mango  _find routes intended to be within the scope of this PR effort?
   2.  Are _explain and _index routes intentionally excluded from QUERY support?
   3.  If help with adding the Mango subsystem integration is welcome, I would be happy to assist.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org