go-sql-caller-annotation

module
v0.0.0-...-a956357 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2023 License: Apache-2.0

README

CI PkgGoDev

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

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL