Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (15 sloc) 524 Bytes
#!/usr/bin/env ruby
require 'datomic/client'
require 'edn'
require 'pry'
require './common'
datomic = Datomic::Client.new 'http://localhost:9000', 'example'
dbname = 'customers'
Q_CUSTOMERS = '[:find ?c :in $data :where [$data ?c :customer/name _]]'
puts "Getting customers as of #{DateTime.now}"
puts
query_response = datomic.query(Q_CUSTOMERS, 'customers')
puts "Query response: #{query_response.data}"
puts
entities = query_response.data.flatten.map {|id| datomic.entity(dbname, id).data}
print_entities(entities)