Skip to content

Commit

Permalink
Finish typing the components
Browse files Browse the repository at this point in the history
  • Loading branch information
crisptrutski committed Oct 25, 2024
1 parent 3b637b7 commit 731f32f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/macaw/types.clj
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,24 @@
[:table {:optional true} :string]
[:column :string]])

(defn- wrapped [t]
(defn- with-context [t]
[:map
[:component t]
[:context :any]])

(def components-result
"A map holding all the components that we were able to parse from a query"
[:map {:closed true}
[:tables [:set (wrapped table-ident)]]
[:columns [:set (wrapped column-ident)]]
[:tables [:set (with-context table-ident)]]
[:columns [:set (with-context column-ident)]]
[:source-columns [:set column-ident]]
;; TODO tighten types
[:tables-superset [:set :any]]
[:has-wildcard? [:set :any]]
[:mutation-commands [:set :any]]
[:table-wildcards [:set :any]]])
;; TODO Unclear why we would want to wrap any of these.
[:table-wildcards [:set (with-context table-ident)]]
;; This :maybe would be a problem, if anything actually used this value.
[:tables-superset [:set (with-context [:maybe table-ident])]]
;; Unclear why we need a collection here
[:has-wildcard? [:set (with-context :boolean)]]
[:mutation-commands [:set (with-context :string)]]])

(def tables-result
"A map holding the tables that we were able to parse from a query"
Expand Down

0 comments on commit 731f32f

Please sign in to comment.