This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-16
Channels
- # babashka (48)
- # beginners (72)
- # calva (65)
- # cider (10)
- # clerk (11)
- # clj-kondo (14)
- # clojure (85)
- # clojure-austin (11)
- # clojure-czech (1)
- # clojure-europe (26)
- # clojure-nl (1)
- # clojure-uk (6)
- # core-matrix (1)
- # cursive (8)
- # datomic (20)
- # docker (38)
- # emacs (2)
- # events (1)
- # fulcro (6)
- # funcool (6)
- # hyperfiddle (79)
- # introduce-yourself (1)
- # lsp (131)
- # malli (32)
- # off-topic (11)
- # pathom (3)
- # re-frame (11)
- # reagent (15)
- # releases (2)
- # shadow-cljs (49)
- # sql (3)
- # tools-deps (36)
Is there a way to determine if a transactor is in standby ? i was thinking if 4334 is closed but it health checks/9999 ok but i’m worried the devil is in the details . ( In an automated way from the peer — of course i could view logs. )
I have a query I'm trying to work but it doesn't quite make sense to me...
I have an attr
:session/students
which is just a many
ref
Then I have a component called
:session/student_sessions
which has :student_session/student
I'd like to find all upcoming sessions
which have student_sessions that don't match the student roster.
I've tried
(d/q
'[:find ?e
:in $ ?now ?future
:where
[?e :session/start_time ?st]
[(> ?st ?now)]
[(< ?st ?future)]
(not [?e :session/cancelled true])
[?e :session/students ?students]
[?e :session/student_sessions ?sss]
(not [?sss :student_session/student ?students])
] (db/_d) now date)
But it seems to just be matching any session that has more than one student.I want at least one session/student
that is not in the :session/student_sessions
=> :student_session/student
list
This is what i end up having to do and it takes much longer
(->> (d/q
'[:find ?e
:in $ ?now ?future
:where
[?e :session/start_time ?st]
[(> ?st ?now)]
[(< ?st ?future)]
(not [?e :session/cancelled true])
[?e :session/students ?students]
[?e :session/student_sessions ?sss]
(not [?sss :student_session/student ?students])
] (db/_d) now date)
(map first )
(map db/by-id)
(filter (fn [e]
(not=
(->> e :session/student_sessions (map (fn [e]
(-> e
:student_session/student
:db/id
))) set)
(->> e :session/students (map :db/id) set))))
(map :db/id))
'[:find ?e
:in $ ?now ?future
:where
[?e :session/start_time ?st]
[(> ?st ?now)]
[(< ?st ?future)]
(not [?e :session/cancelled true])
[?e :session/students ?student]
(not-join [?e ?student]
[?e :session/student_sessions ?sss]
[?sss :student_session/student ?student])
]
which you can read as “if
[?e :session/student_sessions ?sss]
[?sss :student_session/student ?student]
produces any results, drop the corresponding row(s) that match the ?e ?student
join”what you had was like (not-join [?sss ?student] [?sss :student_session/student ?student])
, which will drop if there is any ?sss
that lacks the student, which is probably usually true, unless the student is taking every class offered
I have a really nice solution for getting data from PostgreSQL to Snowflake via Fivetran replication. How do people do this for Datomic Server or Cloud?
You can use the Log API and the tx-range
function to retrieve all transaction data in chronological order from Datomic Server or Cloud. You can fetch the required data from the log by specifying the desired range of transactions.
You can use it to develop a connector integrating Datomic with Snowflake that continuously polls the transaction log for new updates and transforms it into a format that Snowflake supports.
https://docs.datomic.com/cloud/time/log.html
> continuously polls the transaction log for new updates and transforms it into a format that Snowflake supports Yes, that sounds like what I’m after!