Permalink
Commits on Jun 18, 2012
  1. @benoitc

    Merge branch 'rcouch-0.6' into view_changes-0.6

    Conflicts:
    	apps/couch/support/patches/js/patch-configure
    	apps/couch/support/patches/js/patch-configure_in
    benoitc committed Jun 18, 2012
Commits on Jun 13, 2012
  1. @benoitc

    fix typos

    benoitc committed Jun 13, 2012
  2. @benoitc
  3. @benoitc
  4. @benoitc
Commits on Jun 12, 2012
  1. @benoitc

    make couch_httpd more resistant to failures.

    If vhosts or the authentication cache module crash we need to make sure that
    HTTPd bindings are restarted as well.
    benoitc committed Jun 12, 2012
  2. @benoitc

    Upgrade the cowboy reauest to a mochiweb request

    Instead of only using the cowboy requets pool we now use a cowboy
    handler that upgrades the connections to a mochiweb request. It will
    will quietly allow us to replace mochiweb by cowboy. While I was here I
    also changed the way config changes are handled: the HTTP(s) listener is
    not any more restarted when only the dispatching rules change. Instead
    we update the cowboy dispatching rules.
    benoitc committed Jun 9, 2012
Commits on Jun 8, 2012
  1. @benoitc

    Initial steps to use mochicow.

    Replace mochiweb connection handling by the cowboy one. We are using
    mochiweb to skip the need to rewrite handlers for now. Most of tests
    pass, some are still hanging like the change one but it may be a time
    issue.
    benoitc committed Jun 8, 2012
Commits on May 26, 2012
  1. @benoitc

    Merge branch 'master' into view_changes

    Conflicts:
    	apps/couch_changes/include/couch_changes.hrl
    	apps/couch_changes/src/couch_changes.erl
    	apps/couch_changes/src/couch_httpd_changes.erl
    	apps/couch_replicator/src/couch_replicator_api_wrap.erl
    benoitc committed May 26, 2012
Commits on May 22, 2012
  1. @benoitc

    couch_stats is already loaded.

    benoitc committed May 22, 2012
  2. @benoitc

    don't use the ini to load couch_uuids.

    This module is always needed, there is no need to keep it in the
    configuration file.
    benoitc committed May 22, 2012
  3. @benoitc
  4. @benoitc

    extract couch_stats in its own app.

    couch_stats is now a full erlang application booted at startup. Other
    changes are a better reinitialization of settings. Instead of exiting
    the gen_server, we just load new settings and overwrite older.
    benoitc committed May 22, 2012
