What database server do you use? 2015-01-17 0:49 GMT+01:00 Brian Glogower <bglogo...@ifwe.co>:
> Hi all, > > I am trying to do a join between two tables, each residing on a separate > databases. > > Here is the table info for both. I have removed extraneous columns from > each table. > > Table A from DB 1: > > class Host(Base): > __tablename__ = 'hosts' > __table_args__ = {'mysql_engine': 'InnoDB'} > > id = Column(u'HostID', INTEGER(), primary_key=True) > hostname = Column(String(length=30)) > > Table B from DB 2: > > class ssh_host_keys(Base): > __tablename__ = 'ssh_host_keys' > __table_args__ = {'mysql_engine': 'InnoDB'} > > hostname = Column(VARCHAR(30), primary_key=True) > sha256 = Column(CHAR(64)) > > I would like to use the sqlalchemy orm to do something like the following > query: > > SELECT hostname, sha256 FROM hosts LEFT JOIN ssh_host_keys ON > ssh_host_keys.hostname == hosts.hostname > > I did some searching and did find > https://www.mail-archive.com/sqlalchemy@googlegroups.com/msg14445.html, > but there wasn't enough details for me to get it working (I am a sqlalchemy > novice). > > Is what I want to do even possible with sqlalchemy? > > Thanks, > Brian > > -- > 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. > For more options, visit https://groups.google.com/d/optout. > -- http://www.imagesdusport.com -- http://www.ztfy.org -- 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. For more options, visit https://groups.google.com/d/optout.