I have a model that I would like to partition across multiple database tables. All the data and functionality will be the same so I would like to use the same module/ecto.model but just have the table it is saved into differ. Further, I won't know until runtime what the table name will be.
Can anyone suggest a way to dynamically set the table name that model saves to and retrieves from?
Cheers,
Adam
post = Repo.get!(Post, 1)Ecto.put_meta post, source: "new_table", state: :builtRepo.insert!(post)
--
You received this message because you are subscribed to the Google Groups "elixir-ecto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-ecto+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-ecto/a8e3af8f-0091-41a9-9ce2-de9298ce3bda%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to a topic in the Google Groups "elixir-ecto" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elixir-ecto/6Tzn7C58ECg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elixir-ecto...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-ecto/CAGnRm4KJNvdek01RP3cc6C_VtjKtOEjbQFpkSenbMOfku1AYzA%40mail.gmail.com.