MCPcopy
hub / github.com/jackc/pgx / RowsAffected

Method RowsAffected

pgconn/pgconn.go:862–878  ·  view source on GitHub ↗

RowsAffected returns the number of rows affected. If the CommandTag was not for a row affecting command (e.g. "CREATE TABLE") then it returns 0.

()

Source from the content-addressed store, hash-verified

860// RowsAffected returns the number of rows affected. If the CommandTag was not
861// for a row affecting command (e.g. "CREATE TABLE") then it returns 0.
862func (ct CommandTag) RowsAffected() int64 {
863 // Parse the number from the end in a single pass.
864 var n int64
865 var mult int64 = 1
866
867 for i := len(ct.s) - 1; i >= 0; i-- {
868 c := ct.s[i]
869 if c >= '0' && c <= '9' {
870 n += int64(c-'0') * mult
871 mult *= 10
872 } else {
873 break
874 }
875 }
876
877 return n
878}
879
880func (ct CommandTag) String() string {
881 return ct.s

Callers 15

TestConnSendBatchFunction · 0.80
TestConnSendBatchManyFunction · 0.80
TestTxSendBatchFunction · 0.80
TestForEachRowFunction · 0.80
runMethod · 0.80
TraceCopyFromEndMethod · 0.80
ExecContextMethod · 0.80

Calls

no outgoing calls

Tested by 15

TestConnSendBatchFunction · 0.64
TestConnSendBatchManyFunction · 0.64
TestTxSendBatchFunction · 0.64
TestForEachRowFunction · 0.64
TestStmtExecFunction · 0.64
TestConnExecFunction · 0.64
TestConnCopyToSmallFunction · 0.64