当前位置: 首页>>代码示例>>Python>>正文


Python Table.join方法代码示例

本文整理汇总了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()
开发者ID:BY-jk,项目名称:sqlalchemy,代码行数:29,代码来源:test_reflection.py

示例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()
开发者ID:gencer,项目名称:sqlalchemy,代码行数:18,代码来源:test_reflection.py

示例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()
开发者ID:BY-jk,项目名称:sqlalchemy,代码行数:20,代码来源:test_reflection.py

示例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')
开发者ID:cpcloud,项目名称:sqlalchemy,代码行数:13,代码来源:test_compiler.py

示例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",
     )
开发者ID:BY-jk,项目名称:sqlalchemy,代码行数:22,代码来源:test_compiler.py


注:本文中的sqlalchemy.testing.schema.Table.join方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。