I am trying to set up a composite tuple index for lets say an account entity and I am doing this ( which is like something straight out of the docs )
{:db/ident :account/company+number
:db/valueType :db.type/tuple
:db/tupleAttrs [:account/company :account/number]
:db/cardinality :db.cardinality/one
:db/unique :db.unique/value
}
where the account/company is a ref and the account/number is a long.
the problem is that the account/number value (that datomic is filling in) is always -> nil.
it seems like this tuple will be filled in by datomic correctly when the attrs are anything BUT ref and something else. if i do keyword and long its fine, but ref and anything else does not work.
is this a known issue ?I tryied to reproduce this issue here
https://gist.github.com/souenzzo/3ba161909006ef08d53ac63a1d622fa2
But I can't understand where you are seeing this nil
@jeroen.dejong I was hoping to hear something like this. Can you share any more details? An example maybe?
Basically we created a 2 (internal) libraries. 1 for monitoring the tx-log, and updating those values into ES. The other exposes some search functions (uses spandex to perform a query). We put that library on the classpath of our peer server. Which allows the client to use the functions in our internal library to be used in datalog:
{:query '{:find [?e]
:where [(ourthing/search ?client ?search-term) [?e ...]]
:in [$ ?client ?search-term]}
:args [(d/db ...), {:hosts ["<http://127.0.0.1:9200>"]}, "Hello world!"]}
In order to get this to work we built a second (internal) library which monitors the tx log, and updates ES indexes for any attributes we're interested in searching.Most of this is very much WIP, but as far as I can tell right now it's a very viable solution.
Nice! Thanks for sharing this!
i am going to run this gist in my db and see if i can alter it to show good reproduction of issue
1๐this does work on my db so that was interesting. thanks. i now have to correlate this with my schema and see what is different. Muchos thanks again!
Is anyone here using AssumeRole
/STS to delegate access to sub-accounts in AWS, and successfully connecting to a running Datomic system with the Datomic CLI?
./datomic cloud list-systems --profile example-dev
WARNING: When invoking clojure.main, use -M
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
Execution error (ExceptionInfo) at datomic.tools.ops.aws/invoke! (aws.clj:83).
AWS Error: Unable to fetch credentials. See log for more details.
Running aws --profile example-dev s3 ls
works as expected so I think this might be a problem in the Datomic CLI side of things.
My ~/.aws/config
looks good to me:
[profile example]
region=eu-west-2
[profile example-dev]
role_arn=arn:aws:iam::111111111111:role/developer
source_profile=example
Credentials should be inherited from the example
profileโฆ the AWS CLI appears to get this right so I think my ~/.aws
stuff is kosher.I've created a question over on http://ask.datomic.com: http://ask.datomic.com/index.php/540/connect-running-datomic-system-using-profiles-assumed-roles
I vaguely remember a problem with some Datomic tooling and use of assumed roles. The workaround was to juggle your AWS config about so you're not using profiles but this won't work here as I have to STS my way into the sub account. No direct access possible.
I've added the SSH ingress rule to the bastion security group, and I've attached the Datomic Admin policy to the role that gets assumed when you switch into the sub-account.
I don't know what the "log" is that the error refers to. I've seen that in cognitect-labs/aws-api
too and didn't know what log was being referred to there either. ๐
i found the problem .. we are doing this
{:db/ident :accounting-category/company+number
:db/valueType :db.type/tuple
:db/tupleAttrs [:entity/company :accounting-category/number]
:db/cardinality :db.cardinality/one
:db/unique :db.unique/value
}
and this attribute entity/company is shared with other entities.
seems like datomic trying to make this tuple for any entity with that attirbute and not just accounting-category entity
is there a way to stop that and only make this constraint tuple when this exact entity is created / edited ?
@joshkh this lib does exactly what you want but not yet for cloud https://github.com/vvvvalvalval/datomock/issues/6
thanks for sharing. i'm sticking to dev-local
as being the "official" solution at the moment, and starting from a cloud db (whether remote or imported locally) is a must. no on-prem for me ๐