   (zipmap (keys schema)
           (map #(let [m (:fields %)]
                  (assoc %
-                   :fields-getters
+                   ::reader-map
                    (zipmap (keys m)
                            (map
                              (fn [field]

                   :lesson/title       "title"
                   :lesson/description "description"
                   :lesson/keywords    "keywords"}}})
      (row-getter :course/topics
        #(has-many % :topic :topic/course-id {:sort ["sortorder"]}))
      (row-getter :course/lessons
        #(has-many % :lesson :lesson/course-id {:sort ["lessonno"]}))
      (row-getter :topic/course
        #(has-one % :course :topic/course-id))
      (row-getter :topic/lessons
        #(has-many % :lesson :lesson/topic-id {:sort ["lessonno"]}))
      (row-getter :lesson/course
        #(has-one % :course :lesson/course-id))
      (row-getter :lesson/topic


(defn row-getter [schema k f]
  (let [table (keyword (namespace k))]
    (assoc-in schema [table ::reader-map k] f)))

(def db-specs
  (-> (prepare-schema
