mirror of https://github.com/jackc/pgx.git
Add NewCommandTag
Useful for mocking and testing. https://github.com/jackc/pgx/issues/1273#issuecomment-1224154013v5-dev
parent
fe3a4f3150
commit
bb6c997102
|
@ -667,6 +667,11 @@ type CommandTag struct {
|
|||
s string
|
||||
}
|
||||
|
||||
// NewCommandTag makes a CommandTag from s.
|
||||
func NewCommandTag(s string) CommandTag {
|
||||
return CommandTag{s: s}
|
||||
}
|
||||
|
||||
// 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.
|
||||
func (ct CommandTag) RowsAffected() int64 {
|
||||
|
|
Loading…
Reference in New Issue