parent
711ecbbe8d
commit
4997ba96bf
1 changed files with 7 additions and 0 deletions
|
@ -558,6 +558,9 @@ err := pilot.Delete(db) // Regular variant, takes a db handle (boil.Executor int
|
|||
pilot.DeleteP(db) // Panic variant, takes a db handle and panics on error.
|
||||
err := pilot.DeleteG() // Global variant, uses the globally set db handle (boil.SetDB()).
|
||||
pilot.DeleteGP() // Global&Panic variant, combines the global db handle and panic on error.
|
||||
|
||||
db.Begin() // Normal sql package way of creating a transaction
|
||||
boil.Begin() // Uses the global database handle set by boil.SetDB()
|
||||
```
|
||||
|
||||
Note that it's slightly different for query building.
|
||||
|
@ -857,6 +860,10 @@ tx.Commit()
|
|||
tx.Rollback()
|
||||
```
|
||||
|
||||
It's also worth noting that there's a way to take advantage of `boil.SetDB()`
|
||||
by using the [boil.Begin()](https://godoc.org/github.com/vattle/sqlboiler/boil#Begin) function.
|
||||
This opens a transaction using the globally stored database.
|
||||
|
||||
### Debug Logging
|
||||
|
||||
Debug logging will print your generated SQL statement and the arguments it is using.
|
||||
|
|
Loading…
Reference in a new issue