github.com/qustavo/sqlhooks/v2
This example shows how to instrument sql queries in order to display the time that they consume package main import ( ) // Hooks satisfies the sqlhook.Hooks interface type Hooks struct {} // Before hook will print the query with it's args and return the context with the timestamp // After hook will get the timestamp registered on the Before hook and print the elapsed time /* Output should look like: > CREATE TABLE t (id INTEGER, text VARCHAR(16)) []. took: 121.238µs > INSERT into t (text) VALUES(?), (?) ["foo" "bar"]. took: 36.364µs > SELECT id, text FROM t []. took: 4.653µs */
Ecosystem
proxy.golang.org
proxy.golang.org
Latest Release
over 4 years ago
v2.1.0
over 4 years ago
Versions
3
3
Dependent Packages
33
33
Dependent Repos
51
51
Loading...
Readme
Loading...
Links
| Registry | proxy.golang.org |
| Source | Repository |
| Docs | Documentation |
| JSON API | View JSON |
| CodeMeta | codemeta.json |
Package Details
| PURL |
pkg:golang/github.com/qustavo/sqlhooks/v2
spec |
| License | MIT |
| Namespace | github.com/qustavo/sqlhooks |
| First Release | over 3 years ago |
| Last Synced | about 13 hours ago |
Repository
| Stars | 658 on GitHub |
| Forks | 44 on GitHub |
| Docker Dependents | 14 |
| Docker Downloads | 31,141,164 |
| Commits | 108 |
| Committers | 11 |
| Avg per Author | 9.818 |
| DDS | 0.259 |
Rankings on proxy.golang.org
Overall
Top 1.6%
Dependent packages
Top 0.8%
Dependent repos
Top 0.8%
Forks
Top 3.8%
Docker downloads
Top 0.3%