datomic

Ask questions on the official Q&A site at https://ask.datomic.com!
babardo 2021-06-23T09:08:36.297400Z

👋 Using datomic cloud, I set an identity on a tuple composed of 2 attributes:

[:resource/a+b :tuple   :one :unique :identity :attrs [:resource/a :resource/b]]
And I wonder if it's possible to activate the identity only if both of the attributes are present in the entity. (and not only one of them like it seems to be)

favila 2021-06-23T12:19:15.300Z

It is not possible. A composite tuple is asserted if any component attr is asserted and there’s no way to only assert the composite if all of them are asserted.

favila 2021-06-23T12:20:01.300800Z

(That would be a really nice feature btw.)

Fabim 2021-06-23T13:03:03.301Z

@lanejo01 The deploy worked. Thanks for the tip. Reseting jetty in m2 solved it.

Joe Lane 2021-06-23T13:12:03.301800Z

Great to hear! Always happy to chat

babardo 2021-06-23T13:12:28.302Z

Ok no 🪄 so! Thanks for the answer 🙏

Fabim 2021-06-23T13:13:28.302200Z

@lanejo01 I deployed and got a `.datomic-ions/`  folder. Can that folder be put into `.gitignore` , or does it need to be pushed with git?

Joe Lane 2021-06-23T13:23:43.302400Z

It can be ignored.

Fabim 2021-06-23T13:37:17.302600Z

@lanejo01 Thanks. When deploying I got a lot of dependency-conflicts. Is there a way to update the depencencies running in my datomic cloud or do I need to explicit use the old dependency versions in my deps.edn to get rid of that warning?

Joe Lane 2021-06-23T13:37:37.302800Z

The latter.

Joe Lane 2021-06-23T13:38:14.303Z

If you hit a conflict that you can't work around, contact support.

Fabim 2021-06-23T14:07:55.303700Z

@lanejo01 I am responding to a GET request on the API gateway mapped on a lambda with ring.util.response/resource-response to deliver the index.html but the css and js are blocked by the browser with Content Security Policy: The page's settings blocked the loading of a resource Is there a way to deliver a website with (pedestal)ion without errors?

Fabim 2021-06-23T19:11:11.307800Z

Is there a way to expose resources in subfolder of `public` so the browser can fetch them when getting the `index.html`  in a pedestal ion service? I set :allowed-origins which enables to load js and css in the public folder. The images, js and css in public/[subfolder]/ produce 403. I’m using an APIGW connected to a lambda that calls the ring routing as described in https://github.com/pedestal/pedestal-ions-sample

Fabim 2021-06-23T19:13:16.308Z

I allowed some origins, as the forum suggested. Now I’m stuck with subfolders not being loaded. Happy to hear how you solved that https://clojurians.slack.com/archives/C03RZMDSH/p1624475471307800

Joe Lane 2021-06-23T20:03:46.308600Z

Are you running a local jetty server for development?

Fabim 2021-06-23T20:07:31.308800Z

yes

Joe Lane 2021-06-23T20:08:21.309Z

And presumably the subfolders work with the same service-map?

Fabim 2021-06-23T20:08:24.309200Z

during development I use integrant

Fabim 2021-06-23T20:08:59.309500Z

the service map is different in development

Joe Lane 2021-06-23T20:09:19.309700Z

Can you diff them?

Fabim 2021-06-23T20:11:39.309900Z

this is the difference

(-> service
(dissoc ::http/chain-provider)
        (assoc  
          ::http/join? false
          ::http/routes #(route/expand-routes (deref #'routes))
          ::http/secure-headers {:content-security-policy-settings
                                 {:default-src "'self'"
                                  :style-src "'self' 'unsafe-inline'"
                                  :script-src "'self' 'unsafe-inline'"}})
        (http/default-interceptors)
        (http/dev-interceptors)
        (http/create-server))

Fabim 2021-06-23T20:15:42.310400Z

should be the setup they do in peodestal-ions-sample