Skip to content

Commit

Permalink
Result: add Query()/Args(), change Sql() string fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
lesismal committed May 30, 2024
1 parent 19f9a40 commit 6f14f14
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion result.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@ func (r *sqlResult) RowsAffected() (int64, error) {
}

func (r *sqlResult) Sql() string {
return fmt.Sprintf(`"%s", %v`, r.query, r.args)
return fmt.Sprintf(`[%s], %v`, r.query, r.args)
}

func (r *sqlResult) Query() string {
return r.query
}

func (r *sqlResult) Args() []interface{} {
return r.args
}

func newResult(r sql.Result, query string, args []interface{}) Result {
Expand Down

0 comments on commit 6f14f14

Please sign in to comment.