diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-04-22 17:18:16 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-04-22 17:18:16 -0400 |
commit | 7bfeb1b14b9a6560be15093c93a5e084e8735b62 (patch) | |
tree | fc72dbd9af20e3a5dbd4a0aaa1935299dc57c154 | |
parent | d62de424ef738a0cfb9c682d9b25a8644dff5985 (diff) | |
download | sqlalchemy-7bfeb1b14b9a6560be15093c93a5e084e8735b62.tar.gz |
repair large_resultsets
this is ahead of https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/4581/
Change-Id: If8a36e457bdb62ddca04e39bb4c1288d4fa53c20
-rw-r--r-- | examples/performance/large_resultsets.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/examples/performance/large_resultsets.py b/examples/performance/large_resultsets.py index ac1b98b6f..9c0d9fc4e 100644 --- a/examples/performance/large_resultsets.py +++ b/examples/performance/large_resultsets.py @@ -108,6 +108,20 @@ def test_core_fetchall(n): with engine.connect() as conn: result = conn.execute(Customer.__table__.select().limit(n)).fetchall() for row in result: + row.id, row.name, row.description + + +@Profiler.profile +def test_core_fetchall_mapping(n): + """Load Core result rows using fetchall.""" + + with engine.connect() as conn: + result = ( + conn.execute(Customer.__table__.select().limit(n)) + .mappings() + .fetchall() + ) + for row in result: row["id"], row["name"], row["description"] @@ -124,7 +138,7 @@ def test_core_fetchmany_w_streaming(n): if not chunk: break for row in chunk: - row["id"], row["name"], row["description"] + row.id, row.name, row.description @Profiler.profile @@ -138,7 +152,7 @@ def test_core_fetchmany(n): if not chunk: break for row in chunk: - row["id"], row["name"], row["description"] + row.id, row.name, row.description @Profiler.profile |