... user_table.c.name,
... address_table.c.email_address
... ).select_from(user_table).join(address_table)
- >>> with engine.connect() as conn:
+ >>> with engine.connect() as conn: # doctest:+SKIP
... result = conn.execute(stmt)
... print(result.all())
{opensql}BEGIN (implicit)
... func.count().over(order_by=user_table.c.name),
... user_table.c.name,
... address_table.c.email_address).select_from(user_table).join(address_table)
- >>> with engine.connect() as conn:
+ >>> with engine.connect() as conn: # doctest:+SKIP
... result = conn.execute(stmt)
... print(result.all())
{opensql}BEGIN (implicit)
... func.count(address_table.c.email_address).filter(user_table.c.name == 'sandy'),
... func.count(address_table.c.email_address).filter(user_table.c.name == 'spongebob')
... ).select_from(user_table).join(address_table)
- >>> with engine.connect() as conn:
+ >>> with engine.connect() as conn: # doctest:+SKIP
... result = conn.execute(stmt)
... print(result.all())
{opensql}BEGIN (implicit)
>>> onetwothree = func.json_each('["one", "two", "three"]').table_valued("value")
>>> stmt = select(onetwothree).where(onetwothree.c.value.in_(["two", "three"]))
- >>> with engine.connect() as conn:
+ >>> with engine.connect() as conn: # doctest:+SKIP
... result = conn.execute(stmt)
... print(result.all())
{opensql}BEGIN (implicit)
"t",
self.metadata,
Column("id", Integer, primary_key=True),
- Column("x", DateTime(), server_default=func.now()),
+ Column("x", String(), server_default=func.lower("UPPERCASE")),
)
t.create(testing.db)
with testing.db.begin() as conn:
- now = conn.scalar(func.now())
- today = datetime.datetime.today()
conn.execute(t.insert())
- conn.execute(t.insert().values(x=today))
+ conn.execute(t.insert().values(x="foobar"))
eq_(
conn.execute(select(t.c.x).order_by(t.c.id)).fetchall(),
- [(now,), (today,)],
+ [("uppercase",), ("foobar",)],
)
@testing.provide_metadata