from sqlalchemy import Table
from sqlalchemy import testing
from sqlalchemy import text
-from sqlalchemy import try_cast
from sqlalchemy import union
from sqlalchemy import UniqueConstraint
from sqlalchemy import update
"CREATE INDEX foo ON test (x) INCLUDE (y) WHERE y > 1",
)
- def test_try_cast(self):
- metadata = MetaData()
- t1 = Table("t1", metadata, Column("id", Integer, primary_key=True))
-
- self.assert_compile(
- select(try_cast(t1.c.id, Integer)),
- "SELECT TRY_CAST (t1.id AS INTEGER) AS id FROM t1",
- )
-
@testing.combinations(
("no_persisted", "", "ignore"),
("persisted_none", "", None),
from sqlalchemy import testing
from sqlalchemy import Text
from sqlalchemy import text
+from sqlalchemy import try_cast
from sqlalchemy import TIMESTAMP
from sqlalchemy import true
from sqlalchemy import tuple_
"ALTER TABLE testtbl ADD EXCLUDE USING gist " "(room WITH =)",
)
+ def test_try_cast(self):
+ metadata = MetaData()
+ t1 = Table("t1", metadata, Column("id", Integer, primary_key=True))
+
+ self.assert_compile(
+ select(try_cast(t1.c.id, Integer)),
+ "SELECT TRY_CAST (t1.id AS INTEGER) AS id FROM t1",
+ )
+
class KwargPropagationTest(fixtures.TestBase):
@classmethod