Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Interface ¶
type Interface interface { sqlx.Queryer sqlx.QueryerContext sqlx.Execer sqlx.ExecerContext DBX() *sqlx.DB }
Interface is a common wrapper over sqlx so we can compose functionality.
func WithInterceptor ¶
func WithInterceptor(db Interface, interceptor Interceptor) Interface
WithInterceptor will call interceptor before each DB call. If interceptor returns an error, it will be returned. If the DB method does not return an error (like QueryRow), but Interceptor does, panic with the error. Usually this is used for mocking.
func WithLogging ¶
WithLogging adds logging around all calls.
Click to show internal directories.
Click to hide internal directories.