retro/penkala

Error when trying to fetch env with allowed-schemas configuration

Opened this issue · 0 comments

Case

When I try to get penkala with :schemas/allowed-schemas key in configuration, it errors:

org.postgresql.util.PSQLException: Can't infer the SQL type to use for an instance of clojure.lang.PersistentHashSet. Use setObject() with an explicit Types value to specify the type to use.
     SQLState: "07006"
    errorCode: 0

when using hash sets, and it errors:

org.postgresql.util.PSQLException: ERROR: invalid input syntax for type json
                                     Detail: The input string ended unexpectedly.
                                     Position: 3946
                                     Where: JSON data, line 1:
              SQLState: "22P02"
             errorCode: 0
    serverErrorMessage: #object[org.postgresql.util.ServerErrorMessage 0x70d1f81d "ERROR: invalid input syntax for type json\n  Detail: The input string ended unexpectedly.\n  Position: 3946\n  Where: JSON data, line 1: "]

when using vectors.

Code example

#_(def ^:private allowed-schemas #{"public" "tenant"})
(def ^:private allowed-schemas ["public" "tenant"])

(defn create-env [datasource allowed-schemas]
  (-> datasource
      (get-env {:schemas/allowed allowed-schemas})
      (assoc ::error-formatters {})))

Datasource

Confirmation that I handle healthy datasource:#object[next.jdbc.connection$url_PLUS_etc$reify__35288 0x428e550e jdbc:postgresql://localhost:5434/cross_collab_dev]