Can I somehow calculate src-var? dynamically right in query for data-pattern( [ src-var? (variable | constant | ‘_’)+ ])
I’m trying to achieve something like in the next simplified example
(defn chooseDb [db] db)
(d/q '[:find
?e
:in $
:where
[(user/chooseDb $) $dbToUse]
[$dbToUse ?e :someAttr]
]
(d/db conn))
Attempting to execute the above code leads to
Execution error (IllegalArgumentException) at datomic.query/move-sources-to-meta$fn (query.clj:288).
Data source not supplied: $dbToUse