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

Method insert_data

test/dialect/mssql/test_query.py:479–508  ·  view source on GitHub ↗
(cls, connection)

Source from the content-addressed store, hash-verified

477
478 @classmethod
479 def insert_data(cls, connection):
480 cattable, matchtable = cls.tables("cattable", "matchtable")
481
482 connection.execute(
483 cattable.insert(),
484 [
485 {"id": 1, "description": "Python"},
486 {"id": 2, "description": "Ruby"},
487 ],
488 )
489 connection.execute(
490 matchtable.insert(),
491 [
492 {
493 "id": 1,
494 "title": "Web Development with Rails",
495 "category_id": 2,
496 },
497 {"id": 2, "title": "Dive Into Python", "category_id": 1},
498 {
499 "id": 3,
500 "title": "Programming Matz's Ruby",
501 "category_id": 2,
502 },
503 {"id": 4, "title": "Guide to Django", "category_id": 1},
504 {"id": 5, "title": "Python in a Nutshell", "category_id": 1},
505 ],
506 )
507 # apparently this is needed! index must run asynchronously
508 connection.execute(DDL("WAITFOR DELAY '00:00:05'"))
509
510 def test_expression(self):
511 matchtable = self.tables.matchtable

Callers

nothing calls this directly

Calls 3

DDLClass · 0.90
executeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected