File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,3 +35,17 @@ with connect(
3535 results = curr.fetchall()
3636 print (results)
3737```
38+
39+ The ` Cursor ` also supports the context manager protocol, so you can use
40+ it within a ` with ` statement when needed:
41+
42+ ``` python
43+ with connect(... ) as conn:
44+ with conn.cursor() as curr:
45+ curr.execute(... )
46+ results = curr.fetchall()
47+ ```
48+
49+ It also implements the ` close() ` method, as suggested by the PEP-2049
50+ specification, to support situations where the cursor is wrapped in a
51+ ` contextmanager.closing() ` .
Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " wherobots-python-dbapi"
3- version = " 0.3.1 "
3+ version = " 0.4.0 "
44description = " Python DB-API driver for Wherobots DB"
55authors = [" Maxime Petazzoni <max@wherobots.com>" ]
66license = " Apache 2.0"
You can’t perform that action at this time.
0 commit comments