operations can be run in-memory • Can be extended to support any kind of a datastore • Can be used with multiple different databases • Designed to support per database optimizations Veritas Sunday, March 11, 12
member['avatar_url'] ] end commits_tuple = commits_json.map do |commit| [ commit['committer']['login'], commit['commit']['tree']['sha'], commit['commit']['message'], commit['committer']['date'] ] end Sunday, March 11, 12
'commits', commit_header, commits_tuple) members_relation.each do |member| puts member[:login] end commits_relation.each do |commit| puts commit[:sha] end Sunday, March 11, 12
"country" FROM "users" # WHERE ("country" = 'US' OR "country" = 'UK') # # *Then in memory* # # join with the members from github on username/login # new_relation.each do |user| puts "#{user[:id]} #{user[:username]} #{user[:country]}" end # 1 dkubb CA Sunday, March 11, 12
def initialize(attributes) @id, @name = attributes.values_at(:id, :name) end class Mapper < DataMapper::VeritasMapper map :id, :type => Integer map :name, :to => :username, :type => String model User name 'users' end end User::Mapper.find(:name => 'John') Sunday, March 11, 12
book = Book.new(:title => 'Some Book', :author => 'Jane Doe') library.books << book DataMapper::Session.create do |session| session.insert(library) session.commit end Sunday, March 11, 12