def test_reflect_remote_synonyms(self): meta = MetaData(testing.db) parent = Table( "ptable", meta, autoload=True, schema=testing.config.test_schema, oracle_resolve_synonyms=True, ) child = Table( "ctable", meta, autoload=True, schema=testing.config.test_schema, oracle_resolve_synonyms=True, ) self.assert_compile( parent.join(child), "%(test_schema)s.ptable JOIN " "%(test_schema)s.ctable " "ON %(test_schema)s.ptable.id = " "%(test_schema)s.ctable.parent_id" % {"test_schema": testing.config.test_schema}, ) select([parent, child]).select_from(parent.join(child)).execute().fetchall()
def test_reflect_alt_owner_implicit(self): meta = MetaData(testing.db) parent = Table("parent", meta, autoload=True, schema=testing.config.test_schema) child = Table("child", meta, autoload=True, schema=testing.config.test_schema) self.assert_compile( parent.join(child), "%(test_schema)s.parent JOIN %(test_schema)s.child " "ON %(test_schema)s.parent.id = " "%(test_schema)s.child.parent_id" % {"test_schema": testing.config.test_schema}, ) select([parent, child]).select_from(parent.join(child)).execute().fetchall()
def test_owner(self): meta = MetaData() parent = Table( "parent", meta, Column("id", Integer, primary_key=True), Column("name", String(50)), schema="ed", ) child = Table( "child", meta, Column("id", Integer, primary_key=True), Column("parent_id", Integer, ForeignKey("ed.parent.id")), schema="ed", ) self.assert_compile( parent.join(child), "ed.parent JOIN ed.child ON ed.parent.id = " "ed.child.parent_id", )