This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-19
Channels
- # ai (3)
- # aws (1)
- # beginners (94)
- # boot (26)
- # cider (3)
- # cljs-dev (99)
- # cljsrn (86)
- # clojure (263)
- # clojure-dusseldorf (4)
- # clojure-greece (22)
- # clojure-italy (2)
- # clojure-quebec (1)
- # clojure-russia (12)
- # clojure-spec (71)
- # clojure-uk (123)
- # clojurescript (92)
- # core-async (4)
- # cursive (13)
- # data-science (2)
- # datomic (123)
- # docker (2)
- # emacs (15)
- # events (1)
- # graphql (2)
- # hoplon (71)
- # jobs-discuss (7)
- # lumo (5)
- # off-topic (12)
- # om (6)
- # onyx (97)
- # other-languages (4)
- # overtone (2)
- # pedestal (1)
- # re-frame (20)
- # reagent (33)
- # remote-jobs (1)
- # ring-swagger (1)
- # rum (5)
- # slack-help (6)
- # uncomplicate (1)
- # unrepl (33)
- # untangled (48)
- # vim (23)
- # yada (21)
Quick question. When I am trying to restore a database from a remote dynamo table to a local dynamodb-local table, I keep getting these sorts of errors Caused by: java.util.concurrent.ExecutionException: clojure.lang.ExceptionInfo: :restore/read-failed Unable to read 58de91f6-6e59-4284-ad6b-94c262caf019 {:key "58de91f6-6e59-4284-ad6b-94c262caf019", :db/error :restore/read-failed}
2017-05-19 00:25:57.981 WARN default datomic.backup - {:message "error executing future", :pid 76, :tid 10}
java.util.concurrent.ExecutionException: clojure.lang.ExceptionInfo: :restore/read-failed Unable to read 58de91f6-6e59-4284-ad6b-94c262caf019 {:key "58de91f6-6e59-4284-ad6b-94c262caf019", :db/error :restore/read-failed}
I just have no idea what this error actually means, so it's hard to troubleshoot, any insight would be greatly appreciated
@goomba does your MySQL give SELECT rights to user datomic and table datomic? Seems like it may not
It does, strangely
I can login to the datomic db with mysql -udatomic -pdatomic datomic
and select * from datomic_kv
just fine
It's quite the mystery to me
okay what I've figured out so far is that the password
parameter isn't being passed to MySQL for some reason
when I do tail -f /var/log/mysql/error.log
I see the messages 2017-05-19T12:33:51.825580Z 316 [Note] Access denied for user 'datomic'@'localhost' (using password: NO)
@goomba What works for us here is adding &useLocalSessionState=true
- i forget the where and why this was needed.
worth a shot!
eh... what still seems to be the case strangely is that it's only picking up the first parameter I pass in for some reason
it seems to ignore the rest of them
datomic:
is what I just ran and it gives the same error š
If I switch the order of parameters around, it reads the password but not the username
this is a modification of what was given to me by the transactor that I'm trying to use to initialize the peer
so, peer URI š
I wonder. In your URL you use "datomic" as the host, but the error is mentioning "localhost". Perhaps the hosts entries in the mysql auth tables are not matching?
well it does say localhost:3306
in the string
but I'm gonna glance at the grant table anyway
marshall got me figured out
I wasn't escaping the ampersand
Woohoo! Got it sorted! Need to escape that ampersand! Everyone can rest easy now š I may have gotten a little hint from cognitect sales team about being a shell scripting noob hehehe š
jfntn: nope, but the basic (s/keys :req [::foo] :opt [::bar])
ā [::foo ::bar]
would be pretty easy with spec-tools (https://github.com/metosin/spec-tools)
user=> (into [] (:keys (st/spec (s/keys :req [::foo] :opt [::bar]))))
[:user/foo :user/bar]
@U1NDXLDUG actually tried that but I was getting nil keys, suspect it was because I was using 0.2 with alpha15 but not sure
also would like to throw in the question queue has anyone used the datomic console with a sql based storage?
struggling to figure out the correct command
datomic:
is what I'm trying but no luck so far
okay wasn't sure if that was important or not
yayyyy š :thumbsup:
okay so if I make an entity of some sort and I decide I want it to have more attributes later, that's doable yes?
like this was presented in one of the examples
[{:db/ident :story/title
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one}
{:db/ident :story/url
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one
:db/unique :db.unique/identity}
{:db/ident :story/slug
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one}]
but if later I wanted to make that entity also have, say, an author, that's doable yes?these are not a single entity, these are three entities. This transaction creates the :story/title
:story/url
and :story/slug
attributes @goomba
ah, yeah I'm trying to follow along with the "Day of Datomic 2016" videos
ok I see so my confusion was what an entity is
wait wait, just for clarification... aren't those three schema that collectively form an entity?
or do I have that backwards?
at the bottom, datomic is a set of assertions [entity attribute value transaction]
(called "datoms")
oh fascinating
okay so if I wanted to (conceptually) add some information about a story, like an author, what would be the idiomatic way to do that?
query by some attribute of the story and then do some kind of association with the entity id and the new information?
by the way @favila I owe you at least one beer for all the help you've been! š»
first you need a reference to the story. This can be via direct entity id, or an attribute+value unique to the entity
so (d/transact conn [{:db/id [:story/url "the-url"] :story/author [:author/id #uuid"some-uuid"]}])
for example, would add a story author assertion to a story entity
the map form of the transaction is sugar for [:db/add [:story/url "the-url"] :story/author [:author/id #uuid"some-uuid"]]
so in one shot (d/transact conn [{:db/id [:story/url "the-url"] :story/author [:author/id #uuid"some-uuid"]}])
does a logical lookup on the story that matches "the-url" on the attribute :story/url
and associates it with the :story/author
specified... magical
now this presupposes that I've made a schema for :story/author
first, yes?
I was blind but now I see š š š
hi guys, im learning datomic using the official tutorial
but unfortunately there is a query on the page http://docs.datomic.com/getting-started/see-historic-data.html which produces error
can someone give me a hint what is wrong here?
query:
(<!! (client/transact conn {:tx-data [{:db/id commando-id :movie/genre "future governor"}]}))
result:
{:datomic.client-spi/request-id "b7ca85b3-b3d4-4f65-8f33-4b9d8b103fb5", :cognitect.anomalies/category :cognitect.anomalies/incorrect, :cognitect.anomalies/message ":db.error/invalid-lookup-ref Invalid list form: [[17592186045419]]", :dbs [{:database-id "591e005d-745c-492b-8f7b-ff406aaabda5", :t 1001, :next-t 1005, :history false}]}
user=> (def commando-id
(ffirst (<!! (client/q conn {:query '[:find ?e
:where [?e :movie/title "Commando"]]
:args [db]}))))
#user/commando-id
user=>
Is it guaranteed that the first datom in :tx-data
off of a transaction report is the datom with the tx entity?
anyone knows what it could mean if (d/create-database db-uri)
yields
IllegalArgumentExceptionInfo :db.error/read-transactor-location-failed Could not read transactor location from storage datomic.error/arg (error.clj:57)
issuing (d/get-database-names db-uri)
with a version of the db-uri that has a *
in place of the datomic db name gives me nil
which isn't unsurprising because when i look at the datomic_kvs
table in postgres it is still empty
thanks @favila worked like a charm. my first error was not starting the transactor (for some reason i thought the peer will write directly into storage and that starting the transactor only makes sense later once the datomic db is created) my second error was that in the properties file of the transactor I had the name of the datomic db that I wanted to work with instead of the name of the postgres db that i use for storage => so many db names and cryptic db urls š
You can block with a deref. Is your goal to call a callback when it's done (push not pull)?
is there a better/more-idiomatic way to do this?
(let [my-id (<!! (client/q conn {:query '[:find ?x
:where
[?x :story/title "Teach Yourself Programming in Ten Years"]
]
:args [db]}
))]
(println (<!! (client/transact conn {:tx-data
[{:db/id (ffirst my-id)
:story/author-first "Peter"
:story/author-last "Norvig"}]}))))
i.e., inlining the query? I assume there is but when I try
(<!! (client/transact conn {:tx-data
[{:db/id [:story/title "Teach Yourself Programming in Ten Years"]
:story/author-first "Peter"
:story/author-last "Norvig"}]}))
I'm told that :story/title
is not unique (which is true)@goomba unless you have a unique attribute (identity or value) you can include in the transaction map, the query for ID followed by transact is pretty standard
gotcha! Well I'm cool with that as long as I'm not writing code like a barbarian over here. Well, not a complete barbarian
It's often a good idea to have an externally unique identifier (ie domain ID of some kind) for this reason (and some other reasons)
In this case something like the library of Congress identifier or a UPC might be appropriate
mhm. Unfortunately my weak human memory was having trouble recalling the UPC exactly so I tried to fudge with whatever I could remember š
Thanks again! š©'s off!
hey, how cool is our life that we get to do this? eh? eh?
still coding at almost 8pm on a Friday cause it's the š's knees!
(if I was still stuck with JavaScript I would've hit the bar at 11am I think)
(11am pacific time, and I work on the east coast)
Is the backend of the
site in datomic?
This is a roundabout way of asking if datomic is appropriate for serving videos
Oh wait just noticed they're using vimeo
But still, "Is datomic appropriate for serving videos?"
gotcha. not even close to my primary use case just curious
we have polyglot persistence for that sort of thing so not a big deal
yeah I was thinking something along those lines
blob store... I don't know where we come up with these words but another reason I love this industry š