Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TestHookEventQuery = "SELECT * FROM foo WHERE id = ?" TestHookEventArgument = "42" )
Functions ¶
func NewTestHookEvent ¶
func NewTestHookEvent(options ...TestHookEventOption) *sql.HookEvent
NewTestHookEvent returns a new sql.HookEvent for tests purposes.
Types ¶
type Options ¶
Options are the options for NewTestHookEvent.
func DefaultTestHookEventOptions ¶
func DefaultTestHookEventOptions() Options
DefaultTestHookEventOptions are the default options for NewTestHookEvent.
type TestHookEventOption ¶
type TestHookEventOption func(o *Options)
TestHookEventOption are the functional options for NewTestHookEvent.
func WithArguments ¶
func WithArguments(arguments any) TestHookEventOption
WithArguments is used to set the arguments of the test sql.HookEvent.
func WithOperation ¶
func WithOperation(operation sql.Operation) TestHookEventOption
WithOperation is used to set the sql.Operation of the test sql.HookEvent.
func WithQuery ¶
func WithQuery(query string) TestHookEventOption
WithQuery is used to set the query of the test sql.HookEvent.
func WithSystem ¶
func WithSystem(system sql.System) TestHookEventOption
WithSystem is used to set the sql.System of the test sql.HookEvent.
Click to show internal directories.
Click to hide internal directories.