github.com/gchaincl/sqlhooks
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 6 years ago
v1.3.0
over 6 years ago
Versions
4
4
Dependent Packages
46
46
Dependent Repos
283
283
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/gchaincl/sqlhooks
spec |
| License | MIT |
| Namespace | github.com/gchaincl |
| First Release | almost 9 years ago |
| Last Synced | about 19 hours ago |
Repository
| Stars | 602 on GitHub |
| Forks | 42 on GitHub |
| Docker Dependents | 301 |
| Docker Downloads | 4,952,912,952 |
Rankings on proxy.golang.org
Overall
Top 1.5%
Dependent packages
Top 0.7%
Dependent repos
Top 0.4%
Forks
Top 3.7%
Docker downloads
Top 0.1%