Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 98B7A9582 for ; Sun, 22 Jul 2012 09:15:19 +0000 (UTC) Received: (qmail 50916 invoked by uid 500); 22 Jul 2012 09:15:19 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 50819 invoked by uid 500); 22 Jul 2012 09:15:18 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 50791 invoked by uid 99); 22 Jul 2012 09:15:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Jul 2012 09:15:18 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of space.ship.traveller@gmail.com designates 74.125.82.42 as permitted sender) Received: from [74.125.82.42] (HELO mail-wg0-f42.google.com) (74.125.82.42) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Jul 2012 09:15:11 +0000 Received: by wgbfm10 with SMTP id fm10so1557709wgb.5 for ; Sun, 22 Jul 2012 02:14:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=SOc3WpZeWckdvpkZxk29iUgVaafJtFrPtsJD1vErMz4=; b=eK3+IOGMzdl9AVmb6Idb7Fpenz/evB1RRxsXz+Q6nGhpqSqEFxC62Bo20qGatODJvq xyovBmNgpY1HTr0W0FUP4eOz42FzpoqnrCTsGc7Yhq2eyQ3IOwgeIkgJp+JJKdScvNoZ +NLHIs6D3z62+UcVANJrBf3pRspRkbTc4L1XW4jDs5r2MBz0zMJiwH79SDDCi9E7tenG LzQDD3no71hunnHTqZPY46QdX1aL0dXicSUGbtabEx4xpcW9ZjK8Bj2yhCp5rdCqPo1V QvCQXkepmtZchX+WQaJctDK6ndEtueECc1l8hrOaVC4jsOOM7kyKW+oSvHlVm1siOsm4 9UgA== MIME-Version: 1.0 Received: by 10.216.136.230 with SMTP id w80mr6965869wei.199.1342948490596; Sun, 22 Jul 2012 02:14:50 -0700 (PDT) Received: by 10.216.245.73 with HTTP; Sun, 22 Jul 2012 02:14:50 -0700 (PDT) In-Reply-To: References: Date: Sun, 22 Jul 2012 21:14:50 +1200 Message-ID: Subject: Re: validate_doc_update response? From: Samuel Williams To: dev@couchdb.apache.org Content-Type: multipart/alternative; boundary=0016e6d77d35bbd0c404c5678fdc --0016e6d77d35bbd0c404c5678fdc Content-Type: text/plain; charset=ISO-8859-1 I see, so the specification for design doc was made before that patch, so the patch had to follow the specification of the design doc for consistency, yet the naming seems pretty horrible in contrast to all the other dispatch table verbs :( Oh well, thats the way it is then. Perhaps the ddoc API can be refactored for CouchDB v2.0 with better consistency and efficiency, personally I'd like to see a simplified design document API, from the POV of implementing a query server. Right now it feels like lots of different mechanisms all mixed up together (e.g. stateful add_fun vs non-stateful ddoc). I guess I'd need to come up with a good alternative with significant improvements to warrant the change right? Are any other people thinking about this? Kind regards, Samuel On 22 July 2012 21:06, Alexander Shorin wrote: > > I couldn't see any reason why the name was changed..? > > Because validate function stored at "validate_doc_update" field within > ddoc, not "validate", so ddoc subcommand have to be same named. > Leaving subcommand as "validate" would break backward compatibility in > this case. > > -- > ,,,^..^,,, > > > On Sun, Jul 22, 2012 at 1:02 PM, Samuel Williams > wrote: > > I can't see why "validate" is a problem, I checked the patch which > changed > > the name: > > > > > https://github.com/apache/couchdb/commit/ea3b1153e52ac1513da4d634eedefb05c261039c > > > > I couldn't see any reason why the name was changed..? > > > > Kind regards, > > Samuel > > > > On 22 July 2012 20:52, Alexander Shorin wrote: > > > >> Hi again(: No problems. > >> > >> On Sun, Jul 22, 2012 at 12:48 PM, Samuel Williams > >> wrote: > >> > Regarding the "1" result, I'm surprised that it isn't 'true', since > that > >> > would seem far more logical and match the rest of the protocol, e.g. > >> > 'reset', and various other commands. > >> > >> I suppose main decision was about how to easily understand what > >> response received for what command, but I could be wrong there. > >> > >> > I'm not sure I understand the motivation behind going from "validate" > to > >> > "validate_doc_update" - was it renamed to avoid collisions with > something > >> > else? > >> > >> You just need once to take a look at how ddoc command been processed > >> to figure "why so"(: > >> https://github.com/apache/couchdb/blob/master/share/server/loop.js#L69 > >> > >> -- > >> ,,,^..^,,, > >> > >> > >> On Sun, Jul 22, 2012 at 12:48 PM, Samuel Williams > >> wrote: > >> > Thanks again Alex, you are always so helpful - and the references you > >> > provide are really great. > >> > > >> > Regarding the "1" result, I'm surprised that it isn't 'true', since > that > >> > would seem far more logical and match the rest of the protocol, e.g. > >> > 'reset', and various other commands. > >> > > >> > I'm not sure I understand the motivation behind going from "validate" > to > >> > "validate_doc_update" - was it renamed to avoid collisions with > something > >> > else? > >> > > >> > On 22 July 2012 20:40, Alexander Shorin wrote: > >> > > >> >> Hi Samuel! > >> >> > >> >> > 1/ I'm wondering what are valid responses to validate_doc_update? > The > >> >> query > >> >> > services I've seen return either a hash {forbidden: "message"} or 1 > >> >> > > >> >> > Can I return true rather than 1? Seems more logical.. > >> >> > >> >> You could, but this would be invalid output. See for details: > >> >> > >> >> > >> > https://github.com/apache/couchdb/blob/master/src/couchdb/couch_query_servers.erl#L230 > >> >> > >> >> > >> >> > 2/ Why is the name "validate_doc_update" so verbose when compared > with > >> >> > "lists", "filters", etc? Why not just "validates"? > >> >> > >> >> Initially it was "validate" command, but since any ddoc subcommand is > >> >> a ddoc field, it eventually renamed to validate_doc_update. > >> >> See first commit about it: > >> >> > >> >> > >> > https://github.com/apache/couchdb/commit/9044fc0234ed65056f087a86c7c117922f2a2c75 > >> >> > >> >> -- > >> >> ,,,^..^,,, > >> >> > >> >> > >> >> On Sun, Jul 22, 2012 at 12:07 PM, Samuel Williams > >> >> wrote: > >> >> > Hi, > >> >> > > >> >> > 1/ I'm wondering what are valid responses to validate_doc_update? > The > >> >> query > >> >> > services I've seen return either a hash {forbidden: "message"} or 1 > >> >> > > >> >> > Can I return true rather than 1? Seems more logical.. > >> >> > > >> >> > How do I report multiple failures? e.g. Title required, Author > >> required. > >> >> > > >> >> > 2/ Why is the name "validate_doc_update" so verbose when compared > with > >> >> > "lists", "filters", etc? Why not just "validates"? > >> >> > > >> >> > Thanks, > >> >> > Samuel > >> >> > >> > --0016e6d77d35bbd0c404c5678fdc--