MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / insert_data

Method insert_data

test/orm/test_merge.py:1895–1910  ·  view source on GitHub ↗
(cls, connection)

Source from the content-addressed store, hash-verified

1893
1894 @classmethod
1895 def insert_data(cls, connection):
1896 User, Address = cls.classes.User, cls.classes.Address
1897 s = Session(connection)
1898 s.add_all(
1899 [
1900 User(
1901 id=1,
1902 name="u1",
1903 addresses=[
1904 Address(id=1, email="a1"),
1905 Address(id=2, email="a2"),
1906 ],
1907 )
1908 ]
1909 )
1910 s.commit()
1911
1912 # "persistent" - we get at an Address that was already present.
1913 # With the "skip bidirectional" check removed, the "set" emits SQL

Callers

nothing calls this directly

Calls 5

add_allMethod · 0.95
commitMethod · 0.95
SessionClass · 0.90
UserClass · 0.70
AddressClass · 0.70

Tested by

no test coverage detected