Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (31 sloc) 0.827 kb
#!/usr/bin/env ruby
require 'datomic/client'
require 'edn'
require 'pry'
require './common'
def generate_temp_id(*stuff)
EDN.tagged_element('db/id', stuff)
end
DATA = [
{
:"db/id" => generate_temp_id(:"db.part/user", -1),
:"customer/name" => "Aaron Olson",
:"customer/email" => "aaron.olson@shopify.com"
},
{
:"db/id" => generate_temp_id(:"db.part/user", -2),
:"customer/name" => "Steven Noble",
:"customer/email" => "steven.noble@shopify.com"
},
{
:"db/id" => generate_temp_id(:"db.part/user", -3),
:"customer/name" => "Willem van Bergen",
:"customer/email" => "willem@shopify"
}
]
datomic = Datomic::Client.new 'http://localhost:9000', 'example'
dbname = 'customers'
t2 = datomic.transact(dbname, DATA)
puts "Added data with transaction:"
puts
print_entities(t2.data)
Jump to Line
Something went wrong with that request. Please try again.