if you have thousands of remote databases all with the same schema, you can 
reflect the MetaData once.  If you want to use it across applications, the 
MetaData is pickle able, and you can load it up from a file.

Basically, a traditional caching approach rather than digging a proxy.  you 
cache just at the "reflect metadata" level, rather than at the SQL level.

If you want to dig a proxy in, sure playing with reflection.cache might be the 
way to go, it wasn't necessarily intended for that but would probably work.


On Mar 14, 2013, at 4:23 AM, Hetii <ghet...@gmail.com> wrote:

> Hello :)
> 
> I have some challenge to do.
> As we can see SA for reflecting data use Inspector object. 
> Inspector depends on the dialect call methods like  get_foreign_keys, 
> get_pk_constraint, get_columns etc...
> 
> The idea is to have some proxy dialect class that will be on the top of some 
> dialect.
> 
> This proxy object instead of query database will get information from local 
> database, and when find it then use it instead query remote database.
> 
> In some rare cases when it should also be possible to set for eg. fake 
> foreign_keys to be able build relation.
> 
> You may ask why to do it... So imagine that you have few thousand of remote 
> database to handle and how long the reflection over network could take time.
> Also some of them could be created wrong, casue lazy developers don`t set FK, 
> and the relationship is not set then(rare case).
> 
> Any idea how to do it?
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to