<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Datomic Knowledgebase - Recent questions tagged d with</title>
<link>https://ask.datomic.com/index.php/tag/d%20with</link>
<description>Powered by Question2Answer</description>
<item>
<title>Usage of datomic client API&#039;s with in order to simulate facts without asserting.</title>
<link>https://ask.datomic.com/index.php/499/usage-datomic-client-order-simulate-facts-without-asserting</link>
<description>&lt;p&gt;Hello Clojurians,&lt;/p&gt;
&lt;p&gt;According to Datomic client API the (with db tx-data) allows to make queries on a database with additionnal facts without asserting them.  Afaik, it&#039;s also known as &quot;what-if&quot; query.&lt;/p&gt;
&lt;p&gt;The docs says that the tx-data should be exactly the sam as in a transact.&lt;/p&gt;
&lt;p&gt;But on my machine, this works:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(d/transact conn {:tx-data [{:token/color :blue}]})        
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But this doesn&#039;t:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(d/q &#039;[:find (count ?e1)                             
       :in $                                                                                                                                         
       :where [?e1 :token/color :grey]]                                                                                                 
     (d/with (d/db conn) {:tx-data [{:token/color :grey}]})) 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With this error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  Show: Project-Only All                                                                                                                                                                                             
  Hide: Clojure Java REPL Tooling Duplicates  (11 frames hidden)                                                                                                                                                     
                                                                                                                                                                                                                     
1. Unhandled clojure.lang.ExceptionInfo                                                                                                                                                                              
   Datomic Client Exception                                                                                                                                                                                          
   {:cognitect.anomalies/category :cognitect.anomalies/incorrect,                                                                                                                                                    
    :http-result                                                                                                                                                                                                     
    {:status 400,                                                                                                                                                                                                    
     :headers                                                                                                                                                                                                        
     {&quot;server&quot; &quot;Jetty(9.4.27.v20200227)&quot;,                                                                                                                                                                            
      &quot;content-length&quot; &quot;247&quot;,                                                                                                                                                                                        
      &quot;date&quot; &quot;Sun, 01 Nov 2020 16:13:07 GMT&quot;,                                                                                                                                                                        
      &quot;content-type&quot; &quot;application/transit+msgpack&quot;},                                                                                                                                                                 
     :body nil}}                                                                                                                                                                                                     
                 async.clj:   58  datomic.client.api.async/ares                                                                                                                                                      
                 async.clj:   54  datomic.client.api.async/ares                                                                                                                                                      
                  sync.clj:  120  datomic.client.api.sync/eval27181/fn                                                                                                                                               
             protocols.clj:  126  datomic.client.api.protocols/fn/G                                                                                                                                                  
                   api.clj:  363  datomic.client.api/with                                                                                                                                                            
                   api.clj:  353  datomic.client.api/with                                                                                                                                                            
                      REPL:  275  four.core/eval28597                                                                                                                                                                
                  core.clj: 3214  clojure.core/eval                                                                                                                                                                  
                  core.clj: 3210  clojure.core/eval                                                                                                                                                                  
                  main.clj:  437  clojure.main/repl/read-eval-print/fn                                                                                                                                               
                  main.clj:  458  clojure.main/repl/fn                                                                                                                                                               
                  main.clj:  368  clojure.main/repl                                                                                                                                                                  
               RestFn.java: 1523  clojure.lang.RestFn/invoke                                                                                                                                                         
                  AFn.java:   22  clojure.lang.AFn/run                                                                                                                                                               
                  AFn.java:   22  clojure.lang.AFn/run                                                                                                                                                               
               Thread.java:  844  java.lang.Thread/run                                                                                                                                                               
     
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Any clue ?&lt;/p&gt;
</description>
<category>Client API</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/499/usage-datomic-client-order-simulate-facts-without-asserting</guid>
<pubDate>Sun, 01 Nov 2020 16:48:56 +0000</pubDate>
</item>
</channel>
</rss>