CouchDB: Couchview has been replaced by couchapp

23 views
Skip to first unread message

Jaigouk

unread,
Feb 3, 2009, 7:57:16 AM2/3/09
to PeepCode
http://github.com/jchris/couchapp

$ couchapp
Usage: /opt/local/bin/couchapp [options] (push|generate)
-q, —quiet Omit extra debug info
-h, —help Display detailed help and exit
-v, —version Display version number
please specify a command

But the example app still works!

Thanks,
- Jai-Gouk, Kim

topfunky

unread,
Feb 3, 2009, 12:29:19 PM2/3/09
to PeepCode
On Feb 3, 4:57 am, Jaigouk <jaig...@gmail.com> wrote:
> http://github.com/jchris/couchapp

That looks very interesting! It appears that CouchREST is still alive
as a separate project for interacting with CouchDB from Ruby, but
CouchApp works for self-contained apps.

Geoffrey Grosenbach

topfunky

unread,
Feb 3, 2009, 12:53:54 PM2/3/09
to PeepCode
On Feb 3, 9:29 am, topfunky <topfunkycorporat...@gmail.com> wrote:
> On Feb 3, 4:57 am, Jaigouk <jaig...@gmail.com> wrote:
> >http://github.com/jchris/couchapp

Hmm...apparently I was wrong and the syncing portion has moved to
CouchApp. Thanks for the heads up.

Geoffrey Grosenbach

Jaigouk

unread,
Feb 3, 2009, 7:11:09 PM2/3/09
to PeepCode
CouchDB is awesome but it is still young. I heard that Matt is working
on couchrest.
I hope to see couchdb screencast update when couchdb version 1.0 comes
out. :)

Here is what jchris said about the changes at couchrest google group
http://groups.google.com/group/couchrest/browse_thread/thread/351ed1b9ae08b0a1

=====================================================
Couchapp is equivalent to couchview, except for a few details about
how it expects to see documents stored on the filesystem.

If I recall correctly, couchview takes something like this

views/test-map.js
views/test-reduce.js

and pushes it to the views member of a design doc, which you'd specify
on the command line, with a default of falling back to a directory
name. Couchview does that job just fine, but it is no generalized to
handle the other functions that can be stored in a design doc.

the CouchApp script takes a filesystem and pushes it transparently to
a design doc, so the on-disk layout it expects is a little different:

views/test/map.js
views/test/reduce.js
validate_doc_update.js
shows/post.js
lists/index.js
_attachments/images/example.png
_attachments/foo/bar.html

you are free to leave any of that out (so if you only care about views
then you should be able to use it just fine.)

currently the python version of couchapp also has the ability to
"clone" from a url. I'm working on getting the ruby version back up to
speed, but for now you might be happiest installing the python
version.

http://github.com/jchris/couchapp/tree/master

Chris

darrinholst

unread,
Feb 5, 2009, 11:34:53 AM2/5/09
to PeepCode
Not sure if there is a direct replacement for push_views in couchapp,
but I couldn't find one. Here's what i did do to get the peepcode
notes app working with the latest couchrest/couchapp (0.12.6/0.1.7)

change views directory structure to

__db
____couchdb
______notes
________views
__________by_tag-map
____________map.js
__________by_tag-reduce
____________map.js
____________reduce.js
__________by_title-map
____________map.js

and change the basic_model auto synchronizer to

# Synchronize views
file_manager = CouchApp::FileManager.new(File.basename
(full_url_to_database))
base_dir = File.join(Rails.root, 'db', 'couchdb')

Dir.foreach(base_dir) do |d|
file_manager.push_app(File.join(base_dir, d), d) unless d[0] == ?.
end


Darrin

topfunky

unread,
Feb 5, 2009, 11:57:42 AM2/5/09
to PeepCode
On Feb 5, 8:34 am, darrinholst <darrin.ho...@gmail.com> wrote:
> Not sure if there is a direct replacement for push_views in couchapp,
> but I couldn't find one. Here's what i did do to get the peepcode
> notes app working with the latest couchrest/couchapp (0.12.6/0.1.7)...

Fantastic. I'll update the screencast to mention this.

Geoffrey Grosenbach

klancaster1957

unread,
Feb 13, 2009, 11:51:49 AM2/13/09
to PeepCode
On Feb 5, 10:57 am, topfunky <topfunkycorporat...@gmail.com> wrote:

>
> Fantastic. I'll update the screencast to mention this.
>
> Geoffrey Grosenbach

Has the code or the screencast been updated yet? I purchased the first
version, and am trying to update an app now to work with the recent
changes.

Keith

adnan.

unread,
Feb 21, 2009, 9:43:52 PM2/21/09
to PeepCode
I hacked this up a little, I added active record validation (copied
from how it was done in active_form)

but it's a bad hack job.
Reply all
Reply to author
Forward
0 new messages