diff --git a/src/squirrel_parse/core.clj b/src/squirrel_parse/core.clj index ad09901..d27c830 100644 --- a/src/squirrel_parse/core.clj +++ b/src/squirrel_parse/core.clj @@ -1,7 +1,7 @@ (ns squirrel-parse.core (:require [squirrel-parse.parser :refer [parse]] [squirrel-parse.simplify :refer [simplify]] - [squirrel-parse.to-adl :refer [to-adl]])) + [squirrel-parse.to-adl :refer [table-definitions-to-entities]])) ;;; This is get-you-started code. diff --git a/src/squirrel_parse/to_adl.clj b/src/squirrel_parse/to_adl.clj index 9e556b5..d3d4652 100644 --- a/src/squirrel_parse/to_adl.clj +++ b/src/squirrel_parse/to_adl.clj @@ -224,15 +224,13 @@ fs-cols (:NAME (:NAMES (:REFERENCES-CC sm)))] (if (= table ns-table) - (do - (println "...Firing!") (deep-merge entity-map {:content {:properties {(keyword ns-cols) {:attrs - {:type "entity" :entity fs-table :farkey fs-cols}}}}})) + {:type "entity" :entity fs-table :farkey fs-cols}}}}}) ;; else this statement doesn't refer to us... )))) @@ -259,6 +257,9 @@ (defn decorate-with-all + "Apply this `function` to this `entity-map` and each of these statements + in sequence, and return a merge of the map with each of the statements + which actually returned a value." [entity-map statements function] (reduce deep-merge @@ -279,7 +280,7 @@ (map (fn [x] (let [entity-map (base-map x)] - {x + {(keyword x) (decorate-with-all (decorate-with-all entity-map statements #(decorate-with-relationship %1 %2)) statements