Fork me on GitHub
#datomic
<
2019-06-03
>
marshall14:06:56

@joshkh yes, you deploy to a group which can be a query group or a primary compute group

joshkh14:06:34

gotcha. so if we want different deployment stages for an ions related project we'd create two query groups with the same existing system name (storage) stack and different application names such as myapp-dev and myapp-prod?

marshall14:06:39

yes, you could do that

marshall14:06:46

and/or you could leave the application name the same

marshall14:06:51

and deploy separately to them

marshall14:06:00

the group will be the stack name of the query group stack

joshkh14:06:02

okay, so then here's the part that's confusing me: what does :app-name represent in my project?

marshall14:06:26

app-name defines the codedeploy target group

marshall14:06:29

for the ion deployment

marshall14:06:56

so having the same app-name in multiple query groups and/or primary compute groups allows you to deploy the same ion project to any/all of them

marshall14:06:10

i.e. if you wanted to have one QG that got testing/beta builds of your app

marshall14:06:35

you’d deploy the same ion project to it, but different versions (shas)

marshall14:06:14

that way when you’re ready to promote a build/version to production you dont have to change your code at all

marshall14:06:18

in fact, you wouldnt even need to re-push

marshall14:06:33

you can just deploy it to additional/other QGs

marshall14:06:29

whereas if you use different application names, you’d need to change the app name in the config and re-push to be able to ship it to your other group(s)

joshkh14:06:54

okay, so let's say for my myapp project i've created two query groups, one for dev and one for prod, and i've given them the same Application Name aka code deploy target. how do i choose to deploy to only one of them if they have the same group name?

joshkh14:06:08

> whereas if you use different application names, you’d need to change the app name in the config and re-push to be able to ship it to your other group(s) that's exactly what i'm trying to avoid 🙂

marshall14:06:32

when you push you’ll see a list of possible groups to deploy to

marshall14:06:46

in the return message from push

joshkh14:06:04

ah. this is what i get for automating my deployments 😉

joshkh14:06:10

thanks a lot marshall. i'll have a look.

marshall14:06:20

and, in particular, that group name is the name of the stack

marshall14:06:26

so if you have my-qg1 and my-qg2

marshall14:06:39

when you deploy you replace $group in the command with whichever one you want to deploy it to

joshkh14:06:11

great, thanks for your help.

joshkh20:06:53

finally got around to testing and it worked like a charm. thanks again @U05120CBV

eoliphant16:06:23

Hi quick question, had to do some work on an older on-prem project, and forgot to add :db/index true to some new attrs, I’ve since fixed it, but was just curious about the behavior for datoms that were already transacted. do they get indexed in the background or something?

jaret18:06:59

Yes turning db/index true on will add them to the next indexing job. Turning it on can be expensive if there is a lot of data. If you can, I always recommend testing in an environment before rolling out to production. Also.. worth checking to see if an indexing job has completed since you made the change as that would indicate they’ve already been added to the index.

daniel.spaniel20:06:23

Let's say I have a datomic db instance that I have by doing (let [db (d/db conn)] is there a way to go back and get the conn from the db i just made .... (let [conn (?some-method-to-extract-conn? db)])

alexmiller20:06:13

remember that db instances are values, connections are stateful

daniel.spaniel20:06:31

oh well .. got it ..

daniel.spaniel20:06:11

kind of goofy thing to do you might think, but if you say why i wanted to do it you might thing .. oh ok .. not so goofy

esp122:06:16

how would i query for all of the datoms in a given transaction (equivalent to drilling in to the Transactions tab in the Datomic Console)? if i try this:

(d/q '[:find ?e ?a ?v ?t
       :in $ ?t
       :where
       [?e ?a ?v ?t]]
     (d/db conn)
     13194139536455)
i get an error:
Execution error (Exceptions$IllegalArgumentExceptionInfo) at datomic.error/arg (error.clj:57).
:db.error/insufficient-binding Insufficient binding of db clause: [?e ?a ?v ?t] would cause full scan

ghadi22:06:41

@esp1 one way is (first (d/tx-range conn {:start tx :end (inc tx)}))

esp122:06:13

cool, thanks!

ghadi22:06:27

I'm not sure how/whether it can be done in a query

esp123:06:43

oh this is perfect - thanks!