如何在PostgreSQL中跟踪SQL查询

sql.Register("sqlWithHooks", sqlhooks.Wrap(r.Driver(), &Hooks{}))

// Connect to the registered wrapped driver
db, err := sql.Open("sqlWithHooks", ":memory:")
if err != nil {
    fmt.Println("error",err)

}

rows, err := db.Query("SELECT id,name,zone_z_id,dimension,price FROM   gift_box_z ")

if err != nil {
    fmt.Println("inside the error .........................",err)

}

After running this code I am getting an error missing "=" after ":memory:" in connection info string. Can anyone tell me what's wrong with what I've done here?

查看全部
douyan3478
douyan3478
2018/11/13 14:47
  • postgresql
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

2个回复