<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions tagged datascript</title>
<link>https://ask.clojure.org/index.php/tag/datascript</link>
<description></description>
<item>
<title>Wrapping Datascript query in a function?</title>
<link>https://ask.clojure.org/index.php/9337/wrapping-datascript-query-in-a-function</link>
<description>&lt;p&gt;Getting a seemingly bizarre problem with Datascript. For some reason when I run this query without it being wrapped in a function, everything works. But once I wrap it in a function, it returns the value for :block/content for every entity in the database. I'm confused because I haven't encountered any issues with wrapping other Datascript queries in the past. Does anyone more experienced than me with Datascript see any issues?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;;; Works fine and returns the correct value
(ds/q '[:find ?block-text
        :where
        [?id :block/id &quot;l_63xa4m1&quot;]
        [?id :block/content ?block-text]]
      @conn)

;; Returns every value for `:block/content` in the db
(defn content-find
  [id-passed]
  (ds/q '[:find ?block-text
          :where
          [?id :block/id ?id-passed]
          [?id :block/content ?block-text]]
        @conn))
(content-find &quot;l_63xa4m1&quot;)
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Libs</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9337/wrapping-datascript-query-in-a-function</guid>
<pubDate>Fri, 29 May 2020 20:05:20 +0000</pubDate>
</item>
<item>
<title>Why does Transit not allow serialization of clojure(script) functions ? What is the inherent difficulty there ?</title>
<link>https://ask.clojure.org/index.php/8254/transit-serialization-clojure-functions-inherent-difficulty</link>
<description>&lt;p&gt;I am trying to serialize my datascript database to JSON for storage on a filesystem. &lt;br&gt;
Some of the data inside my database includes functions. For reasons that are not interesting, I need to store them in the database for now with other session info for the application. But I get an exception that transit &quot;cannot write Function&quot;&lt;/p&gt;
&lt;p&gt;I looked at the code and it simply tries to handle data structures only - maps, vectors, etc. But there is no handler for functions. So I KNOW WHY I get the error, but the gist of my question is why it was not implemented to be able to serialize functions as well ? &lt;/p&gt;
&lt;p&gt; Is it just too novel an thought ? &lt;/p&gt;
&lt;p&gt; thanks&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8254/transit-serialization-clojure-functions-inherent-difficulty</guid>
<pubDate>Mon, 29 Jul 2019 23:10:55 +0000</pubDate>
</item>
</channel>
</rss>