MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / execute

Method execute

test/sql/test_functions.py:1326–1327  ·  view source on GitHub ↗
(field)

Source from the content-addressed store, hash-verified

1324 date = datetime.date(2010, 5, 1)
1325
1326 def execute(field):
1327 return connection.execute(select(extract(field, date))).scalar()
1328
1329 assert execute("year") == 2010
1330 assert execute("month") == 5

Calls 3

selectFunction · 0.90
extractFunction · 0.90
scalarMethod · 0.45

Tested by

no test coverage detected