Fork me on GitHub

so I have been testing my queries by passing in sample datoms as vectors of vectors. Now I want to use pull syntax in the query and i'm getting the error: clojure.lang.PersistentVector cannot be cast to datomic.Database. what's going on here? how can I do this?


You need an actual database


Consider using the mem (in memory) database


Thanks for clarifying. Yeah i just separated the main query from the pulling part. I wasn't sure the best approach to this separation. I need to keep the association between the attributes from the pull and the attributes from the main query so I'm doing a pull for each entity. Works fine on the small dataset I just tested it with but i'm not sure how the pull-per-entity strategy will perform with more data. Any ideas?


hi there! for some reason I can't open


@fmnoise Are you looking for the Day of Datomic videos?


They’ve moved to the docs ^


also, can you tell me where you found that link ?


thanks, that works!


I had the link in bookmarks


@marshall / @stuarthalloway could you clarify that the claims in the doc string for datomic.api/tx-range should hold pls? I've found that only using t values work for me (and not transaction ids) - thanks!


@mgrbyte in the peer API?


ok i’ll have a look


thanks :thumbsup:


on latest version of datomic-pro, memory db for context


I'm using tx->t atm, so not an issue, just wanted to know if the doc string was telling me the truth/if I'd found a bug


Who has experience migrating from Datomic on-prem to cloud (AWS)? Anyone? Anyone?...


@mgrbyte ^ seems to work


hmm. not sure what's going on then. I have code which works with (d/tx-range (d/log conn) (d/tx->t tx) nil) but not with (d/tx-range (d/log conn) tx nil)


also, in your example it could be that equality assertion is comparing true for two empty seqs?


it will work in that case, but i also checked that they contained something


user=> (let [t-val 1
      tx-id (d/t->tx t-val) 
      using-tx (seq (d/tx-range (d/log conn) tx-id nil)) 
      using-t (seq (d/tx-range (d/log conn) t-val nil))
      _ (println (count using-tx))]
  (= using-tx using-t))


thanks for looking. when I have time, I'll see if I can extract out the code I have that's failing into a gist/repo


I have a simple sample project up and running on AWS Elastic Beanstalk and would like to access Datomic Cloud. I’m relatively new to AWS — how straight-forward will it be to give my server access? Any pointers into sample configurations for beanstalk and/or docs before I dive in this afternoon? Being new to AWS - how realistic is it for me to ramp up and get connected today? AWS docs are pretty dense! I liked how straight-foward it was to get datomic cloud up an running locally - would be great to have a similar guide for a sample app running in elastic beanstalk (where you can just upload Procfile/uberjar to get going). Will cross post to #aws.


@donmullen if by “my server” you mean your EB app, you should have a look at


to set up VPC peering between the VPC where your EB app is running and the Datomic Cloud VPC


Yes - my elastic beanstalk app. So VPC peering is the way to go - I’m assuming there isn’t a way to tell EB to use the Datomic Cloud Application VPC. Thanks @marshall.


@donmullen I think you could do that, but the Datomic Cloud VPC may not have the settings you desire for your app (i.e. public IPs / NAT gateway /etc)


for just trying it out, that may be the quickest path, though


@marshall - I think I have first two of three steps completed to do the peering. Stepping through Associating a VPC with a Privated Hosted Zone now.


