module
Version:
v0.0.0-...-a956357
Opens a new window with list of versions in this module.
Published: May 28, 2023
License: Apache-2.0
Opens a new window with license information.
README
¶
go-sql-caller-annotation
Provides an new sql.*DB
connection that injects caller information to the query
go get github.com/aereal/go-sql-caller-annotation
Usage
package main
import (
"github.com/aereal/go-sql-caller-annotation/sqlcaller"
)
func main() {
db, _ := sqlcaller.WithAnnotation("mysql", "..." /* DSN */)
db.Exec("SELECT version()") // runs `/* main.main (/path/to/file.go:9) */ SELECT version()` query
}
License
See LICENSE file.
Directories
¶
Click to show internal directories.
Click to hide internal directories.