This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-12-20
Channels
- # admin-announcements (1)
- # bangalore-clj (4)
- # beginners (176)
- # boot (38)
- # cider (9)
- # clara (1)
- # clojars (9)
- # clojure (290)
- # clojure-belgium (25)
- # clojure-berlin (2)
- # clojure-dusseldorf (10)
- # clojure-italy (1)
- # clojure-russia (141)
- # clojure-sg (1)
- # clojure-spec (40)
- # clojure-uk (38)
- # clojurebridge (19)
- # clojurescript (148)
- # code-reviews (37)
- # community-development (7)
- # cursive (27)
- # datomic (71)
- # editors-rus (3)
- # events (1)
- # heroku (1)
- # hoplon (16)
- # jobs (5)
- # lambdaisland (3)
- # lein-figwheel (211)
- # luminus (3)
- # off-topic (52)
- # om (18)
- # onyx (49)
- # overtone (3)
- # pedestal (48)
- # protorepl (7)
- # rdf (2)
- # re-frame (61)
- # reagent (3)
- # timbre (2)
- # untangled (69)
Db name is the "alias" you provide to the peer server when you start it against your ddb uri
@kenny ^ running peer server documented there. Info on connecting a client to it is lower on the page
Ah, that makes sense. The exact steps you need to follow to use the client API aren't clear in the docs 🙂 Thanks for the info
Sure. Let me know if you have suggestions as to how/where that could be specified better
I think the confusion for me was actually needing to go through the "Getting Started" docs. I assumed that I didn't need to read "Getting Started" because we have been using Datomic for a while now and I know all the basics. Maybe it should be called "Getting Started with Clients"?
Ah, yeah I think the new getting started does cover how to run and connect with peer server
Im trying to setup datomic on postgres in heroku. Im on this step: > open a SQL window on that server and paste in the bin/sql/postgres-table script From http://docs.datomic.com/storage.html I’m not sure what a SQL window is referring to. Googling “SQL window” doesn’t get me close to what i imagine. I imagine somewhere there is a script to setup the tables the way datomic wants them, and i need to run that in this SQL window. But i dont know where either is.
this postgres file is probably in my project directory somewhere...
looks like i probably need to download datomic to get it 🙂
hazaa
similar issue on this step:
> If you are using a Heroku hosted PostgreSQL instance, edit your sql-transactor-template.properties as follows:
Which is simply that i dont see a ‘sql-transactor-template.properties’ file anywhere. I see a config/samples/free-transactor-template.properties
which i could copy and change the file name. But im not sure thats right, especially as the next step suggest there should be a sql-url variable in the file (which there isn’t). I could write it down, but that feels odd.
@drewverlee the free transactor is only for in-memory, you'll have to set up a starter license if you want to use postgres for your storage layer
@gdeer81 Thanks again.
Hmm ok, so i’m a tad stuck. I want to deploy a full stack clojure app to heroku using datomic ontop of postgres. I assume i should include my datomic-pro dep in my project file:
[com.datomic/datomic-pro "0.9.5544" :exclusions [com.google.guava/guava org.slf4j/log4j-over-slf4j org.slf4j/slf4j-nop]]
Which seems to work as lein uberjar
reports success. But then as i would expect it fails when i try to deploy to heroku it fails. I assume because it cant verify my license?
This walkthrough (https://github.com/jamesmartin/datomic-tutorial) seems to suggest i should add:
:repositories {"" {:url ""
:creds :gpg}}
to my project.clj. But i dont see any offical docs on the subject.Maybe a better question would be, whats the simplest way to get something deployed 🙂
@drewverlee what specifically fails when you try to deploy? launching the transactor is what will require a valid license; I’m not sure whether details have changed, but I believe there used to be some hoops to jump through to get a transactor running using heroku
do you have a transactor up and running? or are you attempting to deploy both a peer and a transactor?
@marshall Thanks for the help.
the failure message when i run git push heroku
is:
remote: Could not find artifact com.datomic:datomic-pro:jar:0.9.5544 in central ( )
remote: Could not find artifact com.datomic:datomic-pro:jar:0.9.5544 in clojars ( )
remote: This could be due to a typo in :dependencies or network issues.
remote: If you are behind a proxy, try setting the 'http_proxy' environment variable.
remote: Uberjar aborting because jar failed: Could not resolve dependencies
remote: ! Failed to build.
> do you have a transactor up and running?
Not yet. Im not sure what the order should be, this is what im currently doing:
build clojure project e.g lein new luminus vending_machine_app +re-frame +datomic
edit my project.clj to use datomic pro
(x) deploy to heroku
follow setup datomic database instructions (which involves setting up the transactor)gotcha. So that error does indicate your app is unable to get the datomic peer library from the private maven repo
you’ll need to configure that via the directions provided in your http://my.datomic.com dashboard
@marshall Its probably important to know that im going headfirst at this, with very little background 🙂
however, You’ll also need a running transactor up for your peer to connect to before it can “do” anything
in general, the ‘startup’ order for a Datomic system would be: 1) provision/configure storage (i.e. Postgres or Dynamo) 2) start your transactor instance 3) start your app, which uses the Datomic peer library
@marshall ok, great. I see the instructions i missed on http://my.datomic.com.
more details on storage setup can be found here: http://docs.datomic.com/storage.html
the writeup on running Datomic in AWS (http://docs.datomic.com/aws.html) might also be helpful, although of course the AWS-specific parts won’t work for Heroku
@marshall of the two, paths (heroku vs AWS) which is the smoothest. I’m doing a barebones toy application just to get this stuff live
in general the AWS path is the fastest for getting the storage & transactor up and running
basically, follow the docs here: http://docs.datomic.com/storage.html#provisioning-dynamo
after that, just deploy your application that uses the Peer library to EC2 however you like
@drewverlee you can also use terraform; @mrmcc3 put together a codebase for transactor + peers, you can use the transactor bit https://github.com/mrmcc3/tf_aws_datomic
drewverlee: FWIW, if you are going with heroku, there are a few heroku datomic buildpacks that make setting up the transactor a little easier
is there a general way to implement composite attributes on top of datomic? by that I mean attributes which are unique when taken together. my current method is using a special key where the values are concatenated, e.g. :composite/team.id|user.id
but this adds a lot of extra complexity around upserting entities.
@wei I think there is a feature request for that, so go to your http://my.datomic.com profile and upvote it
@wei you’re talking about what SQL calls composite primary keys, and Datomic does not support them
you can do your own with transactor functions
here’s a snippet. we eventually caved in and had our tx fn make a string value out of the parts so that we had a simple ‘primary key'
if you think it through, such a feature would add quite some complexity to the system, which i don’t think would be worth it
… but i’m not Rich Hickey, so it’s very possible i’m ignorant in several key ways
thanks for sharing. yes, I was reading some previous literature around using tx fns for composite keys, and it looks like every solution so far has some major limitations (e.g. not being able to add multiple entities in the same tx). was wondering if I was missing something critical as well
the current system is based on a few solid rules. adding this would complicate things quite a bit i think
correct
we have a helper function too
think I’m not following completely. if you wanted to put a composite key on several entities, would you reuse this db function or create a separate function for each entity?
so this is a concrete implementation for one entity kind
a fully generic implementation would be so indirect and meta, it’d be useless (that’s an intuition)
that’s what I’m thinking too. but we have many composite keys in our system and it’s getting tedious to re-implement this for each
do your comp-keys follow any sort of a pattern? e.g. 2-3 strings
not an uncommon requirement in my opinion- for example, user ids in some external system are unique only within a group (team)
yes, it’s usually 2 strings. but sometimes one part of the composite string is based on an attribute from a joined entity, which complicates things so I’m debating whether that’s necessary
perhaps it may be useful to think about how you’d model this data in a new database, from first principles, rather than as an import from a different data modelling paradigm
true. currently we have things like :composite/team.slack-id|user.slack-id
(need a user’s slack id and a team’s slack id to uniquely identify a user) and :composite/team.uuid|tag.name
(need the team and tag name to uniquely identify a tag). I do think composite keys are necessary in these cases, but maybe splitting it along a different dimension would make things easier.
at any rate, thanks for the tips. if you wouldn’t mind posting your helper function, that would help me as well
hmm i think i found some kind of bug: when i have [com.datomic/clj-client “0.8.606”]
in dependency it spoils jetty ring. When in run lein repl
and then (use ‘ring.adapter.jetty)
i have an error CompilerException java.lang.NoClassDefFoundError: org/eclipse/jetty/http/HttpParser$ProxyHandler, compiling:(ring/adapter/jetty.clj:27:11)
- it makes this bug even on this simple example https://github.com/ring-clojure/ring/wiki/Getting-Started