sql wrapper it log sql command
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
vendor
LICENSE
README.md
db.go

README.md

sqlwrapper

Install

go get github.com/syhlion/sqlwrapper

Usage

func main(){
    db, err := sql.Open("xxx","xxx")
    if err != nil {
        return nil, err
    }
    db := WrapperDB(db,true,1*time.Second)


    // it log [sql] select * from member where id = ?  1  2s
    rs,err:=db.Exec("select * from member where id = ?",1)
    if err != nil {
        return
    }

}