Skip to content
This repository
Newer
Older
100644 37 lines (21 sloc) 2.494 kb
d06daac4 »
2010-05-04 Added release notes.
1 h3. RelaxDB 0.5
2
3 RelaxDB documents are now directly backed by the hash created by @JSON.parse@. This offers a significant real-world performance improvement. This change means that instance variables that map to CouchDB properties should no longer be manipulated directly - doing this was always a little risky as the behaviour was never firmly defined. But, if you need to preserve such behaviour use @data['my_prop_name']@ instead of the @my_prop_name@ instance variable.
4
5 The methods has_one, has_n and references_many have been removed. Although convenient, in practice, their use contributed to non-idiomatic usage of CouchDB. Storing an array of document ids may be a suitable replacement for references_many as the underlying docs can be retrieved in a single query.
6
7
9b85b88d »
2010-04-10 Release prep.
8 h3. RelaxDB 0.4
9
10 RelaxDB 0.4 contains a number of breaking changes. However, most clients should be able to upgrade smoothly.
11
12 h4. Views
13
0795d068 »
2010-04-10 Textile syntax fix, maybe.
14 The largest change concerns automatic view generation. Prior to 0.4 an invocation of @view_by :foo@ would create a JavaScript view in CouchDB of the form @emit(doc.foo, doc);@. This idiom is generally advised against. It makes view generation comparatively slow, and in particular, causes performance issues for large databases. In 0.4 @view_by :foo@ now creates a map of the form @emit(doc.foo, 1);@ and creates a reduce using the @_sum@ builtin.
9b85b88d »
2010-04-10 Release prep.
15
0795d068 »
2010-04-10 Textile syntax fix, maybe.
16 If view size isn't an issue for you, legacy behaviour can be preserved by replacing all invocations of @view_by@ with @view_docs_by@. Similarly, any invocations of @RelaxDB.view@ against auto-generated views should be replaced with @RelaxDB.docs@.
9b85b88d »
2010-04-10 Release prep.
17
0795d068 »
2010-04-10 Textile syntax fix, maybe.
18 Note that @view_by@ invocations no longer add paginate methods to the current class. Paginating over these views should be done with one of @RelaxDB.paginate@ or @RelaxDB.qpaginate@.
9b85b88d »
2010-04-10 Release prep.
19
20 h4. View Uploading
21
22 The standard idiom for saving autogenerated views is now
23
24 <pre>
25 <code>
26 RelaxDB.enable_view_creation
27 require File.dirname(__FILE__) + '/spec_models.rb'
28 RelaxDB::View.design_doc.save
29 </code>
30 </pre>
31
0795d068 »
2010-04-10 Textile syntax fix, maybe.
32 The explicit call to @.save@ is new in 0.4. It was added to enable creating all views in a single request, rather than requiring a request per view.
9b85b88d »
2010-04-10 Release prep.
33
34 h4. Pagination
35
36 The standard paginate method makes three requests against CouchDB. One to retrieve the docs and a further two to determine if next and prev links should exist. In some instances it may be preferable to save two requests and present potentially spurious pagination links. The qpaginate method does just this.
Something went wrong with that request. Please try again.