jcoglan commented on code in PR #5858:
URL: https://github.com/apache/couchdb/pull/5858#discussion_r3396169086
##########
src/couch/src/couch_query_servers.erl:
##########
@@ -42,7 +42,12 @@
try_compile(Proc, FunctionType, FunctionName, FunctionSource) ->
try
- proc_prompt(Proc, [<<"add_fun">>, FunctionSource]),
+ case FunctionType of
+ validate_doc_update ->
+ proc_prompt(Proc, [<<"validate_fun">>, FunctionSource]);
Review Comment:
We only validate the function if `language` is `javascript` or `query`;
`couch_mrview:validate()` explicitly ends by accepting anything that's not
recognised, i.e. you can save any design doc you like if it contains content
CouchDB does not natively understand. This is very convenient for enabling
other software to integrate with CouchDB.
We _could_ add validation for `erlang` functions but that feels like
expanding the scope of this PR into things that aren't strictly related and I'm
not sure how to implement.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]