Versions in this module Expand all Collapse all v3 v3.0.0 Jul 31, 2026 Changes in this version + type CommonScenarios struct + func NewCommonScenarios(db *TestDB) *CommonScenarios + func (s *CommonScenarios) SetupBatchOperations() + func (s *CommonScenarios) SetupCRUD(model interface{}) + func (s *CommonScenarios) SetupComplexQuery() + func (s *CommonScenarios) SetupErrorScenarios(errorMap map[string]error) + func (s *CommonScenarios) SetupIndexQuery(indexName string) + func (s *CommonScenarios) SetupMultiTenant(tenantID string) + func (s *CommonScenarios) SetupPagination(pageSize int) + func (s *CommonScenarios) SetupScanScenario() + func (s *CommonScenarios) SetupUpdateBuilder() + type ConfigurableDBFactory interface + WithConfig func(config FactoryConfig) ConfigurableDBFactory + type ConfigurableMockDBFactory struct + func NewConfigurableMockDBFactory() *ConfigurableMockDBFactory + func (f *ConfigurableMockDBFactory) CreateDB(config session.Config) (core.ExtendedDB, error) + func (f *ConfigurableMockDBFactory) WithConfig(config FactoryConfig) ConfigurableDBFactory + type DBFactory interface + CreateDB func(config session.Config) (core.ExtendedDB, error) + func SimpleMockFactory(setupFunc func(db *mocks.MockExtendedDB)) DBFactory + type DefaultDBFactory struct + func (f *DefaultDBFactory) CreateDB(config session.Config) (core.ExtendedDB, error) + type FactoryConfig struct + EnableLogging bool + EnableMetrics bool + Middleware []Middleware + type Middleware func(next Operation) Operation + type MockDBFactory struct + Error error + MockDB core.ExtendedDB + OnCreateDB func(config session.Config) + func NewMockDBFactory() *MockDBFactory + func (f *MockDBFactory) CreateDB(config session.Config) (core.ExtendedDB, error) + func (f *MockDBFactory) WithError(err error) *MockDBFactory + func (f *MockDBFactory) WithMockDB(mockDB core.ExtendedDB) *MockDBFactory + type MockUpdateBuilder struct + func (m *MockUpdateBuilder) Add(field string, value any) core.UpdateBuilder + func (m *MockUpdateBuilder) AppendToList(field string, values any) core.UpdateBuilder + func (m *MockUpdateBuilder) Condition(field string, operator string, value any) core.UpdateBuilder + func (m *MockUpdateBuilder) ConditionExists(field string) core.UpdateBuilder + func (m *MockUpdateBuilder) ConditionNotExists(field string) core.UpdateBuilder + func (m *MockUpdateBuilder) ConditionVersion(currentVersion int64) core.UpdateBuilder + func (m *MockUpdateBuilder) Decrement(field string) core.UpdateBuilder + func (m *MockUpdateBuilder) Delete(field string, value any) core.UpdateBuilder + func (m *MockUpdateBuilder) Execute() error + func (m *MockUpdateBuilder) ExecuteWithResult(result any) error + func (m *MockUpdateBuilder) Increment(field string) core.UpdateBuilder + func (m *MockUpdateBuilder) OrCondition(field string, operator string, value any) core.UpdateBuilder + func (m *MockUpdateBuilder) PrependToList(field string, values any) core.UpdateBuilder + func (m *MockUpdateBuilder) Remove(field string) core.UpdateBuilder + func (m *MockUpdateBuilder) RemoveFromListAt(field string, index int) core.UpdateBuilder + func (m *MockUpdateBuilder) ReturnValues(option string) core.UpdateBuilder + func (m *MockUpdateBuilder) Set(field string, value any) core.UpdateBuilder + func (m *MockUpdateBuilder) SetIfNotExists(field string, value any, defaultValue any) core.UpdateBuilder + func (m *MockUpdateBuilder) SetListElement(field string, index int, value any) core.UpdateBuilder + type Operation func() error + type QueryChain struct + func (q *QueryChain) ExpectAll(results interface{}) *TestDB + func (q *QueryChain) ExpectFirst(result interface{}) *TestDB + func (q *QueryChain) Limit(limit int) *QueryChain + func (q *QueryChain) OrderBy(field string, order string) *QueryChain + func (q *QueryChain) Where(field string, op string, value interface{}) *QueryChain + type TestDB struct + MockDB *mocks.MockDB + MockQuery *mocks.MockQuery + func NewTestDB() *TestDB + func (t *TestDB) AssertExpectations(testing mock.TestingT) + func (t *TestDB) ExpectAll(results interface{}) *TestDB + func (t *TestDB) ExpectBatchCreate(items interface{}) *TestDB + func (t *TestDB) ExpectBatchDelete(keys []interface{}) *TestDB + func (t *TestDB) ExpectBatchGet(keys []interface{}, results interface{}) *TestDB + func (t *TestDB) ExpectCount(count int64) *TestDB + func (t *TestDB) ExpectCreate() *TestDB + func (t *TestDB) ExpectCreateError(err error) *TestDB + func (t *TestDB) ExpectDelete() *TestDB + func (t *TestDB) ExpectDeleteError(err error) *TestDB + func (t *TestDB) ExpectFind(result interface{}) *TestDB + func (t *TestDB) ExpectIndex(indexName string) *TestDB + func (t *TestDB) ExpectLimit(limit int) *TestDB + func (t *TestDB) ExpectModel(model interface{}) *TestDB + func (t *TestDB) ExpectNotFound() *TestDB + func (t *TestDB) ExpectOffset(offset int) *TestDB + func (t *TestDB) ExpectOrderBy(field string, order string) *TestDB + func (t *TestDB) ExpectUpdate(fields ...string) *TestDB + func (t *TestDB) ExpectUpdateError(err error, fields ...string) *TestDB + func (t *TestDB) ExpectWhere(field string, op string, value interface{}) *TestDB + func (t *TestDB) NewQueryChain() *QueryChain + func (t *TestDB) Reset() + type TestDBFactory struct + CreateFunc func(config session.Config) (core.ExtendedDB, error) + Instances []core.ExtendedDB + func (f *TestDBFactory) CreateDB(config session.Config) (core.ExtendedDB, error) + func (f *TestDBFactory) GetLastInstance() core.ExtendedDB + func (f *TestDBFactory) Reset() v3.0.0-rc Jul 31, 2026 Other modules containing this package github.com/theory-cloud/tabletheory github.com/theory-cloud/tabletheory/v2