memory

package
v0.52.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2025 License: MIT Imports: 11 Imported by: 0

README

In-Memory implementation of the catalog datastore

This implementation maintains the Catalog stores in-memory as simple tables, for use in tests. It is test-only, and should not be used in any changeset execution into a deployed environment.

TODO: Implement the in-memory catalog.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMemoryDataStore

func NewMemoryDataStore(t *testing.T, config MemoryDataStoreConfig) *memoryDataStore

NewMemoryDataStore creates an in-memory version of the catalog datastore, which can be used in tests of changesets which require use of the catalog. This implementation does not store data, and any fixture must be provided to it at the start of the test. A new call to this function will create an entirely separate and new in-memory store, so changes will not be persisted.

You should call `store.Close()` between usages, unless you need to refer to shared test state

This version is not threadsafe and could result in races when using transactions from multiple threads.

Types

type DB

type DB interface {
	Query(q string, args ...any) (*sql.Rows, error)
	Exec(q string, args ...any) (sql.Result, error)
}

type MemoryDataStoreConfig

type MemoryDataStoreConfig struct {
	Domain      string
	Environment string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL