Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor.execute returns a pyodbc.Cursor instead of itself #114

Closed
peterdotran opened this issue Jun 21, 2017 · 2 comments
Closed

Cursor.execute returns a pyodbc.Cursor instead of itself #114

peterdotran opened this issue Jun 21, 2017 · 2 comments

Comments

@peterdotran
Copy link
Contributor

Python 3.6
aioodbc 0.1.0
Windows
SQLite

The following just can't work

async def example():
    async aioodbc.connect(...) as conn, conn.cursor() as cursor:
        async for row in await cursor.execute("SELECT * FROM some_table"):
            print(row)

Currently for it to work I have to use two lines

async def example():
    async aioodbc.connect(...) as conn, conn.cursor() as cursor:
        cursor.execute("SELECT * FROM some_table")
        async for row in await cursor:
            print(row)

or not use async for loop but that defeats the purpose of async.

@jettify
Copy link
Member

jettify commented Jun 24, 2017

good catch fixed!

@jettify
Copy link
Member

jettify commented Jun 24, 2017

new version released https://pypi.python.org/pypi/aioodbc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants