Add (currently unused) ability to generate CTEs.
This commit is contained in:
parent
f225dbe734
commit
a9b26f154a
2 changed files with 4 additions and 0 deletions
|
@ -65,6 +65,7 @@
|
||||||
known-types ; {?var1 :db.type/integer}
|
known-types ; {?var1 :db.type/integer}
|
||||||
extracted-types ; {?var2 :datoms123.value_type_tag}
|
extracted-types ; {?var2 :datoms123.value_type_tag}
|
||||||
wheres ; [[:= :datoms123.v 15]]
|
wheres ; [[:= :datoms123.v 15]]
|
||||||
|
ctes ; {:name {:select …}}
|
||||||
])
|
])
|
||||||
|
|
||||||
(defn bind-column-to-var [cc variable table position]
|
(defn bind-column-to-var [cc variable table position]
|
||||||
|
|
|
@ -255,6 +255,7 @@
|
||||||
:extracted-types {}
|
:extracted-types {}
|
||||||
:external-bindings (or external-bindings {})
|
:external-bindings (or external-bindings {})
|
||||||
:bindings {}
|
:bindings {}
|
||||||
|
:ctes {}
|
||||||
:wheres []})
|
:wheres []})
|
||||||
patterns)))
|
patterns)))
|
||||||
|
|
||||||
|
@ -265,6 +266,8 @@
|
||||||
[cc]
|
[cc]
|
||||||
(merge
|
(merge
|
||||||
{:from (:from cc)}
|
{:from (:from cc)}
|
||||||
|
(when-not (empty? (:ctes cc))
|
||||||
|
{:with (:ctes cc)})
|
||||||
(when-not (empty? (:wheres cc))
|
(when-not (empty? (:wheres cc))
|
||||||
{:where (cons :and (:wheres cc))})))
|
{:where (cons :and (:wheres cc))})))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue