buffalo-pop: github.com/gobuffalo/buffalo-pop/pop/popmw Index | Files

package popmw

import "github.com/gobuffalo/buffalo-pop/pop/popmw"

Index

Package Files

tx.go

func Transaction Uses

func Transaction(db *pop.Connection) buffalo.MiddlewareFunc

PopTransaction is a piece of Buffalo middleware that wraps each request in a transaction. The transaction will automatically get committed if there's no errors and the response status code is a 2xx or 3xx, otherwise it'll be rolled back. It will also add a field to the log, "db", that shows the total duration spent during the request making database calls.

Package popmw imports 6 packages (graph) and is imported by 10 packages. Updated 2019-04-06. Refresh now. Tools for package owners.