File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -166,18 +166,17 @@ won't be prefetching any rows):
166166 # Postgres requires non-scrollable cursors to be created
167167 # and used in a transaction.
168168
169- async with con.transaction():
170- # Create a Cursor object
171- cur = await con.cursor(' SELECT generate_series(0, 100)' )
169+ # Create a Cursor object
170+ cur = await con.cursor(' SELECT generate_series(0, 100)' )
172171
173- # Move the cursor 10 rows forward
174- await cur.forward(10 )
172+ # Move the cursor 10 rows forward
173+ await cur.forward(10 )
175174
176- # Fetch one row and print it
177- print (await cur.fetchrow())
175+ # Fetch one row and print it
176+ print (await cur.fetchrow())
178177
179- # Fetch a list of 5 rows and print it
180- print (await cur.fetch(5 ))
178+ # Fetch a list of 5 rows and print it
179+ print (await cur.fetch(5 ))
181180
182181 It's also possible to create cursors from prepared statements:
183182
You can’t perform that action at this time.
0 commit comments