question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cursors are not supported(?) with the pool.transaction() interface

See original GitHub issue

I have declared a connection pool and tried to call cursor like so:

pool = asyncpgsa.create_pool()
async with pool.transaction() as t:
  async with t.query("SELECT * FROM whatever") as cursor:
    # ...

The query() method is currently missing. It might be a documentation problem though.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nhumrichcommented, Feb 9, 2018
async with pool.transaction() as t:
    async with t.cursor("SELECT  ...") as cursor:
        ...

https://github.com/CanopyTax/asyncpgsa/blob/master/asyncpgsa/connection.py#L110

0reactions
thedrowcommented, Feb 13, 2018

I’ll do so shortly 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when using r2dbc-pool: this publisher does not support ...
I suspect something is wrong with how Oracle R2DBC uses java.sql.Statement.closeOnCompletion() to trigger the cursor close; Perhaps Oracle JDBC ...
Read more >
14 Tuning the Shared Pool and the Large Pool
Java, PL/SQL, or SQL cursors may sometimes make allocations out of the shared pool that are larger than 5 KB. To enable these...
Read more >
Cursor classes - psycopg 3.1.8.dev1 documentation
This class implements a DBAPI-compliant interface. It is what the classic Connection.cursor() method returns. AsyncConnection.cursor() will create instead ...
Read more >
Working with Engines and Connections — SQLAlchemy 2.0 ...
The Connection object always emits SQL statements within the context of a transaction block. The first time the Connection.execute() method is called to...
Read more >
Working with Engines and Connections
The typical usage of create_engine() is once per particular database URL, ... a DBAPI cursor and provides a largely compatible interface with that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found