本文整理汇总了Python中sqlalchemy.testing.schema.Table.join方法的典型用法代码示例。如果您正苦于以下问题:Python Table.join方法的具体用法?Python Table.join怎么用?Python Table.join使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sqlalchemy.testing.schema.Table
的用法示例。
在下文中一共展示了Table.join方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_reflect_remote_synonyms
# 需要导入模块: from sqlalchemy.testing.schema import Table [as 别名]
# 或者: from sqlalchemy.testing.schema.Table import join [as 别名]
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()
示例2: test_reflect_alt_owner_implicit
# 需要导入模块: from sqlalchemy.testing.schema import Table [as 别名]
# 或者: from sqlalchemy.testing.schema.Table import join [as 别名]
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()
示例3: test_reflect_alt_owner_explicit
# 需要导入模块: from sqlalchemy.testing.schema import Table [as 别名]
# 或者: from sqlalchemy.testing.schema.Table import join [as 别名]
def test_reflect_alt_owner_explicit(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()
示例4: test_owner
# 需要导入模块: from sqlalchemy.testing.schema import Table [as 别名]
# 或者: from sqlalchemy.testing.schema.Table import join [as 别名]
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')
示例5: test_owner
# 需要导入模块: from sqlalchemy.testing.schema import Table [as 别名]
# 或者: from sqlalchemy.testing.schema.Table import join [as 别名]
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",
)