                                                                   {:course/topics [:db/id :topic/title]}
                                                                   {:limit 2})])}
                                     [[:where {:db/id 4}]]))
-             {:db/id 4 :course/topics [{:db/id 18 :topic/title "Getting Started"}
-                                       {:db/id 19 :topic/title "Staff and Clefs"}]}))
+             {:db/id 4 :course/topics [{:db/id 18 :db/table :topic :topic/title "Getting Started"}
+                                       {:db/id 19 :db/table :topic :topic/title "Staff and Clefs"}]
+              :db/table :course}))
       (done))))
 
 (deftest parser-read-topics

                                     :table :course
                                     :ast   (om/query->ast [:db/id :course/title])}
                                    [[:where {:url/slug "reading-music"}]]))
             {:db/id 4, :course/title "Reading Music"}))

      (is (= (<! (p/query-sql-first {:db    ts/connection
                                     :table :course

    (go
      (is (= (->> (p/parse {:db ts/connection} [{:app/topics [:db/id :topic/title {:topic/course [:db/id]}]}]) <!
                  (select [:app/topics FIRST]))
             [{:db/id 2 :db/table :topic :topic/title "Getting Started" :topic/course {:db/id 7 :db/table :course}}]))
      (done))))

(deftest test-parse-read-lesson-by-slug
  (async done
    (go
      (is (= (->> (p/parse {:db ts/connection} [{[:lesson/by-slug "percussion"] [:db/id :lesson/title]}]) <!)
             {[:lesson/by-slug "percussion"] {:db/id 9 :db/table :lesson :lesson/title "Percussion"}}))
      (is (= (->> (p/parse {:db ts/connection} [{[:lesson/by-slug "invalid"] [:db/id :lesson/title]}]) <!)
             {[:lesson/by-slug "invalid"] [:error :row-not-found]}))
      (done))))
