sqlite

package
v1.18.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActorReminder added in v1.15.0

type ActorReminder struct {
	RegisteredTime time.Time
	ExpirationTime time.Time
	Period         string
	Data           any
	ActorID        string
	ActorType      string
	Name           string
	DueTime        string
}

type ActorTypeReminders added in v1.15.0

type ActorTypeReminders struct {
	Key            string
	Reminders      []ActorReminder
	IsBinary       bool
	Etag           string
	ExpirationTime *time.Time
	UpdateTime     *time.Time
}

type Option

type Option func(*options)

Option is a function that configures the process.

func WithActorStateStore

func WithActorStateStore(enabled bool) Option

WithActorStateStore configures whether the state store is enabled as actor state store.

func WithCreateStateTables

func WithCreateStateTables() Option

WithCreateStateTables configures whether the state store should create the state tables.

func WithDBPath added in v1.15.0

func WithDBPath(dbPath string) Option

func WithExecs

func WithExecs(execs ...string) Option

WithExecs defines the execs to run against the database on Run.

func WithMetadata

func WithMetadata(key, value string) Option

WithMetadata adds a metadata option to the component. This can be invoked multiple times.

func WithName

func WithName(name string) Option

WithName sets the name for the state store. Default is "mystore".

func WithTableName added in v1.14.5

func WithTableName(tableName string) Option

type SQLite

type SQLite struct {
	// contains filtered or unexported fields
}

SQLite database that can be used in integration tests. Consumers should always run this Process before any other Framework Processes which consume it so all migrations are applied.

func New

func New(t *testing.T, fopts ...Option) *SQLite

func (*SQLite) ActorReminders added in v1.15.0

func (s *SQLite) ActorReminders(t *testing.T, ctx context.Context, actorType string) ActorTypeReminders

func (*SQLite) Cleanup

func (s *SQLite) Cleanup(t *testing.T)

func (*SQLite) CountStateKeys added in v1.17.7

func (s *SQLite) CountStateKeys(t *testing.T, ctx context.Context, keyPrefix string) int

CountStateKeys returns the number of state keys matching the given prefix.

func (*SQLite) DeleteStateKeys

func (s *SQLite) DeleteStateKeys(t *testing.T, ctx context.Context, likePattern string)

DeleteStateKeys deletes all rows whose key matches the given SQL LIKE pattern. Use `%` as the wildcard (e.g. `%||signature-%`).

func (*SQLite) FirstStateValue

func (s *SQLite) FirstStateValue(t *testing.T, ctx context.Context, instanceID, keyPrefix string) (string, []byte)

FirstStateValue returns the (key, base64-decoded value) of the first row matching the given instance ID and key prefix (e.g. "history"). Fails the test if no such row exists.

func (*SQLite) GetComponent

func (s *SQLite) GetComponent(t *testing.T) string

GetComponent returns the Component resource.

func (*SQLite) GetConnection

func (s *SQLite) GetConnection(t *testing.T) *sql.DB

GetConnection returns the connection to the SQLite database.

func (*SQLite) GetTableName added in v1.14.5

func (s *SQLite) GetTableName(t *testing.T) string

GetTableName returns the connection to the SQLite database.

func (*SQLite) ReadStateValue added in v1.17.7

func (s *SQLite) ReadStateValue(t *testing.T, ctx context.Context, instanceID, keySuffix string) (string, []byte)

ReadStateValue loads and base64-decodes the single value for the given workflow instance and exact key suffix (e.g. "metadata"). Fails the test if no such row exists.

func (*SQLite) ReadStateValues added in v1.17.7

func (s *SQLite) ReadStateValues(t *testing.T, ctx context.Context, instanceID, keyPrefix string) [][]byte

ReadStateValues reads base64-encoded state values from the SQLite database matching the given instance ID and key prefix.

func (*SQLite) Run

func (s *SQLite) Run(t *testing.T, ctx context.Context)

func (*SQLite) TableName added in v1.15.0

func (s *SQLite) TableName() string

func (*SQLite) WriteStateValue added in v1.17.7

func (s *SQLite) WriteStateValue(t *testing.T, ctx context.Context, key string, raw []byte)

WriteStateValue base64-encodes and writes the given raw bytes to the state store under the exact key provided. Uses INSERT OR REPLACE so it works for both new rows and overwrites.

Jump to

Keyboard shortcuts

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