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

package popmw

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


Package Files


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 7 packages (graph) and is imported by 16 packages. Updated 2020-01-17. Refresh now. Tools for package owners.