Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 23 lines (15 sloc) 0.513 kB
d2bb703 @honkfestival Ready for presentation
authored
1 #!/usr/bin/env ruby
2
3 require 'datomic/client'
4 require 'edn'
5 require 'pry'
6
7 require './common'
8
9 datomic = Datomic::Client.new 'http://localhost:9000', 'example'
10 dbname = 'customers'
11
12 Q_EMAILS = '[:find ?c :in $data :where [$data ?c :customer/email _]]'
13
14 puts "Sending emails at #{DateTime.now}"
15 puts
16
17 query_response = datomic.query(Q_EMAILS, 'customers')
18 puts "Query response: #{query_response.data}"
19 puts
20
21 entities = query_response.data.flatten.map {|id| datomic.entity(dbname, id).data}
22 print_entities(entities)
Something went wrong with that request. Please try again.