portal

sheluchin 2024-09-09T15:47:15.111039Z

I have this function that spits out a table, but the metadata doesn't seem to be helping Portal render it using the table viewer. Why?

(>defn describe-table
  "PostgreSQL specific."
  [env table-name]
  [::env keyword? => any?]
  ^{:portal.viewer/default :portal.viewer/table}
  (execute! env
    (-> (hh/select :column_name :data_type :is_nullable)
        (hh/from :information_schema.columns)
        (hh/where [:= :table-name (csk/->snake_case_string table-name)]))))

djblue 2024-09-09T16:32:41.502749Z

I think you want with-meta here

sheluchin 2024-09-09T16:34:10.320269Z

@djblue that does it. Thanks!