-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Support compound_fields custom ecto type #517
Comments
I think you'll want to use the |
this is because |
or maybe we can simply add |
Having I think what you really want here is to apply an It might be possible to allow compound fields for other Ecto types than
I'm not quite convinced that this is a good idea, though. This would increase the complexity of compound fields and might easily lead to behaviour that is unexpected for library users. In your example, you are applying a |
@woylie actually im not applying yes essentially i want to do :== operator on the compound fields so what im proposing is this :or operator will use :== op there is just some field that cannot accept the reason why we cannot use the custom fields is because this is the simplified version of what the query is like
perhaps there is an easier way to do this without using compound field, we would definitely be glad to explore |
currently compound_fields automatically hardcode type to :string
but in the case of compound_fields of 2 uuid fields, performing filter to this compound_field will fail
e.g.
with op
like_or
will generateuuid1 like $1 OR uuid2 like $1
this will fail because uuid operation with
like
throw error at postgrese.g:
select * from my_table where id like '<uuid value>';
is it possible to defined the ecto_type on compound_fields so on building the like_or operation it will generate
uuid1 = $1 OR uuid2 = $2
The text was updated successfully, but these errors were encountered: