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

Streams: EctoMnesia does not support Ecto streams, and the custom EctoMnesia.Table.Stream uses records rather than structs #71

Open
Qqwy opened this issue Sep 13, 2018 · 0 comments

Comments

@Qqwy
Copy link
Contributor

Qqwy commented Sep 13, 2018

I wanted to use MyApp.Repo.stream to upgrade some rows in my tables to a format with new constraints (in this case: Giving all of them a UUID, since all newly-inserted models will have this UUID).

So MyApp.Repo.stream will raise an error, stating that EctoMnesia.Table.Stream.new should be used instead.

However:

  1. This does not support queries, but only low-level table names.
  2. This gives results in record-format, rather than as schema structs. AFAIK, there is no way that EctoMnesia exposes turning records to schema structs. I ended up performing an additional MyRepo.get!(NameOfModel, elem(record, 1)), but this is obviously a non-performant and hackish 'solution'.
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

1 participant