Commit graph

147 commits

Author SHA1 Message Date
John Wood b26f90d2ff Added support for couchdb-lucene.
Added a search method to CouchRest:Database to search the documents in a
given database.  Added support for a :search parameter to Collection's
paginated_each method, which will allow you to paginate over a set of
search results.

This code has been brought to you by Dave Farkas (sakrafd) and
Arnaud Berthomier (oz).
2010-03-15 19:20:07 -05:00
sauy7 3c314e14d0 Patching in fixes for missing uri scheme in CouchRest.parse and adding support for continuous replication 2010-03-10 18:49:31 -06:00
Pierre Larochelle cc9ed83cd3 Added an update_doc method to database to handle conflicts during atomic updates.
Also added appropriate specs

Signed-off-by: Marcos Tapajós <tapajos@gmail.com>
2010-02-27 19:05:55 -03:00
Noah Zoschke a856e98a6a remove double CGI escape when PUTting an attachment
Signed-off-by: Marcos Tapajós <tapajos@gmail.com>
2010-02-26 21:00:45 -03:00
Julien Kirch 38dad4bc78 added ascending compatability with restclient-1.4.0
Signed-off-by: Will Leinweber <will@bitfission.com>
2010-02-23 16:21:00 -06:00
Damien Mathieu ec51c34f7d recreating a non-existant database shouldn't raise any exception (and we make sure of it)
Signed-off-by: Marcos Tapajós <tapajos@gmail.com>
2010-02-03 14:09:56 -02:00
Sam Lown iMac 08cf9e59b6 Fixing incorrectly generated document URIs with testing
Signed-off-by: Marcos Tapajós <tapajos@gmail.com>
2010-01-03 21:42:22 -02:00
Igal Koshevoy d0d5eec199 Added CouchRest::Database#bulk_save_doc and #batch_save_doc as human-friendlier wrappers around #save_doc. 2009-11-15 23:15:20 -08:00
Igal Koshevoy 62ea68df63 Improved CouchRest::Database#save_doc, added "batch" mode to significantly speed up saves at cost of lower durability gurantees. 2009-11-15 23:14:09 -08:00
Julien Sanchez b5d6baaf11 Save on Document & ExtendedDocument crashed if bulk
- document#save expects to receive {"ok" => true} even with bulk mode
- ExtendedDocument#save_without_callbacks reverted to previous code
  (expecting result["ok"] as in create_without_callbacks)
2009-10-18 01:59:31 +08:00
Matt Aimonetti ccdf9d779a removed the Database class deprecation notices 2009-08-24 17:32:34 -07:00
Peter Gumeson 1938270d65 Merge commit 'mattetti/master' 2009-08-12 16:48:13 -07:00
Matt Aimonetti 5270fde0fa added an option to force the deletion of a attachment 2009-07-29 20:12:35 -07:00
Matt Aimonetti 9141669df1 extracted the rest API to its own module 2009-07-29 18:32:34 -07:00
Peter Gumeson 1e44302d1a Merge commit 'mattetti/master' 2009-07-19 00:01:07 -07:00
Matt Aimonetti b2a29d9eb7 started extracting the http layer 2009-07-14 01:43:40 -07:00
Peter Gumeson fc18b47800 Merge commit 'mattetti/master' 2009-06-11 21:18:37 -07:00
Matt Aimonetti c18567f8fc differentiated attachment's URI and URL 2009-06-07 18:51:31 -07:00
Peter Gumeson 76b1563539 Renamed new_document? and new_model? to simply new? 2009-06-04 20:44:44 -07:00
Matt Aimonetti 295c0f0511 fixed the design doc cache issue 2009-05-27 23:59:43 -07:00
Matt Aimonetti c35c35157a added an automated way to mark design docs as dirty after the db was reset 2009-05-27 18:16:50 -07:00
Matt Aimonetti e48a6c8866 fixed all the specs so we are back to green 2009-05-26 18:27:49 -07:00
Matt Aimonetti 92b77a9649 fixed bulk_load/get_bulk and the specs 2009-05-13 20:44:57 -07:00
Chris Anderson 8363aa6298 added bulk_load macro 2009-05-08 19:00:39 -07:00
Chris Anderson 09dcc9e5c2 Revert "Server URI can now include a prefix to the database name"
This reverts commit 14acd95444.
2009-03-31 12:24:04 -07:00
Brian Candler 14acd95444 Server URI can now include a prefix to the database name 2009-03-27 10:27:04 -07:00
Brian Candler 190bd13723 Escape slash in database name 2009-03-27 10:26:54 -07:00
Brian Candler af6ac7df89 Remove obsolete 'move' methods 2009-03-27 11:50:42 +00:00
Brian Candler ec7848b783 Multiple database support for ExtendedDocument.
New optional parameters are available to select the database:

Mixins::DocumentQueries
  * get <id>, <db>
  * all :database => <db>
  * first :database => <db>

Mixins::Views
  * view <name>, :database => <db>
  * all_design_doc_versions <db>
  * cleanup_design_docs! <db>

Mixins::DesignDoc
  * refresh_design_doc now only updates the design_doc _id and removes _rev
  * call save_design_doc to save and update the design_doc
  * call save_design_doc_on <db> to save the design doc on a given
    database without modifying the model's design_doc object

Design (core/design.rb)
  * new method view_on <db>, ...

Bug fixes:
  * design_doc_slug in mixins/design_doc.rb was using an empty document
    to calculate the slug each time
  * method_missing in core/extended_document.rb now passes a block through
2009-03-27 11:27:37 +00:00
Geoff Buesing a1a4985149 Namespace Extlib versions of class_inheritable_accessor methods with extlib_prefix, as done in Wycats' Rails fork, so that their inclusion won't overwrite existing ActiveSupport implementations, if present. Check for existence of Class extensions on a per-method basis. 2009-03-19 16:59:22 -07:00
Geoff Buesing 4d8314124b Remove CouchRest.move, CouchRest::Database#move and #move_doc, because these methods are no longer supported by CouchDB
Ref: http://n2.nabble.com/Removing-MOVE-td2490780.html#a2490780
2009-03-18 11:22:49 -05:00
Chris Anderson fbc21aacd9 updater is simpler now that I learned about open_revs=all 2009-03-14 19:00:26 -07:00
Chris Anderson 8964a9b282 created upgrade helper 2009-03-14 18:42:34 -07:00
Chris Anderson 7b03c7ba25 fix for design doc url changes 2009-03-09 13:12:28 -07:00
Matt Aimonetti 813f673d88 increased the bulk cache limit to 500, it can be manually increased up to 1000 safely 2009-03-05 15:06:56 -08:00
Matt Aimonetti 55ecda2c90 spec'd casted extended document 2009-03-02 21:15:02 -08:00
Matt Aimonetti 80317f31a5 fixed the uuid count for the latest version of couchdb
also avoided CONSTANTS warnings, cleaned up the attachment specs, added missing fixtures
2009-02-25 00:22:11 -08:00
Matt Aimonetti fe489f2d38 removed CouchRest::Model, added more specs and fixed a bug with casted CR::ExtendedDocument 2009-02-24 22:51:13 -08:00
Matt Aimonetti c4cce18389 added database.bulk_delete as an alias for #bulk_save, added support for Model.by_view_name in ExtendedDoc and bumped the version to 0.13.3 2009-02-17 00:36:11 -08:00
Matt Aimonetti c0abafd1e0 fixed a major bug with inheritance and the class database setup. (plus some validation bugs) 2009-02-10 16:10:35 -08:00
Matt Aimonetti 890b60cae4 added autovalidation (auto_validate! in your ExtendedDocument) and extracted some extlib stuff so we will soon be able to remove the dependency. 2009-02-05 17:06:12 -08:00
Matt Aimonetti e9930c5a86 extracted the response class to its own file 2009-02-05 16:56:48 -08:00
Matt Aimonetti 08c7f2107c moved stuff around and cleaned up some deprecation notices [save/save_doc] 2009-02-02 16:10:07 -08:00
Chris Anderson 60c577963d all specs pass; refined attachment api 2009-02-02 15:24:31 -08:00
Matt Aimonetti 83d7341553 Started on the ExtendedDocument class with features moved to mixins.
Properties got added, they define getters, setters and aliases.
They will also be the base of the new validation system.
2009-02-02 14:51:41 -08:00
Matt Aimonetti d9fe6ba374 Started the refactoring work on couchrest.
* A server can have multiple defined available databases set to be used by documents (think DM repos)
* A server can have a default database so documents can easily share the same db connection
* Let a document class have a default database to use
* Give access to a document uri
* extracted some of the document features to a mixin
2009-02-02 14:51:41 -08:00
Matt Aimonetti 84e2bf94e4 slight change of API, CR::Document now uses <action>_doc instead of <action>, also added #create! and #recreate! to Document instances 2009-02-02 14:50:30 -08:00
Matt Lyon a4a2b202ae Added attachment methods to CocuhRest::Document: #put_attachment, #fetch_attachment and #delete_attachment. Note you can overwrite exisitng attachments with #put_attachment. 2009-02-02 01:25:14 -08:00
Matt Lyon b915f7f708 - Added Database#delete_attachment, for removing them directly
- Modified Database#fetch_attachment to take a doc as its first argument +as well as+ a docid, to be consistent with the other attachment methods.
- Refactored the attachment uri generation used by #fetch_attachment, #put_attachment, and #delete_attachment to a common private method, #uri_for_attachment
2009-02-02 01:25:14 -08:00
Matt Lyon 9b3b56bbf5 documentation for Document#copy and #move, copied from Database 2009-02-02 01:25:13 -08:00