MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / go

Method go

test/sql/test_defaults.py:960–998  ·  view source on GitHub ↗
(implicit_returning)

Source from the content-addressed store, hash-verified

958 @testing.fixture
959 def table_fixture(self, metadata, connection):
960 def go(implicit_returning):
961 t2 = Table(
962 "t2",
963 metadata,
964 Column("nextid", Integer),
965 implicit_returning=implicit_returning,
966 )
967
968 t1 = Table(
969 "t1",
970 metadata,
971 Column(
972 "id",
973 Integer,
974 primary_key=True,
975 default=sa.select(func.max(t2.c.nextid)).scalar_subquery(),
976 ),
977 Column("data", String(30)),
978 implicit_returning=implicit_returning,
979 )
980
981 date_table = Table(
982 "date_table",
983 metadata,
984 Column(
985 "date_id",
986 # we want no tzinfo normally since pymssql doesn't do
987 # it right now
988 DateTime().with_variant(
989 DateTime(timezone=True), "postgresql"
990 ),
991 default=text("current_timestamp"),
992 primary_key=True,
993 ),
994 implicit_returning=implicit_returning,
995 )
996
997 metadata.create_all(connection)
998 return t1, t2, date_table
999
1000 return go
1001

Callers

nothing calls this directly

Calls 10

TableClass · 0.90
ColumnClass · 0.90
StringClass · 0.90
DateTimeClass · 0.90
textFunction · 0.90
maxMethod · 0.80
with_variantMethod · 0.80
create_allMethod · 0.80
scalar_subqueryMethod · 0.45
selectMethod · 0.45

Tested by

no test coverage detected