README.md in gitmodel-0.0.2 vs README.md in gitmodel-0.0.3

- old
+ new

@@ -15,17 +15,10 @@ Because the database is a Git repository it can be synced across multiple machines, manipulated with standard Git client tools, can be branched and merged, and of course keeps the history of all changes. -Status ------- - -_It is nowhere near production ready but I'm working on it. Please feel free to -contribute tests and/or code to help!_ - - Why it's awesome ---------------- * Schema-less NoSQL data store * Each record is a normal Ruby object, attributes are any Ruby type or large @@ -36,20 +29,37 @@ * GitModel can actually work with different branches * Branch or tag snapshots of your data * Experiment on production data using branches, for example to test a migration * Distributed (synced using standard Git push/pull) +* All ActiveModel * Transactions * Metadata for all database changes (Git commit messages, date & time, etc.) * In order to be easily human-editable, the database is simply files and directores stored in a Git repository. GitModel uses the Git repo directly (rather than Git's checked-out "working copy") but you can do a "git checkout" to view and manipulate the database contents, and then "git commit" * Test-driven development and excellent test coverage * Clean and easy-to-use API +Status +------ + +_It is not yet production ready but I'm working on it. Please feel free to +contribute tests and/or code to help!_ + +See the "To do" section below for details, but the main thing that needs +finishing is support for querying. Right now you can find an instance by it's +id, but there is incomplete support (90% complete) for querying, e.g.: + + Post.find(:category => 'ruby', :date => lambda{|d| d > 1.month.ago} :order_by => :date, :order => :asc, :limit => 5) + +This includes support for indexing all attributes so that queries don't need to +load every object. + + Installation ------------ It's available as a [RubyGem](https://rubygems.org/gems/gitmodel): @@ -75,10 +85,12 @@ p1 = Post.new(:id => 'lessons-learned', :title => 'Lessons learned', :body => '...') p1.image = some_binary_data p1.save! + p = Post.find('lessons-learned') + p2 = Post.new(:id => 'hotdog-eating-contest', :title => 'I won!') p2.body = 'This weekend I won a hotdog eating contest!' p2.image = some_binary_data p2.blobs['hotdogs.jpg'] = some_binary_data p2.blobs['the-aftermath.jpg'] = some_binary_data @@ -94,10 +106,11 @@ end c1 = Comment.create!(:id => '2010-01-03-328', :text => '...') c2 = Comment.create!(:id => '2010-05-29-742', :text => '...') + An example of a project that uses GitModel is [Balisong](https://github.com/pauldowman/balisong), a blogging app for coders (but it doesn't save objects to the data store. It's read-only so far, assuming that posts will be edited with a text editor). Database file structure ----------------------- @@ -114,44 +127,66 @@ For example, the database for the example above would have a directory structure that looks like this: * db-root - * comments - * 2010-01-03-328 - * _attributes.json_ - * 2010-05-29-742 - * _attributes.json_ - * posts - * hotdog-eating-contest - * _attributes.json_ - * _hotdogs.jpg_ - * _image_ - * _the-aftermath.jpg_ - * lessons-learned - * _attributes.json_ - * _image_ - * running-with-scissors - * _attributes.json_ + * comments + * 2010-01-03-328 + * _attributes.json_ + * 2010-05-29-742 + * _attributes.json_ + * posts + * hotdog-eating-contest + * _attributes.json_ + * _hotdogs.jpg_ + * _image_ + * _the-aftermath.jpg_ + * lessons-learned + * _attributes.json_ + * _image_ + * running-with-scissors + * _attributes.json_ -Contributors + +Contributing ------------ -* [Paul Dowman](http://pauldowman.com/about) ([@pauldowman](http://twitter.com/pauldowman)) +Do you have an improvement to make? Please submit a pull request on GitHub or a +patch, including a test written with RSpec. To run all tests simply run +`autospec`. +The main author is [Paul Dowman](http://pauldowman.com/about) ([@pauldowman](http://twitter.com/pauldowman)). -To Do +Thanks to everyone who has contributed so far: + +* [Alex Bartlow](https://github.com/alexbartlow) + + +To do ----- +* Finish Query support + * Update index (efficiently) when Persistable objects are saved + * Add Rake task to generate index + * Update README * Add validations and other feature examples to sample code in README -* Querying - * Use AREL? * Finish some pending specs -* Associations * API documentation * Rails integration - * rake tasks - * generators + * Generators + * Rake tasks * Performance - * Haven't optimized for performance yet. + * Haven't optimized for performance yet. + * Use [Rugged](https://github.com/libgit2/rugged) instead of Grit + * Remove the transaction lock (see transaction.rb line 19) + * Ability to iterate over result set without eager loading of all instances +* Persistable.find/find_all/etc could be based on staged files so that queries reflect uncommitted changes +* Better query support + * Associations + * Use AREL? + +Bugs +------------ + +* Grit 2.4.1 has [an issue with non-ASCII characters](https://github.com/mojombo/grit/commit/696761d8047ffd038dc2828e6a1998e3f7c3b419)