跳到主要内容

DB

Clone

new clone db with every chain call

fmt.Printf("%p", db)          // #1
fmt.Printf("%p", db.Debug()) // #2
fmt.Printf("%p", db.Must()) // #3

影响行约束

will check the RowsAffected > 0 or Scan rows > 0

db.Affect()

调试模式

db.Debug()

Trace ID

db.WithTraceId("test")