Fork me on GitHub
#datomic
<
2022-05-26
>
tomekw08:05:23

Hi, I've a quick transact vs transact-async question. Docs state:

Returns a completed future that can be used to monitor the completion
   of the transaction. If the transaction commits, the future's value is
   a map containing the following keys:
What does completed mean here? Is it a realized? future or CompletableFuture ?

favila12:05:13

D/transact blocks waiting for the future to complete, subject to a global, system-property-tunable timeout

favila12:05:28

D/transact-async never blocks

favila12:05:36

That is the only difference

favila12:05:56

Importantly, both return the same future

tomekw12:05:16

👍 thank you

tomekw12:05:59

so, transact returns a realized? => true future, correct?

jdkealy17:05:38

Someone pen tested my app and made a bunch of test records with like 10k+ character long strings. I'd like to find all of them and delete them. Is there a way to count the string length and grab all entities ? I tried this, doesn't seem to work

(d/q
         '[:find ?e
           :in $ 
           :where
           [?attr :db/valueType :db.type/string ]
           [?e ?attr ?val]
           [(> 300 '(count ?val))]
           
           ] (_d))

favila17:05:07

You need to bind the count separately. You may be better off using d/datoms for this

favila17:05:27

Queries like this use a lot of memory

jdkealy17:05:27

cool thanks a bunch!

favila17:05:27

Note that the large values will still be in your history indexes

jdkealy17:05:46

how problematic is that ?

favila17:05:43

Depends on your database

jdkealy17:05:56

using dynamo

favila17:05:34

How many of them, how much history reading you do, how much novelty you produce, what your fragmentation is like, etc

jdkealy18:05:00

got it thanks. it's just a test cluster, i won't worry abuot it for now