Skip to content
Snippets Groups Projects
Commit c367101f authored by Cam Saül's avatar Cam Saül
Browse files

Merge pull request #356 from metabase/dont_barf

don't barf on fields of wacky types like uuid[]
parents de2261b5 15bc0f36
No related branches found
No related tags found
No related merge requests found
......@@ -107,8 +107,9 @@
:table_id table-id
:name field-name
:base_type (or (*column->base-type* (keyword type-name))
(throw (Exception. (str "Column '" field-name "' has an unknown type: '" type-name
"'. Please add the type mapping to corresponding driver (e.g. metabase.driver.postgres.sync).")))))))
(do (log/warn (str "Column '" field-name "' has an unknown type: '" type-name
"'. Please add the type mapping to corresponding driver (e.g. metabase.driver.postgres.sync)."))
:UnknownField)))))
fields)))
(catch Throwable e
(log/error "Caught exception in sync-fields-create:" e))))
......
......@@ -21,6 +21,9 @@
;; stringify Postgres binary objects (e.g. PostGIS geometries)
(add-encoder org.postgresql.util.PGobject encode-str)
;; Do the same for PG arrays
(add-encoder org.postgresql.jdbc4.Jdbc4Array encode-str)
;; serialize sql dates (i.e., QueryProcessor results) like YYYY-MM-DD instead of as a full-blown timestamp
(add-encoder java.sql.Date (fn [^java.sql.Date date ^com.fasterxml.jackson.core.JsonGenerator json-generator]
(.writeString json-generator (.toString date))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment