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

sqlize-value does not SQLize Dates, Instants, etc. correctly #419

Closed
robhanlon22 opened this issue Aug 5, 2022 · 1 comment
Closed

sqlize-value does not SQLize Dates, Instants, etc. correctly #419

robhanlon22 opened this issue Aug 5, 2022 · 1 comment
Assignees

Comments

@robhanlon22
Copy link
Contributor

robhanlon22 commented Aug 5, 2022

Since sqlize-value falls back to str when the type is not specially handled, some things that need to be quoted aren't:

(format (-> (select :*) 
            (from :foo) 
            (where [:= :t (java.time.Instant/parse "2020-04-03T00:00:00.00Z")])) 
        {:inline true})

;; => ["SELECT * FROM foo WHERE t = 2020-04-03T00:00:00Z"]

I see that there's a special case for java.util.UUIDs but it does seem like adding special cases could quickly get unwieldy. Would it be excessive to introduce a protocol that allows for extension of sqlize-value? Otherwise adding fixes will quickly become a game of Whac-A-Mole 😆

@seancorfield
Copy link
Owner

Yeah, at this point it probably makes sense to turn that into an extension point.

@seancorfield seancorfield self-assigned this Aug 5, 2022
seancorfield added a commit that referenced this issue Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants