Skip to content

Commit

Permalink
feat: force clientFoundRows to true
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Oct 6, 2023
1 parent 78da4d7 commit a012b2e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sqlcon/parse_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ func FinalizeDSN(l *logrusx.Logger, dsn string) string {
q.Set("multiStatements", "true")
q.Set("parseTime", "true")

// Thius causes an UPDATE to return the number of matching rows instead of
// the number of rows changed. This ensures compatibility with PostgreSQL and SQLite behavior.
q.Set("clientFoundRows", "true")

return fmt.Sprintf("%s?%s", parts[0], q.Encode())
}

Expand Down

0 comments on commit a012b2e

Please sign in to comment.