Last active
January 10, 2021 18:53
-
-
Save narenaryan/702771c2083698b0ee5bdf01be25081c to your computer and use it in GitHub Desktop.
cursor-illu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def main(): | |
| sql_query = 'SELECT * FROM film' | |
| with connect(**config) as conn: | |
| with conn.cursor("film") as cur: | |
| # This fetches only 200 records from DB as batches | |
| # If you don't specify, the default value is 2000 | |
| cur.itersize = 200 | |
| cur.execute(sql_query) | |
| for row in cur: | |
| print(row) # Use row |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment