Skip to content

Commit

Permalink
Use fetchall() method as INSERT example in README
Browse files Browse the repository at this point in the history
fetchone() may not throw an exception correctly.
trinodb#95
  • Loading branch information
ebyhr committed Aug 17, 2021
1 parent b4b7f54 commit 4f5c316
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ with trino.dbapi.connect(
) as conn:
cur = conn.cursor()
cur.execute('INSERT INTO sometable VALUES (1, 2, 3)')
cur.fetchone()
cur.fetchall()
cur.execute('INSERT INTO sometable VALUES (4, 5, 6)')
cur.fetchone()
cur.fetchall()
```

The transaction is created when the first SQL statement is executed.
Expand Down

0 comments on commit 4f5c316

Please sign in to comment.