Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when trying to fetch env with allowed-schemas configuration #17

Open
pozhega opened this issue Sep 9, 2022 · 0 comments
Open
Assignees

Comments

@pozhega
Copy link

pozhega commented Sep 9, 2022

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]

@retro retro self-assigned this Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants