Fork me on GitHub
#datomic
<
2015-08-17
>
joshg02:08:46

Could anyone recommend some examples of how to handle user authorization with Datomic?

meow03:08:41

@joshg: I'm not currently using datomic but I think this question has come up before so you might want to check the archives if you haven't already: http://clojurians-log.mantike.pro/datomic/

joshg03:08:54

@meow: Thanks. The best resource I’ve found thus-far has been: https://www.youtube.com/watch?v=7lm3K8zVOdY

val_waeselynck11:08:51

@joshg: if you're planning to give your clients arbitrary query power (even on a subset of your db using filter) keep in mind that they still can build queries that will consume all of your resources. So I don't recommend that in the general case.

val_waeselynck11:08:17

I personally used the old way: parameterize all my endpoints with some access restriction configuration, using Ring middlewares to query the db for the right authorization. I have found that recursive rules can be a very powerful tool for this.

genRaiy15:08:49

hi guys, this question was kind of answered before but I didn’t have the database in front of me like I do now so I couldn’t quite get the spoon feeding that I need 😊

genRaiy15:08:35

assume I have added some data and have added this to the record...

genRaiy15:08:35

this all works and I can get back the data for that tx

genRaiy15:08:05

but I cannot work out how to ask datomic… give me the entity that changed as a result of that tx

genRaiy15:08:08

I’m still breaking my head with this stuff so anything on a spoon would be happily received!

robert-stuttaford15:08:15

raymcdermott: you have a txid and you want a list of entities it touched?

robert-stuttaford15:08:42

(d/q '[:find ?e :where ?t [?e _ _ ?t]] db tx-id)

robert-stuttaford15:08:29

the transact function returns a bunch of data. included are all the new datoms, as well as a map of temp -> storage ids

bostonaholic15:08:35

@raymcdermott: I usually return the tempid then d/entity on it

robert-stuttaford15:08:41

you should find everything you need in there

genRaiy17:08:46

super - thanks robert (I was AFK for a while)

sdegutis18:08:34

What major changes would someone upgrading from Datomic Free 0.8.4218 to Datomic Free 0.9.5206 encounter?

sdegutis18:08:57

Only one I've found so far is "Alter Schema" in 0.9.4470, which says "This feature breaks compatibility with older versions. Once a schema alteration has been performed on a database, only connect peers and transactors running at least [this version] to that database." but I don't quite know how to interpret that.

bostonaholic18:08:04

@sdegutis: re: alter schema: it's just saying that once you use the alter schema feature of >=0.9.4470, there is no going back to an earler version of datomic

bostonaholic18:08:04

and I would suggest going through the changelog to get the best answer

sdegutis18:08:48

That's all the changelog says.

sdegutis18:08:08

@bostonaholic: That's all it says. I've been going through the 500 lines in the full changelog between our current version and the latest.

sdegutis18:08:12

So I think you're right.

sdegutis19:08:49

Successfully upgraded from 0.8.4218 to 0.9.5206 with no visible issues so far. It was pleasantly smooth. Just FYI.

clojuregeek22:08:56

my secret plan to start moving to datomic by using the ruby gem was deflated today, Yoko said the gem is behind and I’m better off using clojure