Documentation
¶
Index ¶
- type ExecCall
- type MemoryStorage
- func (m *MemoryStorage) Exec(_ context.Context, query string, args ...any) (interfaces.Result, error)
- func (m *MemoryStorage) ExecCalls() []ExecCall
- func (m *MemoryStorage) Query(_ context.Context, query string, args ...any) (interfaces.Rows, error)
- func (m *MemoryStorage) QueryCalls() []QueryCall
- func (m *MemoryStorage) Transaction(_ context.Context, fn func(tx interfaces.Transaction) error) error
- type QueryCall
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryStorage ¶
type MemoryStorage struct {
// contains filtered or unexported fields
}
MemoryStorage records generator storage interactions for assertions in tests.
func NewGeneratorContainer ¶
func NewGeneratorContainer(cfg runtimeconfig.Config, opts ...di.Option) (*di.Container, *MemoryStorage, error)
NewGeneratorContainer creates a DI container configured with memory-based generator storage.
func NewMemoryStorage ¶
func NewMemoryStorage() *MemoryStorage
NewMemoryStorage constructs a new in-memory storage adapter.
func (*MemoryStorage) Exec ¶
func (m *MemoryStorage) Exec(_ context.Context, query string, args ...any) (interfaces.Result, error)
Exec records the executed statement.
func (*MemoryStorage) ExecCalls ¶
func (m *MemoryStorage) ExecCalls() []ExecCall
ExecCalls returns a copy of recorded Exec calls.
func (*MemoryStorage) Query ¶
func (m *MemoryStorage) Query(_ context.Context, query string, args ...any) (interfaces.Rows, error)
Query records the query and returns a stateless rows iterator.
func (*MemoryStorage) QueryCalls ¶
func (m *MemoryStorage) QueryCalls() []QueryCall
QueryCalls returns a copy of recorded Query calls.
func (*MemoryStorage) Transaction ¶
func (m *MemoryStorage) Transaction(_ context.Context, fn func(tx interfaces.Transaction) error) error
Transaction executes the provided function with a transactional view of the storage.
Click to show internal directories.
Click to hide internal directories.