proxy.golang.org : github.com/keegancsmith/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 */
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/keegancsmith/sqlhooks
License: MIT
Latest release: about 8 years ago
First release: about 8 years ago
Namespace: github.com/keegancsmith
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 14 days ago