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

Method insert_data

test/orm/test_lazy_relations.py:1343–1364  ·  view source on GitHub ↗
(cls, connection)

Source from the content-addressed store, hash-verified

1341
1342 @classmethod
1343 def insert_data(cls, connection):
1344 stuff, user_t = cls.tables.stuff, cls.tables.user_t
1345
1346 connection.execute(
1347 user_t.insert(),
1348 [
1349 {"id": 1, "name": "user1"},
1350 {"id": 2, "name": "user2"},
1351 {"id": 3, "name": "user3"},
1352 ],
1353 )
1354
1355 connection.execute(
1356 stuff.insert(),
1357 [
1358 {"id": 1, "user_id": 1, "date": datetime.date(2007, 10, 15)},
1359 {"id": 2, "user_id": 1, "date": datetime.date(2007, 12, 15)},
1360 {"id": 3, "user_id": 1, "date": datetime.date(2007, 11, 15)},
1361 {"id": 4, "user_id": 2, "date": datetime.date(2008, 1, 15)},
1362 {"id": 5, "user_id": 3, "date": datetime.date(2007, 6, 15)},
1363 ],
1364 )
1365
1366 def test_correlated_lazyload(self):
1367 stuff, user_t = self.tables.stuff, self.tables.user_t

Callers

nothing calls this directly

Calls 3

executeMethod · 0.45
insertMethod · 0.45
dateMethod · 0.45

Tested by

no test coverage detected