-
Notifications
You must be signed in to change notification settings - Fork 557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transactions #410
Comments
Interesting request. But I'm still unclear when pgcli would commit. For example: When a user launches pgcli we start a transaction, then they explore using select, change data using insert or update or drop, then explore some more using select. In this workflow where does the commit happen? Do we keep all these commands in a transaction until they quit pgcli or type in COMMIT/ROLLBACK themselves? @darikg I was thinking your latest changes to add the extra field for denoting success/failure of a query can be used to achieve the undo feature. |
I would only commit explicitly, i.e. by issuing a |
I think this would be very useful as a mode that can be enabled/disabled with its status shownin the bottom bar like smart completion and multiline mode. When autocommit mode is ON its behaviour would be the standard one when no transaction is explicly started and when it is OFF, a commit is explicitly needed. Improving autocommit off mode with an automatic start of a new transaction (ROLLBACK+BEGIN) when an errors fail as @ThiefMaster purpose would be great. |
This sounds like a nice feature to have. I like the idea of autocommit mode being displayed in the bottom status bar. We could also add a little indicator (like a red |
I would love to see this feature coming to pgcli, I'm currently dealing with |
Do note that there are PostgreSQL operations that can't be run inside a transaction (VACUUM comes to mind). This feature should be off by default. |
This should be possible to enable. Or, more specifically, the optional behaviour should/must match that of
And it should be possible to configure this as the default operation somehow. The |
It would be really nice to at least have the equivalent of psql's |
Huge +1 that |
\set AUTOCOMMIT off |
It would be nice if pgcli had some fancy handling for transactions. Things I could imagine:
When always having a transaction an automated ROLLBACK+BEGIN in case of an SQL error would be useful - that's actually one of the things I miss most in psql. Sometimes I want to try things and having to rollback+begin after a typo etc it somewhat annoying.
An undo feature could also be useful. Basically it'd ROLLBACK+BEGIN and then execute all statements since the start of the transaction besides that last one / last n ones again.
The text was updated successfully, but these errors were encountered: