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

Support Composite types in Postgres #89

Open
gjaldon opened this issue Aug 29, 2019 · 1 comment
Open

Support Composite types in Postgres #89

gjaldon opened this issue Aug 29, 2019 · 1 comment

Comments

@gjaldon
Copy link
Owner

gjaldon commented Aug 29, 2019

It would be nice to be able to express in Ecto a datatype like:

:unused | {:next, id} | :finished
@Eiji7
Copy link

Eiji7 commented Oct 25, 2019

How it's going to work? If I remember correctly composite types have fixed number of attributes, right?

Did you mean: {:unused, nil} | {:next, id} | {:finished, nil}? If so then I believe that it should not be implemented in such library. In same way you would require all ecto types have such support which does not makes sense especially if we are talking about complex combinations.

The better way is to create your own ecto type instead. Remember that you can reuse existing ecto callback implementations when defining your own cast, dump and load functions.

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