Skip to content

Commit 4f5c316

Browse files
committed
Use fetchall() method as INSERT example in README
fetchone() may not throw an exception correctly. #95
1 parent b4b7f54 commit 4f5c316

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ with trino.dbapi.connect(
9494
) as conn:
9595
cur = conn.cursor()
9696
cur.execute('INSERT INTO sometable VALUES (1, 2, 3)')
97-
cur.fetchone()
97+
cur.fetchall()
9898
cur.execute('INSERT INTO sometable VALUES (4, 5, 6)')
99-
cur.fetchone()
99+
cur.fetchall()
100100
```
101101

102102
The transaction is created when the first SQL statement is executed.

0 commit comments

Comments
 (0)