Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 97 lines (70 sloc) 4.113 kb
3fb42041 » whoahbot
2009-05-26 renamed back to dm-redis-adapter, fixed a bug with #update
1 h1. dm-redis-adapter
76c2c5c2 » whoahbot
2009-03-14 refactored to use the dm-core/next branch, a few rewrites of the inte…
2
386f5af9 » whoahbot
2011-05-19 more specs, and a fix for the README thanks to @alecbenzer
3 This is a <a href="http://datamapper.org">DataMapper</a> adapter for the <a href="http://redis.io/">Redis</a> key-value store.
ce8604bc » whoahbot
2009-03-19 update of the readme
4
386f5af9 » whoahbot
2011-05-19 more specs, and a fix for the README thanks to @alecbenzer
5 Redis is a very fast key-value store with some interesting data structures added, and oh so much more. You can have a key that is a SET, LIST, STRING or HASH that is binary safe. Data structures like SET and LIST allow for even more interesting things. Redis is a fabulous and fast engine for data structures, and you can read more about it here: <a href="http://code.google.com/p/redis/">redis</a>. Redis is also a persistent data store, and can be used in large-scale environments with master-slave replication and consistent hashing on the client side. Redis makes everyone happy and has been known to cause sunshine to spontaneously break out in clouded areas.
1c3e1f6f » whoahbot
2009-05-29 Newer version of rubyredis.rb, updates to the Readme
6
386f5af9 » whoahbot
2011-05-19 more specs, and a fix for the README thanks to @alecbenzer
7 <a href="http://datamapper.org">DataMapper</a> is a brilliant ORM that is based on the <a href="http://www.martinfowler.com/eaaCatalog/identityMap.html">IdentityMap</a> pattern. Usage of DataMapper resembles that of ActiveRecord, the popular ORM bundled with Ruby on Rails, but with some very important differences. A quote from the DM wiki: "One row in the database should equal one object reference. Pretty simple idea. Pretty profound impact." Having an identity map allows for very efficient queries to the database, as well as interesting forms of lazy loading of attributes or associations.
1c3e1f6f » whoahbot
2009-05-29 Newer version of rubyredis.rb, updates to the Readme
8
6e217757 » whoahbot
2009-09-15 updates to the README, merging gem updates and fabulous library updat…
9 Marrying DataMapper to Redis allows for schema-less models, you can add fields at any time without having to create a migration. DataMapper also allows us to store non-native Redis types in the db, like Date fields.
e97d531f » whoahbot
2009-05-29 finishing up the readme
10
af44e203 » whoahbot
2010-04-26 Version bump, updates to the README
11 h1. Changelog
12
386f5af9 » whoahbot
2011-05-19 more specs, and a fix for the README thanks to @alecbenzer
13 * v0.4.0 Support for dm-core v1.1.0
0b5fc962 » whoahbot
2011-03-13 Updates to gemspec file and README
14 * v0.3.0 Updates to support ruby 1.9.2 (thanks arbarlow!)
2696ce3d » whoahbot
2010-07-12 Adding fixes for sorting and .first and .last thanks to cehoffman's fork
15 * v0.2.1 Fixes to sorting
3ba88875 » whoahbot
2010-05-18 updating to newer version of redis-rb v2.0.0
16 * v0.1.1 Update to redis-rb v2.0.0
dd35cb95 » whoahbot
2010-04-28 Updates to the readme and gemspec to warn about incompatibility with …
17 * v0.1 Update to store records as redis hash values
af44e203 » whoahbot
2010-04-26 Version bump, updates to the README
18 * v0.0.11 Updates to support newer versions of the redis client, support for JSON datatypes
19
ce8604bc » whoahbot
2009-03-19 update of the readme
20 h1. Install
76c2c5c2 » whoahbot
2009-03-14 refactored to use the dm-core/next branch, a few rewrites of the inte…
21
7533c27b » whoahbot
2009-05-24 Moving to rubyredis client lib for now until it's merged in with redi…
22 Prerequisites:
1c3e1f6f » whoahbot
2009-05-29 Newer version of rubyredis.rb, updates to the Readme
23 * Redis:
386f5af9 » whoahbot
2011-05-19 more specs, and a fix for the README thanks to @alecbenzer
24 ** <a href="http://code.google.com/p/redis/">Redis, v2.2 series</a>
6f126037 » whoahbot
2009-06-02 New gem version, using merged ruby redis adapter. Working on server-s…
25
6e217757 » whoahbot
2009-09-15 updates to the README, merging gem updates and fabulous library updat…
26 Install the dm-redis adapter:
6f126037 » whoahbot
2009-06-02 New gem version, using merged ruby redis adapter. Working on server-s…
27 <pre>
28 <code>
1c91eb16 » whoahbot
2010-02-04 New gem version 0.0.7, updates to README
29 > gem install dm-redis-adapter
6f126037 » whoahbot
2009-06-02 New gem version, using merged ruby redis adapter. Working on server-s…
30 </code>
31 </pre>
1c3e1f6f » whoahbot
2009-05-29 Newer version of rubyredis.rb, updates to the Readme
32
33 h1. Usage
34
35 Setup your adapter, define your models and properties:
36
37 <pre>
38 <code>
51ffd2a6 » whoahbot
2009-06-13 Fixes for the README example.
39 require 'rubygems'
e97d531f » whoahbot
2009-05-29 finishing up the readme
40 require 'dm-core'
386f5af9 » whoahbot
2011-05-19 more specs, and a fix for the README thanks to @alecbenzer
41 require 'dm-redis-adapter'
fac298ed » cehoffman
2010-03-04 Whitespace
42
1c3e1f6f » whoahbot
2009-05-29 Newer version of rubyredis.rb, updates to the Readme
43 DataMapper.setup(:default, {:adapter => "redis"})
fac298ed » cehoffman
2010-03-04 Whitespace
44
1c3e1f6f » whoahbot
2009-05-29 Newer version of rubyredis.rb, updates to the Readme
45 class Cafe
46 include DataMapper::Resource
fac298ed » cehoffman
2010-03-04 Whitespace
47
1c3e1f6f » whoahbot
2009-05-29 Newer version of rubyredis.rb, updates to the Readme
48 property :id, Serial
49 property :name, Text
50 end
fac298ed » cehoffman
2010-03-04 Whitespace
51
1c3e1f6f » whoahbot
2009-05-29 Newer version of rubyredis.rb, updates to the Readme
52 Cafe.create(:name => "Whoahbot's Caffienitorium")
53 </code>
54 </pre>
55
6e217757 » whoahbot
2009-09-15 updates to the README, merging gem updates and fabulous library updat…
56 Now you can use redis in a ORM style, and take advantage of all of the amazing things that DataMapper offers.
57
cd3ef2dd » whoahbot
2010-03-01 Finishing validation support, indexes, refactoring
58 If you want to do finds on specific String fields, add an index:
59
60 <pre>
61 <code>
62 class Coffee
63 include DataMapper::Resource
fac298ed » cehoffman
2010-03-04 Whitespace
64
cd3ef2dd » whoahbot
2010-03-01 Finishing validation support, indexes, refactoring
65 property :id, Serial
66 property :description, String, :index => true
67 end
fac298ed » cehoffman
2010-03-04 Whitespace
68
cd3ef2dd » whoahbot
2010-03-01 Finishing validation support, indexes, refactoring
69 Coffee.create(:description => "Notes of crude oil and sulphur")
70 Coffee.first(:description => "Notes of crude oil and sulphur") # will now work
71 </code>
72 </pre>
73
74 Validations on unique fields are now supported through indices and dm-validations:
75
76 <pre>
77 <code>
78 class Crumblecake
79 include DataMapper::Resource
80 validates_is_unique :flavor
81
82 property :id, Serial
83 property :flavor, String, :index => true
84 end
fac298ed » cehoffman
2010-03-04 Whitespace
85
cd3ef2dd » whoahbot
2010-03-01 Finishing validation support, indexes, refactoring
86 Crumblecake.create(:flavor => "snozzbler")
87 Crumblecake.new(:flavor => "snozzbler").valid? # false (of course! Who ever heard of a snozzbler crumblecake?)
88 </code>
89 </pre>
90
6e217757 » whoahbot
2009-09-15 updates to the README, merging gem updates and fabulous library updat…
91 h1. Badass contributors
92
93 * <a href="http://github.com/aeden">Anthony Eden (aeden)</a> Gem cleanup, update to jeweler
9049109c » whoahbot
2010-03-04 Removing -1 for ids, updating README
94 * <a href="http://github.com/sr">Simon Roset (sr)</a> Fixes for edge dm-core
2696ce3d » whoahbot
2010-07-12 Adding fixes for sorting and .first and .last thanks to cehoffman's fork
95 * <a href="http://github.com/cehoffman">Chris Hoffman (cehoffman)</a> Fixes for Ruby 1.9, bundler for development deps, fixes for sorting
0b5fc962 » whoahbot
2011-03-13 Updates to gemspec file and README
96 * <a href="http://github.com/bpo">brian p o'rourke (bpo)</a> Updates for newer versions of redis client and DM JSON type support, move to hash storage
97 * <a href="http://github.com/arbarlow">Alex Barlow (arbarlow)</a> Fixes for ruby 1.9.2
98
Something went wrong with that request. Please try again.