Documentation
¶
Index ¶
- func CleanUp(t testing.TB, wrapper Wrapper)
- func CleanUpBookEvents(wrapper Wrapper, bookID uuid.UUID) (rowsAffected int64, err error)
- func GetGreatestOccurredAtTimeFromDB(t testing.TB, wrapper Wrapper) time.Time
- func GetLatestBookIDFromDB(t testing.TB, wrapper Wrapper) uuid.UUID
- func GuardThatThereAreEnoughFixtureEventsInStore(wrapper Wrapper, expectedNumEvents int)
- func OptimizeDBForWhileBenchmarking(wrapper Wrapper) error
- func TryCreateEventStoreWithTableName(t testing.TB, tableName string) error
- type PGXPoolWrapper
- type SQLDBWrapper
- type SQLXWrapper
- type Wrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanUpBookEvents ¶
CleanUpBookEvents executes SQL for benchmark cleanup for the given wrapper
func GetGreatestOccurredAtTimeFromDB ¶
GetGreatestOccurredAtTimeFromDB gets the maximum occurred_at time from the events table for the given wrapper
func GetLatestBookIDFromDB ¶
GetLatestBookIDFromDB gets the latest BookID from the events table for the given wrapper
func GuardThatThereAreEnoughFixtureEventsInStore ¶
GuardThatThereAreEnoughFixtureEventsInStore checks if there are enough fixture events in the store for the given wrapper
func OptimizeDBForWhileBenchmarking ¶
OptimizeDBForWhileBenchmarking executes SQL for benchmark cleanup for the given wrapper
Types ¶
type PGXPoolWrapper ¶
type PGXPoolWrapper struct {
// contains filtered or unexported fields
}
PGXPoolWrapper wraps pgxpool-based testing
func (*PGXPoolWrapper) Close ¶
func (e *PGXPoolWrapper) Close()
func (*PGXPoolWrapper) GetEventStore ¶
func (e *PGXPoolWrapper) GetEventStore() postgresengine.EventStore
type SQLDBWrapper ¶
type SQLDBWrapper struct {
// contains filtered or unexported fields
}
SQLDBWrapper wraps sql.DB-based testing
func (*SQLDBWrapper) Close ¶
func (e *SQLDBWrapper) Close()
func (*SQLDBWrapper) GetEventStore ¶
func (e *SQLDBWrapper) GetEventStore() postgresengine.EventStore
type SQLXWrapper ¶
type SQLXWrapper struct {
// contains filtered or unexported fields
}
SQLXWrapper wraps sqlx.DB-based testing
func (*SQLXWrapper) Close ¶
func (e *SQLXWrapper) Close()
func (*SQLXWrapper) GetEventStore ¶
func (e *SQLXWrapper) GetEventStore() postgresengine.EventStore
type Wrapper ¶
type Wrapper interface { GetEventStore() postgresengine.EventStore Close() }
Wrapper interface to abstract over different engine types
func CreateWrapperWithBenchmarkConfig ¶
CreateWrapperWithBenchmarkConfig creates the appropriate wrapper based on the environment variable
func CreateWrapperWithTestConfig ¶
CreateWrapperWithTestConfig creates the appropriate wrapper based on the environment variable