sqlalchemy.Integer._type_affinity - python examples

Here are the examples of the python api sqlalchemy.Integer._type_affinity taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

3 View Complete Implementation : test_text.py
Copyright MIT License
Author : sqlalchemy
    def test_scalar_subquery(self):
        t = text("select id from user").columns(id=Integer)
        subq = t.scalar_subquery()

        astert subq.type._type_affinity is Integer()._type_affinity

        s = select([table1.c.myid, subq]).where(table1.c.myid == subq)
        self.astert_compile(
            s,
            "SELECT mytable.myid, (select id from user) AS anon_1 "
            "FROM mytable WHERE mytable.myid = (select id from user)",
        )