Fork me on GitHub
#datomic
<
2018-11-20
>
benoit02:11:49

@joshmiller not-join should work

(d/q '[:find ?group
       :where
       [?group :group/id]
       (not-join [?group]
                 [?group :user-group/users ?u]
                 [?u :user/activated false])])
You need a clause outside of the not-join to bind the ?group to something that is a group (here I guessed :group/id). Otherwise you will get all entities that don't have users that are not activated ... which is probably a lot 🙂

joshmiller03:11:46

@me1740 Ah, awesome, that did it. I was missing the binding of users to groups inside the not-join. Thanks!

MM06:11:55

Hello everyone, I have a question regarding datomic transactor in AWS

MM06:11:15

I am deploying it via cloudformation, following this guide: https://docs.datomic.com/on-prem/aws.html

MM06:11:33

but I cannot find an official way to inject my classpath functions jar file

MM06:11:41

any idea on how to do this?

steveb8n06:11:08

@mmuallem with on-prem the idiomatic way to include custom fns is to install them as db or transactor fns. it is possible to add your jar to the classpath for the datomic peer or transactor but that’s up to your devops. Cloud has a much nicer story i.e. it reads your deps.edn and deploys that classpath to all the nodes. In other words it handles the devops for you. So you should use this as one way to pick between on-prem vs cloud

MM06:11:47

hey @steveb8n, thanks for getting back to me. Unfortunately, the decision of going with on-prem vs. cloud has been made in favor of our own deployment. I am picking up the OPs from the old person, and I am new to this. Currently, we are using a modified cloudformation template and start scripts to inject the jar file directly into our bin folder. It works, but it requires a recreating of the CF stack to pick up the new jar file. I need to a find a way that's more scalable. Can you please shed a bit more light on this: it is possible to add your jar to the classpath for the datomic peer or transactor but that’s up to your devops. Many thanks!

steveb8n06:11:05

Sadly I can’t. I have not deployed on-prem using CF so I’m shallow on knowledge there. I read somewhere that it was possible to augment the JVM classpath for on-prem but have not done it myself. Maybe someone else here (when they wake up) has more experience with this?

MM06:11:43

Thanks man, appreciated

steveb8n07:11:33

just in case: do you need a jar or could your custom fns be installed instead? using 3rd party libs I presume? if not, you can avoid all this

yogidevbear12:11:33

Hi everyone 👋 I hope this doesn't sound like a silly question, but... Is there a way to construct a value out of two other columns within a datalog query? Similar to how you would achieve the following in T-SQL:

SELECT t1.foo + '_' + t1.bar AS foobar
FROM t1

manutter5113:11:18

Something like this seems to work:

(d/q '[:find ?e ?str
       :where
       [?e :company/name ?name]
       [?e :company/group ?gname]
       [(str ?name ", " ?gname) ?str]]
     (db))

yogidevbear13:11:16

Thanks @U06CM8C3V I'll give this a try

yogidevbear13:11:44

I think that will do the trick. Thanks again @U06CM8C3V 🙂

👍 4
henrik13:11:25

@yogidevbear I can’t recommend http://www.learndatalogtoday.org/ enough to learn the basics of Datalog.

yogidevbear13:11:58

Always good to find recommended learning resources other than official docs 🙂 Sometimes helps to fill in gaps of knowledge

yogidevbear13:11:46

@U06B8J0AJ another post someone shared with me that was very easy to digest was http://gigasquidsoftware.com/blog/2015/08/15/conversations-with-datomic/

👍 4
stijn13:11:31

is there a way to get the datoms transacted between 2 't' values (in the client api (cloud))?

val_waeselynck13:11:59

@U0539NJF7 the Log API? (https://docs.datomic.com/cloud/time/log.html) Be careful, it's start-inclusive and end-exclusive, whereas the inverse is what you would usually need.

stijn13:11:32

@U06GS6P1N ok. I don't even know why I was asking this. Confusion about the 'live' transaction log not being available in cloud I guess 🙂

stijn13:11:39

thanks

👌 4
eraserhd15:11:34

Have I asked this before? We sometimes have a peer lose connection to the transactor, and since it mostly operates correctly as a read-only clone, we don't discover this for a while. Is there something we can do to check if we are still connected that doesn't transacting?

val_waeselynck16:11:35

Maybe use d/sync, or submit a transaction that throws an exception via a function

eraserhd17:11:06

Oh, I like the second one. Thanks!

eraserhd15:11:46

For purposes of system monitoring.

ro616:11:41

Is the idea with datomic.ion.cast that dev events should show up in CloudWatch automatically? I may be searching incorrectly, but it seems like mine aren't making it.

benoit17:11:33

@robert.mather.rmm I think dev events are just on your local machine.

Dev is information of interest only to developers, e.g. fine-grained logging to troubleshoot a problem during development. Dev data can be much higher volume than events or alerts.

ro618:11:59

Got it, thanks!

kenny22:11:37

I get a couple reflection warnings when creating a Datomic client:

Reflection warning, cognitect/hmac_authn.clj:80:12 - call to static method encodeHex on org.apache.commons.codec.binary.Hex can't be resolved (argument types: unknown, java.lang.Boolean).
Reflection warning, cognitect/hmac_authn.clj:80:3 - call to java.lang.String ctor can't be resolved.