specql icon indicating copy to clipboard operation
specql copied to clipboard

WIP: Adds new distinct option to :options

Open mattiuusitalo opened this issue 1 year ago • 0 comments

Adds option for doing SELECT DISTINCT and SELECT DISTINCT ON in fetch, see #45 for more details.

Here's the initial implementation idea. I'm a little bit hesitant because of the stuff in all-cols, which is like this in the test.

{:par2
 ["wit1.\"parent_id\""
  [:with-possible-duplicates/parent_id] ;; <- column key is inside a vector, why?
  {:category "N",
   :not-null? false,
   :has-default? false,
   :primary-key? false,
   :number 1,
   :name "parent_id",
   :type "int4",
   :enum? false,
   :type-specific-data -1}],
 :tag3
 ["wit1.\"tag\""
  [:with-possible-duplicates/tag]
  {:category "S",
   :not-null? false,
   :has-default? false,
   :primary-key? false,
   :number 2,
   :name "tag",
   :type "text",
   :enum? false,
   :type-specific-data -1}]}

Can I assume the column name will always be first element in that vector? Or should I translate the column list to look like :par2, :par3 instead of the column keys?

mattiuusitalo avatar Mar 10 '23 09:03 mattiuusitalo