Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Heresy is a schema free wrapper around your database, heavily inspired by both CouchDB and FriendFeed.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .document
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION.yml
Octocat-spinner-32 heresy.gemspec
README.rdoc

heresy

Heresy is a schema free wrapper around your database, heavily inspired by both CouchDB and FriendFeed[1]. You create Heresy models that work with generic schema-less tables.

class Entry < Heresy::Model
  fields do |f|
    f.string :title
  end
end

Entry.schema.create # create the table in the database

This class will use a table that looks like this:

create_table :entries do |t|
  t.primary_key :id,         :int
  t.column      :uuid,       :binary
  t.column      :updated_at, :timestamp
  t.column      :body,       :blob
end

Now you can create and retrieve models:

@entry = Entry.new :title => 'testing'
@entry.save

@entry = Entry.find('some_entry_uuid')
@entry.body = "updated"
@entry.save

UUIDs are automatically generated and used as the main ID for each record.

1: bret.appspot.com/entry/how-friendfeed-uses-mysql

TODO

- Indexes
- Associations
- Timezone conversions

NOT TODO

- Validations
- Callbacks

Use Validateable, ActiveSupport::Callbacks, ActiveModel, etc

Copyright

Copyright © 2009 kabuki. See LICENSE for details.

Something went wrong with that request. Please try again.