[sqlalchemy] copy tables from one database to another

2006-11-02 Thread Michele Simionato
This is probably a common question, but I didn't find it answered, so I will ask here: I want to copy a set of tables (I have the names of the tables) from a database (MS-SQL) to another (SQLite). What's the recommended way to do it? Notice that these are simple tables, with no advanced

[sqlalchemy] Re: copy tables from one database to another

2006-11-02 Thread Michael Bayer
look into using tometadata() to copy a Table from one MetaData to another. then use create_all() on the second MetaData. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group,

[sqlalchemy] Multilpe Table inheritance and relations

2006-11-02 Thread asrenzo
Hi, Following the documentation about inheritance (Multiple Table Inheritance, Polymorphic), I get into troubles trying to add a relation between tables. I just used the documentation sample and modified the engineers table this way : engineers = Table('engineers', metadata,

[sqlalchemy] Re: Multilpe Table inheritance and relations

2006-11-02 Thread Michael Bayer
have you tried mapper(Engineer, engineers, inherits=person_mapper, polymorphic_identity='engineer', properties={ 'manager': relation(Manager, primaryjoin=engineers.c.manager_id==managers.c.person_id) }) ? On Nov 2, 2006, at 12:52 PM, asrenzo wrote: Hi, Following the

[sqlalchemy] Re: Multilpe Table inheritance and relations

2006-11-02 Thread asrenzo
Hi, THX a lot this is working like a charm. This is a much more complex mapper than the ones I'm used to do. Regards, Laurent --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this

[sqlalchemy] New Plugin - AssociationProxy

2006-11-02 Thread Michael Bayer
based on my conversations with Karl Guertin yesterday, i turned the association proxy into a full blown plugin for SQLAlchemy, and also added two association examples to the examples/ folder, one which is basic and the other which illustrates the proxy. The proxy (will be released in 0.3.1) is

[sqlalchemy] single table inheritance questions

2006-11-02 Thread Randall Smith
Is there a way to inherit more than one level for single table inheritance? Take this relationship for example: Animal - Dog - German Shepard Say there are 10 animals; 5 are dogs and 2 are German Shepard. session.query(Animal).select() # Should yield 10 results.