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

Select queries do not work with custom types #88

Closed
marksto opened this issue Dec 20, 2021 · 1 comment · Fixed by #89
Closed

Select queries do not work with custom types #88

marksto opened this issue Dec 20, 2021 · 1 comment · Fixed by #89

Comments

@marksto
Copy link
Contributor

marksto commented Dec 20, 2021

Hi @camsaul! A regression issue was introduced with the latest library version upgrade, I guess. (Or probably I didn't notice this one before.) Select queries simply do not work with custom types, e.g. native PostgreSQL ENUM type. There is an exception that happens during the where+ clause construction.

class java.lang.ClassCastException - class clojure.lang.PersistentVector cannot be cast to class clojure.lang.Named (clojure.lang.PersistentVector and clojure.lang.Named are in unnamed module of loader 'app')
           toucan.test_models.pg_enum$kwd__GT_pg_enum$invokeStatic (pg_enum.clj:17)
           on (pg_enum.clj:15)
           toucan.models$do_type_fn$invokeStatic (models.clj:358)
           on (models.clj:354)
           toucan.db$where_PLUS_$invokeStatic (db.clj:463)
           on (db.clj:453)
           toucan.db$select_one$invokeStatic (db.clj:628)
...

So the fact is the current where+ fn implementation doesn't cater for the things like [:= <custom_type_value>].

Will provide you with a fix soon. Had to develop one during the weekend.

Cheers!

@marksto marksto changed the title Select queries do not work with with custom types Select queries do not work with custom types Dec 22, 2021
@camsaul
Copy link
Member

camsaul commented Jan 21, 2022

Fixed by #89

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

Successfully merging a pull request may close this issue.

2 participants