Add missing operators to list and add more error handling.
This commit is contained in:
parent
4a06ad489f
commit
5ff1fed578
|
@ -1,4 +1,4 @@
|
||||||
(defproject views "0.4.8"
|
(defproject views "0.4.9"
|
||||||
:description "You underestimate the power of the SQL side"
|
:description "You underestimate the power of the SQL side"
|
||||||
|
|
||||||
:url "https://github.com/diligenceengine/views"
|
:url "https://github.com/diligenceengine/views"
|
||||||
|
|
|
@ -85,10 +85,15 @@
|
||||||
|
|
||||||
(defn- calculate-delete-deltas
|
(defn- calculate-delete-deltas
|
||||||
[db view-map]
|
[db view-map]
|
||||||
|
(try
|
||||||
(->> (:delete-deltas-map view-map)
|
(->> (:delete-deltas-map view-map)
|
||||||
hsql/format
|
hsql/format
|
||||||
(j/query db)
|
(j/query db)
|
||||||
(assoc view-map :delete-deltas)))
|
(assoc view-map :delete-deltas))
|
||||||
|
(catch Exception e
|
||||||
|
(error "computing delete deltas for" view-map)
|
||||||
|
(log-exception e)
|
||||||
|
(throw e))))
|
||||||
|
|
||||||
(defn compute-delete-deltas-for-insert
|
(defn compute-delete-deltas-for-insert
|
||||||
"Computes and returns a sequence of delete deltas for a single view and insert."
|
"Computes and returns a sequence of delete deltas for a single view and insert."
|
||||||
|
|
|
@ -7,8 +7,10 @@
|
||||||
(def table-clauses
|
(def table-clauses
|
||||||
[:from :insert-into :update :delete-from :join :left-join :right-join])
|
[:from :insert-into :update :delete-from :join :left-join :right-join])
|
||||||
|
|
||||||
|
;; This list doesn't support custom operators. Is there something else we can do?
|
||||||
(def pred-ops
|
(def pred-ops
|
||||||
#{:= :< :> :<> :>= :<= :in :between :match :ltree-match :and :or :not=})
|
#{:= :< :> :<> :>= :<= :in :between :match :ltree-match :and :or :not= :like :xor :regexp :not-in :not-like
|
||||||
|
:!= :is :is-not})
|
||||||
|
|
||||||
(defn process-complex-clause
|
(defn process-complex-clause
|
||||||
[tables clause]
|
[tables clause]
|
||||||
|
|
Loading…
Reference in a new issue