 (s/defn render-exp-script
 	([exp-data :- ExpData]
 		(validate exp-data)
-		(let [ctx nil]
-			(str/join "\n"
-								[(render-header ctx exp-data)
-								 (render-schemas ctx exp-data)
-								 (c/render-footer)])))
+		(str/join "\n"
+							[(render-header exp-data)
+							 (render-schemas exp-data)
+							 (c/render-footer)]))
 	([file exp-data :- ExpData]
 		(let [script (render-exp-script exp-data)]
 			(spit file script))))

				 (.get cal Calendar/MONTH) "_"
				 (.get cal Calendar/DAY_OF_MONTH))))

(defn render-header [ctx {:keys [remote-link file-prefix directory]}]
	(let [file-basename (str file-prefix "_" (render-today))]
		(str/join "\n"
							["declare"

			 "schema_name => '" schema-name "'"
			 ");"))

(defn render-subqueries-datafilter [schema-name tables]
	(->> tables
			 (map #(render-subquery-datafilter schema-name (first %) (second %)))
			 (str/join "\n")))

(defn render-schemas [{:keys [schemas]}]
	(let [metadata-schema-filter (render-schema-metadatafilter schemas)
				table-metadata-filter (render-table-metadatafile schemas)
				subquery-filters (into {} (map #(vector (first %) (:subquery-filters (second %))) schemas))
				data-filters (map #(render-subqueries-datafilter (first %) (second %)) subquery-filters)]
		(str metadata-schema-filter "\n" table-metadata-filter "\n"
				 (str/join "\n" data-filters))))