@marshall - The only thing I think I may have gotten wrong is setting the routing table information. There was already a entry with target igw-f8675881 for the EB and Datomic routes - where evidently igw is the internet gateway. I replaced the `' with the IP of the other VPC peer IP. I’m thinking now that I should leave the 0's - and add an entry (as the server is no longer coming up). Trying that now. Thoughts?


OK - so going back to seems to have resolved the EB app problem. I added an entry to the routing for each - selecting the vpc-peer-connection as the target. Is that correct? In testing a call to datomic.client.api/client - I’m now getting Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/jetty/util/thread/NonBlockingThread. Switching back to local to make sure that works still. Any thoughts on this error from client call, @marshall?


you are getting that error or you’re not ?


the NoClassDefFoundError usually points to a deps conflict and/or a missing dep


@marshall - yes - getting that error (not -> now). Indeed thinking it’s a dep conflict of some sort. I seem to recall something about a jetty exclusion? Trying [com.datomic/client-cloud "0.8.50" :exclusions [org.eclipse.jetty/jetty-io]] now.


OK - progress. deps resolved - now back to getting vpc peer connection correct. Now I’m getting

Exception in thread "main" clojure.lang.ExceptionInfo: Unable to connect to system: {:cognitect.anomalies/category :cognitect.anomalies/unavailable, :cognitect.anomalies/message "Connection refused"} {:config {:server-type :cloud, :region "us-east-1", :system "nycdvp", :query-group "nycdvp", :endpoint "", :proxy-port 8182, :endpoint-map {:headers {"host" ""}, :scheme "http", :server-name "", :server-port 8182}}} 
which implies that I don’t have the vpc peers set up correctly.


i would take out proxy-port from the config map


you’re not using a proxy anymore


And you’re using a security group with the correct permissions?


in particular, one that has ingress allowed in the Datomic entry group


Removing the proxy-port - now getting Connect Timeout instead of Connection refused :

Exception in thread "main" clojure.lang.ExceptionInfo: Unable to connect to system: {:cognitect.anomalies/category :cognitect.anomalies/unavailable, :cognitect.anomalies/message "Connect Timeout"} {:config {:server-type :cloud, :region "us-east-1", :system "nycdvp", :query-group "nycdvp", :endpoint "", :endpoint-map {:headers {"host" ""}, :scheme "http", :server-name "", :server-port 8182}}}


@donmullen Does your datomic entry security group allow ingress on port 8182 from your eb security group?


And does your datomic route table have an entry to route back to the eb route table?


@redinger - see routing above - I did add entries both ways.


Yep, that’s the right place


But it doesn’t accept sg-66193f12 - which the EB default security group….


@redinger - at least for Custom TCP rule - what should Type and Protocol be?


The peering is to vpc-90b1b3e8. You should use the security group for that vpc - sg-c212b2b4


Type is Custom TCP Rule, Protocol is TCP


@redinger - ok - so that sg-c212b2b4 also wasn’t in the drop-down list - but I put it in anyway and trying that. Any idea why that value not in the list of selectable items?


@donmullen Hmm, not sure. Maybe their auto suggest doesn’t work across VPCs.


Could be — progress though!


Exception in thread "main" clojure.lang.ExceptionInfo: Forbidden to read keyfile at . Make sure that your endpoint is correct, and that your ambient AWS credentials allow you to GetObject on the keyfile. {:cognitect.anomalies/category :cognitect.anomalies/forbidden, :cognitect.anomalies/message "Forbidden to read keyfile at . Make sure that your endpoint is correct, and that your ambient AWS credentials allow you to GetObject on the keyfile."}


So now the IAM policy for that EB needs to grant access to S3 for those keys


okay dokie - feel like I’m getting close… no? most of this aws stuff is new to me - realize that technically this isn’t datomic support - but guess it’s good to over issues that people new to aws have that need resolution in order to get connected to datomic cloud. help is much appreciated.


Yeah, I think once the IAM permissions are sorted, this should be working. This feedback is super useful, since we need to find the balance in our documentation about how to consume this stuff.


@marshall @redinger Success! Thanks much!

INFO [fulcro.easy-server:181] : Web server () started successfully. Config of http-kit options: {:port 5000}
18-03-07 21:16:01 ip-172-31-44-80 INFO [aws.server-main:23] - Testing Datomic
18-03-07 21:16:10 ip-172-31-44-80 INFO [aws.server-main:26] - created client
18-03-07 21:16:11 ip-172-31-44-80 INFO [aws.server-main:28] - created database
18-03-07 21:16:21 ip-172-31-44-80 INFO [aws.server-main:30] - connected to database
18-03-07 21:16:22 ip-172-31-44-80 INFO [aws.server-main:32] - deleted database

Oliver George23:03:47

Hello. I'm interested in seeing how people prepare datomic queries. Specifically, adding more constraints depending on, say, api query params. Google and I ended up with what feels like an elegant hack at best:

Oliver George23:03:56

Perhaps there are other approaches I'm not seeing.