couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Couchdb Wiki] Update of "Getting_started_with_Perl" by CalleDybedahl
Date Tue, 02 Nov 2010 10:37:22 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The "Getting_started_with_Perl" page has been changed by CalleDybedahl.
The comment on this change is: Net::CouchDB is no longer maintained, and CouchDB::Client works
fine with current CouchDB versions..
http://wiki.apache.org/couchdb/Getting_started_with_Perl?action=diff&rev1=5&rev2=6

--------------------------------------------------

  Getting started with Perl and the CouchDB API.
  
- The following shows the basics of working with the raw CouchDB REST api from Perl. If you
want a richer interface that more tightly maps Couch documents into Perl (so you don't have
to deal with JSON manually, for example), you should pick your favourite out of the several
implementations: [[http://wiki.github.com/mndrix/net-couchdb|Net::CouchDB]], [[http://search.cpan.org/dist/CouchDB-Client/|CouchDB::Client]],
[[http://search.cpan.org/dist/AnyEvent-CouchDB/|AnyEvent::CouchDB]], [[http://search.cpan.org/dist/DB-CouchDB-Schema/|DB::CouchDB::Schema]],
or for POE lovers [[http://search.cpan.org/dist/POE-Component-Client-CouchDB/|POE::Component::Client::CouchDB]].
+ The following shows the basics of working with the raw CouchDB REST api from Perl. If you
want a richer interface that more tightly maps Couch documents into Perl (so you don't have
to deal with JSON manually, for example), you should pick your favourite out of the several
implementations: [[http://search.cpan.org/dist/CouchDB-Client/|CouchDB::Client]], [[http://search.cpan.org/dist/AnyEvent-CouchDB/|AnyEvent::CouchDB]],
[[http://search.cpan.org/dist/DB-CouchDB-Schema/|DB::CouchDB::Schema]], or for POE lovers
[[http://search.cpan.org/dist/POE-Component-Client-CouchDB/|POE::Component::Client::CouchDB]]
- 
- Currently (16/9/2009) Net::CouchDB and CouchDB::Client seem to not work against current
couchdb. AnyEvent::CouchDB seems to work (tested getting a database and creating a document
so far).
  
  Note that these examples all use the new version of CouchDB, with a JSON interface rather
than XML.
  
  == Example Wrapper Class ==
- 
  You can save this to a file named ''CouchDB.pm'', then just use it from your program with
''use CouchDB;''. But if you're going to do anything more than mess around, I would recommend
getting the Net::!CouchDb module from CPAN.
  
  {{{
@@ -88, +85 @@

  
  1;
  }}}
- 
  == Creating a Database ==
- 
  To create a database called ''foo'':
  
  {{{
  my $db = CouchDB->new('localhost', '5984');
  $db->put("foo");
  }}}
- 
  == Deleting a Database ==
- 
  To delete a database called ''foo'':
  
  {{{
  my $db = CouchDB->new('localhost', '5984');
  $db->delete("foo");
  }}}
- 
  == Creating a Document ==
- 
  To create a document in the database ''foo'' with the id ''document_id'':
  
  {{{
@@ -126, +117 @@

  }
  JSON
  }}}
- 
  == Reading a Document ==
- 
  To read a document from database ''foo'' with the id ''document_id'':
  
  {{{

Mime
View raw message