Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

23 lines (15 sloc) 0.513 kB
#!/usr/bin/env ruby
require 'datomic/client'
require 'edn'
require 'pry'
require './common'
datomic = Datomic::Client.new 'http://localhost:9000', 'example'
dbname = 'customers'
Q_EMAILS = '[:find ?c :in $data :where [$data ?c :customer/email _]]'
puts "Sending emails at #{DateTime.now}"
puts
query_response = datomic.query(Q_EMAILS, 'customers')
puts "Query response: #{query_response.data}"
puts
entities = query_response.data.flatten.map {|id| datomic.entity(dbname, id).data}
print_entities(entities)
Jump to Line
Something went wrong with that request. Please try again.