Fork me on GitHub
#datomic
<
2019-06-08
>
Brian Abbott08:06:19

Hi, I’m looking to be able to synchronize cloud to dev-prem. How can I do this? Has anyone done it before?

daniel.spaniel16:06:54

I am curious about installing a transaction function on my in memory test database. I think this is same proceedure as on-prem documentation which says to install like this

daniel.spaniel16:06:59

;; tx-data to install the function
[{:db/ident :add-doc
  :db/fn #db/fn {:lang "clojure"
                 :params [db e doc]
                 :code [[:db/add e :db/doc doc]]}

daniel.spaniel16:06:50

but i already have the code setup in a function somewhere like my.package/my-function

daniel.spaniel16:06:45

so i am curious how to install it ..

daniel.spaniel16:06:40

i am trying things like

daniel.spaniel16:06:46

(d/transact conn {:tx-data [{:db/ident :my-function
                                 :db/fn    `my.package/my-function}]})

daniel.spaniel16:06:52

but that not making datomic very happy ( says `my.package/my-function is not a valid :datomic/fn for attribute :db/fn )

daniel.spaniel16:06:18

also the example does not even work in the in-memory db I get error

daniel.spaniel16:06:21

Syntax error compiling fn* at (middleware_test.clj:13:1).
Can't embed object in code, maybe print-dup not defined: clojure.lang.Delay@3151d7b9

daniel.spaniel16:06:38

(d/transact conn
      {:tx-data [{:db/ident :add-doc
                  :db/fn    #db/fn {:lang   "clojure"
                                    :params [db e doc]
                                    :code   [[:db/add e :db/doc doc]]}}]})

mss17:06:52

Trying out datomic cloud for the first time and noticed that there’s not a connection shutdown function the same way there is in the on-prem version of datomic. I assume then that there’s no cleanup that needs to be done when I’m ready to shut down my client/system?

hansw17:06:11

Back for another go at Datomic 🙂

hansw17:06:36

In the tutorial it says:

(def items-by-type-ionized
  "Ionization of items-by-type for use with AWS API Gateway lambda
proxy integration."
  (apigw/ionize items-by-type))
What does 'ionize' mean in this context?

okocim21:06:02

API Gateway passes the request to and expects a response from the application in a specific json format. I think it’s describe here, but I might be wrong: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html#api-gateway-simple-proxy-for-lambda-input-format The handler function in your app adheres to the clojure ring spec. The ionize function takes care of the conversions to make those two things compatible. It’s probably just a lot of boring code filled with map key renaming and type conversion…

👍 4
hansw06:06:16

You call it boring, I call it 'magic glue' , i'm a platform-guy 🙂