-
Notifications
You must be signed in to change notification settings - Fork 114
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
Add instrumentation for sql.Exec
#733
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #733 +/- ##
==========================================
- Coverage 76.04% 69.09% -6.95%
==========================================
Files 105 128 +23
Lines 8527 9746 +1219
==========================================
+ Hits 6484 6734 +250
- Misses 1683 2628 +945
- Partials 360 384 +24
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -39,7 +39,8 @@ func main() { | |||
if len(urlQuery["query"]) > 0 { | |||
queryString := urlQuery["query"][0] | |||
fmt.Println("query arg in url query is:", queryString) | |||
rows, e = db.Query(queryString) | |||
//rows, e = db.Query(queryString) | |||
_, e = db.Exec(queryString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you probably want to check if the query doesn't start with 'SELECT' and run db.Query if it's 'SELECT'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great job!
This PR adds missing instrumentation for
database/sql
package forsql.Exec