Commit 0674876
committed
improve query cancellation on control-c
* sqlexecute.run() no longer returns a tuple, but a Generator of
SQLResults
* move sqlexecute.connect() within a try block
* clarify inner error as e2
* grammar and spelling in commentary
* if raising a CommandNotFound(), show the command (this can be part
of the relevant backtrace)
Due to the first and second bullet, an interrupted query would indeed be
cancelled, but the user would at minimum receive poor feedback, and
the mycli session could also end.
It might also be desirable to tell click not to handle
KeyboardInterrupt.1 parent 17d63ce commit 0674876
3 files changed
+15
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
1 | 9 | | |
2 | 10 | | |
3 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1212 | 1212 | | |
1213 | 1213 | | |
1214 | 1214 | | |
1215 | | - | |
| 1215 | + | |
1216 | 1216 | | |
1217 | 1217 | | |
1218 | | - | |
1219 | | - | |
1220 | 1218 | | |
1221 | | - | |
1222 | | - | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
1223 | 1222 | | |
1224 | 1223 | | |
1225 | 1224 | | |
| |||
1230 | 1229 | | |
1231 | 1230 | | |
1232 | 1231 | | |
1233 | | - | |
1234 | | - | |
| 1232 | + | |
| 1233 | + | |
1235 | 1234 | | |
1236 | 1235 | | |
1237 | 1236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
0 commit comments