The Crate adapter for ActiveRecord.
I've just started coding the adapter and lots of functionality might still not work. Give it a try and help bei either contributing (fix it) or add a ne issue.
Add this line to your application's Gemfile:
gem 'activerecord-crate-adapter', :git => "https://github.com/crate/activerecord-crate-adapter.git"
And then execute:
$ bundle
Or install it yourself as:
$ gem install activerecord-crate-adapter
When using Rails update your database.yml
default: &default
adapter: crate
host: 127.0.0.1
port: 4200
Crate doesn't come with an autoincrement feature for your model ids. So you need to set it yourself. One way is to use SecureRandom.uuid, if you think there is a better one, please add an issue so we can discuss.
class Post < ActiveRecord::Base
before_validation :set_id
private
def set_id
self.id = SecureRandom.uuid
end
end
Currently adding and dropping indices is not support by Crate. Issue #733
# not supported by Crate yet
add_index :posts, :comment_count
remove_index :posts, :comment_count
Array and Object column types are currently not supported in migrations.
Crate is eventually consistent, that means if you create a record and query for it right away it won't work (except queries for the primary key!). Read more about it here
Crate does not support Joins (yet) so joins won't work.
First run the test instance of crate
$ ./spec/test_server.rb
then run the tests
$ rspec spec
This adapter is a work in progress. If you think something is missing, either follow the steps below or log a new issue, so someone else can tackle it.
- Fork it (
http://github.com/crate/activerecord-crate-adapter/fork
) - Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Add tests
- Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
##Maintainer
##License MIT License. Copyright 2014 Christoph Klocker. http://vedanova.com