I'm working on a project where a number of components, developed independently, need to be integrated at deployment time to work together. Each component potentially has data persisted using Elixir. Each deployment will consist of a different, essentially arbitrary set of components which need to work together.
Since the components are independently developed (by third parties) there is the possibility of database name clashes (since component developers may have used non-default table naming). Making changes to the source code for these components is not an option. To achieve component interoperability, we need control over the database table naming, to happen at a time later than import time, so that we can define table names unambiguously across components - overriding any table names which may have been specified in the entity sources. We also need to be able to configure the naming for each component in a specific way, i.e. operate on all entities in component A using strategy (or configuration data) specific to A, then on all entities in component B using strategy (or configuration data) specific to B, etc. What's the best way to do this? Would it work to import all the entities in all the components, change the EntityClass._descriptor.tablename, then do a setup_all()? Would this handle relationships correctly? And what's an easy way to distinguish the entities for each component, perhaps to get them into separate collections? By default they would all end up in elixir.entities. I see there's a __collection__ - which ISTM can't be used in our case, as we can't change the component sources - but I couldn't find enough information on it to be sure of this, and it seems little discussed in comparison with __session__ and __metadata__. Is it me or do those seem a bit hackish? (No offence intended.) Thanks in advance for any help, Vinay Sajip P.S. Elixir does a great job, but sometimes it would be nice to get an idea of what's happening behind the scenes, as it happens, on a specific project. In other systems I've turned logging verbosity up to get an idea of what happens when, but Elixir doesn't use logging. Is there any particular reason for this? I'm especially interested, as I'm the author of Python's logging package :-) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "SQLElixir" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sqlelixir?hl=en -~----------~----~----~----~------~----~------~--~---
