-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
sql: propagate the number of rows updated / inserted to the command-line client #3993
Comments
Useful to report success/failure of CAS operations in #4036 |
So I was looking into this and again the DB interface is not helping.
But this requires rather pervasive changes in the Go driver and db interface. What is wise to do here?
|
I thought returning the number of rows as the result is what @dt was working on? And I thought that's standard behavior? What does postgres return for INSERT and UPDATE? |
The trouble is that the go sql interface has a strict separation between Query (which returns rows) and Exec (which returns a count of rows affected). We need to either use a lower-level interface (i.e. use lib/pq directly without going through database/sql) that does not force us into this distinction or parse the statements on the client side so that we can send statements with results via Query and statements without results via Exec. |
Tomorrow (or early next week) I'm going to take a look at what going directly through |
( While looking at #4036 ) |
The client should report the number of rows altered with insert/update. This applies both to the interactive client and "-e".
The text was updated successfully, but these errors were encountered: