                   :select '(cons
                             (org-id-get-create)
                             (org-entry-get (point) "Effort"))
-                  :where `(and (todo)
+                  :where `(and ,(or org-ql-match '(todo))
                                ;; Is this redundant?  Could we just stick with `ts-active'?
                                (or (scheduled :from ,start-date :to ,end-date)
                                    (deadline :from ,start-date :to ,end-date)

The result has the form (TOTAL-TIME . TASKS), where TASKS is a
list of cons cells (ID . EFFORT).  The total time is given as an
Org mode time string of the form hh:mm, as are all EFFORT
entries."
  (let* (;; Allow Org syntax for dates; the result should be understandable by
         ;; `parse-time-string' and thus `org-ql-query' should be fine with that.
         (start-date (org-read-date nil nil start-date))


;;; Task Management

(defun db/org-planned-tasks-in-range (start-date end-date &optional org-ql-match)
  "Return list of tasks planned between START-DATE and END-DATE.

This function will search through the files returned by