Commits on May 18, 2012
  1. @benoitc

    support system dbs. close #9 .

    Systems databases are databases only available and visible by admins.
    All systems databases are prefixed by `rc_` .
    
    Ex:
    
        $ curl -XPUT http://127.0.0.1:5984/rc_somesystemdb
        {"error":"unauthorized","reason":"You are not a server admin."}
        $ curl -XPUT http://admin:test@127.0.0.1:5984/rc_somesystemdb
        {"ok":true}
        $ curl http://admin:test@127.0.0.1:5984/_all_dbs
        ["_replicator","_users","rc_somesystemdb"]
        $ curl http://127.0.0.1:5984/_all_dbs
        ["_replicator","_users"]
        $ curl -XPUT http://admin:test@127.0.0.1:5984/rc_somesystemdb -d'{}'
        {"error":"file_exists","reason":"The database could not be created,
    the file already exists."}
        $ curl -XPUT http://admin:test@127.0.0.1:5984/rc_somesystemdb/test
    -d'{}'
        {"ok":true,"id":"test","rev":"1-967a00dff5e02add41819138abb3284d"}
        $ curl -XPUT http://127.0.0.1:5984/rc_somesystemdb/test1
    -d'{}'{"error":"unauthorized","reason":"You are not authorized to access
    this db."}
        $ curl
    http://127.0.0.1:5984/rc_somesystemdb/_all_docs{"error":"unauthorized","reason":"You
    are not authorized to access this db."}
        $ curl http://admin:test@127.0.0.1:5984/rc_somesystemdb/_all_docs
        {"total_rows":1,"offset":0,"rows":[
        {"id":"test","key":"test","value":{"rev":"1-967a00dff5e02add41819138abb3284d"}}
        ]}
    benoitc committed May 18, 2012
Commits on May 17, 2012
  1. @benoitc

    vhosts values should not be empty.

    A vhost value can be empty when removed with the couch_config module.
    benoitc committed May 17, 2012
Commits on May 16, 2012
  1. @benoitc

    all should be compile & deps.

    benoitc committed May 16, 2012
  2. @benoitc
  3. @benoitc
  4. @benoitc

    fix whitespaces

    benoitc committed May 16, 2012
  5. @benoitc
  6. @benoitc
  7. @benoitc

    fix whitespaces

    benoitc committed May 16, 2012
  8. @benoitc
Commits on May 12, 2012
  1. @benoitc

    filter fields in included doc when returned from a _changes

    With this changes you can only return a specified list of fields in the
    included docs by passing the list of them to an optionnal `fields`
    parameter. For now nested fields are ignored.
    
        $ curl -XPUT localhost:5984/testdb
        {"ok":true}
        $ curl -XPUT localhost:5984/testdb/test -d'{"f1": 1, "f2": 2, "f3":
    3}'
        {"ok":true,"id":"test","rev":"1-2b23983c05a9ca8015b6ea7bdc1b3478"}
        $ curl -XPUT localhost:5984/testdb/test1 -d'{"f1": 1, "f2": 4, "f3":
    3}'
        {"ok":true,"id":"test1","rev":"1-2942771a428c4b45315710db0b6aaa7a"}
        $ curl -XPUT localhost:5984/testdb/test2 -d'{"f1": 1, "f2": 7, "f3":
    8}'
        {"ok":true,"id":"test2","rev":"1-ac4cd62a83a0a98421e9ed74adcadcc3"}
        $ curl "http://localhost:5984/testdb/_changes?include_docs=true"
        {"results":[
        {"seq":1,"id":"test","changes":[{"rev":"1-2b23983c05a9ca8015b6ea7bdc1b3478"}],"doc":{"_id":"test","_rev":"1-2b23983c05a9ca8015b6ea7bdc1b3478","f1":1,"f2":2,"f3":3}},
        {"seq":2,"id":"test1","changes":[{"rev":"1-2942771a428c4b45315710db0b6aaa7a"}],"doc":{"_id":"test1","_rev":"1-2942771a428c4b45315710db0b6aaa7a","f1":1,"f2":4,"f3":3}},
        {"seq":3,"id":"test2","changes":[{"rev":"1-ac4cd62a83a0a98421e9ed74adcadcc3"}],"doc":{"_id":"test2","_rev":"1-ac4cd62a83a0a98421e9ed74adcadcc3","f1":1,"f2":7,"f3":8}}
        ],
        "last_seq":3}
        $ curl
    'http://localhost:5984/testdb/_changes?include_docs=true&fields=\["f1"\]'
        {"results":[
        {"seq":1,"id":"test","changes":[{"rev":"1-2b23983c05a9ca8015b6ea7bdc1b3478"}],"doc":{"_id":"test","_rev":"1-2b23983c05a9ca8015b6ea7bdc1b3478","f1":1}},
        {"seq":2,"id":"test1","changes":[{"rev":"1-2942771a428c4b45315710db0b6aaa7a"}],"doc":{"_id":"test1","_rev":"1-2942771a428c4b45315710db0b6aaa7a","f1":1}},
        {"seq":3,"id":"test2","changes":[{"rev":"1-ac4cd62a83a0a98421e9ed74adcadcc3"}],"doc":{"_id":"test2","_rev":"1-ac4cd62a83a0a98421e9ed74adcadcc3","f1":1}}
        ],
        "last_seq":3}
    
        $ curl
    'http://localhost:5984/testdb/_changes?include_docs=true&fields=\["f1","f2"\]'
        {"results":[
        {"seq":1,"id":"test","changes":[{"rev":"1-2b23983c05a9ca8015b6ea7bdc1b3478"}],"doc":{"_id":"test","_rev":"1-2b23983c05a9ca8015b6ea7bdc1b3478","f1":1,"f2":2}},
        {"seq":2,"id":"test1","changes":[{"rev":"1-2942771a428c4b45315710db0b6aaa7a"}],"doc":{"_id":"test1","_rev":"1-2942771a428c4b45315710db0b6aaa7a","f1":1,"f2":4}},
        {"seq":3,"id":"test2","changes":[{"rev":"1-ac4cd62a83a0a98421e9ed74adcadcc3"}],"doc":{"_id":"test2","_rev":"1-ac4cd62a83a0a98421e9ed74adcadcc3","f1":1,"f2":7}}
        ],
        "last_seq":3}
    
    Conflicts:
    
    	apps/couch_changes/src/couch_changes.erl
    benoitc committed May 12, 2012
  2. @benoitc
  3. @benoitc

    filter fields in included doc when returned from a _changes

    With this changes you can only return a specified list of fields in the
    included docs by passing the list of them to an optionnal `fields`
    parameter. For now nested fields are ignored.
    
        $ curl -XPUT localhost:5984/testdb
        {"ok":true}
        $ curl -XPUT localhost:5984/testdb/test -d'{"f1": 1, "f2": 2, "f3":
    3}'
        {"ok":true,"id":"test","rev":"1-2b23983c05a9ca8015b6ea7bdc1b3478"}
        $ curl -XPUT localhost:5984/testdb/test1 -d'{"f1": 1, "f2": 4, "f3":
    3}'
        {"ok":true,"id":"test1","rev":"1-2942771a428c4b45315710db0b6aaa7a"}
        $ curl -XPUT localhost:5984/testdb/test2 -d'{"f1": 1, "f2": 7, "f3":
    8}'
        {"ok":true,"id":"test2","rev":"1-ac4cd62a83a0a98421e9ed74adcadcc3"}
        $ curl "http://localhost:5984/testdb/_changes?include_docs=true"
        {"results":[
        {"seq":1,"id":"test","changes":[{"rev":"1-2b23983c05a9ca8015b6ea7bdc1b3478"}],"doc":{"_id":"test","_rev":"1-2b23983c05a9ca8015b6ea7bdc1b3478","f1":1,"f2":2,"f3":3}},
        {"seq":2,"id":"test1","changes":[{"rev":"1-2942771a428c4b45315710db0b6aaa7a"}],"doc":{"_id":"test1","_rev":"1-2942771a428c4b45315710db0b6aaa7a","f1":1,"f2":4,"f3":3}},
        {"seq":3,"id":"test2","changes":[{"rev":"1-ac4cd62a83a0a98421e9ed74adcadcc3"}],"doc":{"_id":"test2","_rev":"1-ac4cd62a83a0a98421e9ed74adcadcc3","f1":1,"f2":7,"f3":8}}
        ],
        "last_seq":3}
        $ curl
    'http://localhost:5984/testdb/_changes?include_docs=true&fields=\["f1"\]'
        {"results":[
        {"seq":1,"id":"test","changes":[{"rev":"1-2b23983c05a9ca8015b6ea7bdc1b3478"}],"doc":{"_id":"test","_rev":"1-2b23983c05a9ca8015b6ea7bdc1b3478","f1":1}},
        {"seq":2,"id":"test1","changes":[{"rev":"1-2942771a428c4b45315710db0b6aaa7a"}],"doc":{"_id":"test1","_rev":"1-2942771a428c4b45315710db0b6aaa7a","f1":1}},
        {"seq":3,"id":"test2","changes":[{"rev":"1-ac4cd62a83a0a98421e9ed74adcadcc3"}],"doc":{"_id":"test2","_rev":"1-ac4cd62a83a0a98421e9ed74adcadcc3","f1":1}}
        ],
        "last_seq":3}
    
        $ curl
    'http://localhost:5984/testdb/_changes?include_docs=true&fields=\["f1","f2"\]'
        {"results":[
        {"seq":1,"id":"test","changes":[{"rev":"1-2b23983c05a9ca8015b6ea7bdc1b3478"}],"doc":{"_id":"test","_rev":"1-2b23983c05a9ca8015b6ea7bdc1b3478","f1":1,"f2":2}},
        {"seq":2,"id":"test1","changes":[{"rev":"1-2942771a428c4b45315710db0b6aaa7a"}],"doc":{"_id":"test1","_rev":"1-2942771a428c4b45315710db0b6aaa7a","f1":1,"f2":4}},
        {"seq":3,"id":"test2","changes":[{"rev":"1-ac4cd62a83a0a98421e9ed74adcadcc3"}],"doc":{"_id":"test2","_rev":"1-ac4cd62a83a0a98421e9ed74adcadcc3","f1":1,"f2":7}}
        ],
        "last_seq":3}
    benoitc committed May 12, 2012
Commits on May 11, 2012
  1. @benoitc @benoitc

    fix purge

    benoitc committed with benoitc Apr 10, 2012
  2. @benoitc

    Revert "fix include:"

    This reverts commit ed0076d3fdbf2b2cf28acb204f48fe07db65440f.
    benoitc committed Mar 27, 2012
  3. @benoitc

    fix include:

    benoitc committed Mar 27, 2012
  4. @benoitc

    change order

    benoitc committed Mar 27, 2012
  5. @benoitc

    fix imports

    benoitc committed Mar 23, 2012
  6. @benoitc

    Get view changes using a view query.

    Add the possibility to the function `couch_mrview:view_changes_since` to
    accept some **view query parameters** like `key`, `start_key` &
    `end_key`. Instead of fetching all changes in a view from last updated
    it will fetch changes only from the results of the query.  It returns an
    error  if the option `seq_indexed` hasn't been set to `true` in the
    view options:
    
            {
                "_id": "_design/somedoc",
                "views": {
                    "someview": {
                        "map": "function(doc) { if (doc.field)
    emit(doc.field, null); }",
                        "options": {
                            "seq_indexed": "true"
                        }
                    }
                }
            }
    
    This is done by adding an index (b-tree) to each view. This index
    associate the view key with the doc sequence. `{{Key, Seq}, {DocId, Value}}`
    is stored in this btree.
    benoitc committed Feb 26, 2012
  7. @benoitc

    add support for `include_deleted: true` option in a design document.

    This option allows a view to map deleted documents.
    
    Remember that documents deleted with the DELETE HTTP verb will look like
    {_id: id, _rev: rev, _deleted: true} to the indexer. If you want to
    store extra data on the deleted document you can use _bulk_docs or
    updating a document with the member '_deleted: true' using the HTTP verb
    PUT.
    benoitc committed Feb 26, 2012
  8. @benoitc

    fix _changes test

    The `_view` filter now need a view group indexed by sequences.
    benoitc committed Feb 29, 2012
  9. @benoitc

    `_view` filter is now hanled by couch_mrview:view_changes_since/7

    Rather than passing all doc sent y couch_db:changes_since/5 to a
    transformed view function we are now using the more efficient
    `couch_mrview:view_changes_since/7` wich use the seq btree in the view
    group.
    
    Also add the parameters `view_filter=DName/FilterName` which allows to
    filter any view changes using the fiter function `FilterName` from the
    design document `DName`:
    
       GET http://<node>/<dbname>/_changes?filter=_view&view=<viewname>&view_filter<filtername>
    
    Where variables are:
    
    - <node>: URL of the CouchDB node
    - <dbname>: Name of the database
    - <viewname>: DesignId/ViewNameThe name of the view in the views properties
      from the design document DesignId`
    - <filtername>: DesignId1/FilterName The name of the filter in
      the filters properties from the design document DesignId1
    
    The difference with the old behaviour is that you really accessing the
    view index instead of passing each map function to all the changed docs
    wich is a way more efficient (you do'nt open a system process, serialize
    the function, pass it to the process, wait for return, test it and
    eventually return a change). You can also filter the results. Other
    advantages are that the views are refreshed in real time when the
    database content changes and the view changes are only triggered if the
    index is updated.
    benoitc committed Feb 23, 2012