9 Feb 19:42
declarative versus classes mapped to multiple engines
Chris Withers <chris <at> simplistix.co.uk>
2012-02-09 18:42:05 GMT
2012-02-09 18:42:05 GMT
Hi Again, I'm wondering if the use case I have is one that is supported... So, the situation is that I have a bunch of classes that I need to map to a bunch of tables, and I'd prefer to do that declaratively. The spicey bit is that I need to connect to several environments a lot of the time and not all of these tables are available in all environments. So, my plan is to have one engine per database I connect to. But what to do about tables? Am I right in thinking that I should have one MetaData object per engine, and that MetaData object should only have the tables in it that are actually present in that database? If so, what's the recommended pattern for doing that? Now, what about declarative? Declarative seems to like each class to have a MetaData object, but how do I tie that in with multiple engines and some tables not being present in some engines? What about the declarative registry? I guess having only one of those is fine since it just maps a string name to a class object, right? cheers, Chris -- --(Continue reading)
(yes, yes I am...)
> you'd need to enhance the usage of prepare() such that the class is not actually mapped, since there is no table.
Yeah, I had this working with the Table call wrapped in a try/except.
> Check this post, read the section "Model Setup":
>
>
RSS Feed