Fork me on GitHub

So @ghadi, another approach would be just wrapping your ‘real’ ion code with a higher order function ‘authorizer’. That might give you what you need.. But just out of curiosity, how are you identifying the ‘principal’ to whom the temp token is issued? we have a pretty complex AWS setup, and avoid IAM users, etc. We issue tokens for say AWS API access, via integration with Keycloak and LDAP. You mentioned bless which is similar, in that you need to have a ‘session’ in order to get the cert issued.


i wanted to copy some entities between dbs, and came up with the hack of pulling them with [*] and applying this:

(defn tempify-entity [entity partition]
  (walk/prewalk (fn [node]
                  (if (and (instance? MapEntry node)
                           (= :db/id (key node)))
                    (MapEntry. :db/id (d/tempid partition (- 0 (val node))))
this worked and resolved all references, but the tempid docs say only to use ns from -1 to -1000000. can i cause some type of tempid collision in datomic land by doing this?


Datomic supports strings as tempids now, so you could just do (str (:db/id thing)) instead


@eoliphant I thought about this a bunch last night, I think the "right thing" to do is generate an STS session token before the invoke of a lambda, and pass the temp credentials+token through to the Ion, then AssumeRole inside the code


That sounds like a plan


the only downside is that session tokens are minimum 15 minutes in length


yeah, they are more geared to stuff like handing a user one for API access or something


Sorry if this is a silly question, but how should I pack my own Java static method with the Transactor, so that cassandra-cluster-callback works?


the Datomic Cloud documentation on functions & java methods suggests you can return variables created in queries from the :find clause, but it's not working for me: I have ?d , a :db/txInstant which I'm trying to return from :find [?i] using [(.toInstant ^java.util.Date ?d) ?i] but the query hangs & eventually returns a Datomic client exception


@octo221 what’s in your datomic Cloud logs


Hi, I've been running into transaction timeouts (the transactions do end up succeeding). I've been using transact and am reading i need to switch to transact-async. What would the benefit be of calling transact-async and then deref'ing it right away? Is it that I could boost the timeout time for these instances? If my transactor had a timeout of 5 seconds, and I deref'd the async tx with a 5 second limit, would the result be the same ?


I believe, however, i need to rethink my implementation, batch the transactions, return some kind of temp id and then query for them. That's the right way to deal with this ?


You can boost the timeout, or use smaller batches. Have you checked out the core.async/ pipelining approach in the best practices section? That might also fit your usecase


Yes, it's just unclear to me when making a record, how to return the record to the user when they make a new post.


When you’re building new schema in development mode, is there a way to retract schemas? Simple example is that I accidentally used bigint instead of long, but it seems like the only way to undo my mistake is to create a whole new database.


In the documentation it says, “breakage is at best a dev convenience” — i need that convenience. 😉

Joe Lane15:08:16

A Datomic Schema is just a series of attributes, which themselves, can be retracted. If its a dev mode schema just retract the attribute. Take a look a the day of datomic cloud source repo on github (dont have the link handy rn)


I’ll take a look at it. thanks.


Hmm. It seems like you can’t retract schema:

@(d/transact (d/connect uri)
             [[:db.fn/retractEntity :vendor/mistake]])


:db.error/invalid-alter-attribute Error: {:db/error
   :db.error/unsupported-alter-schema, :attribute :db/cardinality,
   :from :db.cardinality/one, :to :disabled

Joe Lane18:08:31

are you using cloud or on prem?

Joe Lane18:08:54

Oh, wait, do you have any records using :vendor/mistake?


schema cannot be retracted


if absolutely necessary, you can rename an attribute


then create a new one with the original name and whatever change you were wanting


this is squarely in the realm of dev-time; i wouldn’t recommend doing that in any kind of prod environment

Joe Lane18:08:36

👍 good to know, thanks marshall.


probably forgetting something dumb, but do I need to do anything special to pass an eid into a query?


I’m getting back :db.error/invalid-lookup-ref Invalid list form: []


but my query is :where [?ref :org/location ?eid] and I’m passing in a known-good eid as ?eid.