store

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package store owns the SQLite database: schema migrations, config entity CRUD, and the connection shared with the queue implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StorageStats added in v1.2.6

type StorageStats struct {
	PageSize       int64 `json:"page_size"`
	PageCount      int64 `json:"page_count"`
	FreePages      int64 `json:"free_pages"`
	MaxPages       int64 `json:"max_pages"`
	PhysicalBytes  int64 `json:"physical_bytes"`
	AllocatedBytes int64 `json:"allocated_bytes"`
	FreeBytes      int64 `json:"free_bytes"`
	MaxBytes       int64 `json:"max_bytes"`
}

type Store

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

func Open

func Open(path string) (*Store, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) Compact added in v1.2.6

func (s *Store) Compact(ctx context.Context) error

Compact reclaims the database high-water mark and enables incremental page reclamation for legacy databases. Call only while Beacon is offline and with enough free space for SQLite's VACUUM operation.

func (*Store) ConfigureResources added in v1.2.6

func (s *Store) ConfigureResources(ctx context.Context, resources model.ResourceConfig) error

ConfigureResources applies the hard SQLite main-database page ceiling and a small WAL retention ceiling. SQLite may transiently exceed the WAL target during an active transaction, but the main database cannot grow beyond MaxDatabaseBytes. Lowering the limit below an existing file requires Compact.

func (*Store) DB

func (s *Store) DB() *sql.DB

func (*Store) DeleteConnector

func (s *Store) DeleteConnector(ctx context.Context, id string) error

func (*Store) DeleteSink

func (s *Store) DeleteSink(ctx context.Context, id string) error

func (*Store) DeleteSource

func (s *Store) DeleteSource(ctx context.Context, id string) error

func (*Store) GetConnector added in v1.2.3

func (s *Store) GetConnector(ctx context.Context, id string) (model.Connector, error)

func (*Store) GetSink added in v1.2.3

func (s *Store) GetSink(ctx context.Context, id string) (model.Sink, error)

func (*Store) GetSource added in v1.2.3

func (s *Store) GetSource(ctx context.Context, id string) (model.Source, error)

func (*Store) IsEmpty

func (s *Store) IsEmpty(ctx context.Context) (bool, error)

func (*Store) KnownConnectorIDs

func (s *Store) KnownConnectorIDs(ctx context.Context) ([]string, error)

KnownConnectorIDs returns every connector id that has aggregate or checkpoint state. Append maintains the aggregate transactionally, so this lookup never scans the retained-envelope table.

func (*Store) ListConnectors added in v1.2.3

func (s *Store) ListConnectors(ctx context.Context) ([]model.Connector, error)

func (*Store) ListSinks added in v1.2.3

func (s *Store) ListSinks(ctx context.Context) ([]model.Sink, error)

func (*Store) ListSources added in v1.2.3

func (s *Store) ListSources(ctx context.Context) ([]model.Source, error)

func (*Store) LoadConfig

func (s *Store) LoadConfig(ctx context.Context) (model.Config, error)

func (*Store) Maintain added in v1.2.6

func (s *Store) Maintain(ctx context.Context) error

Maintain performs bounded online maintenance. It never runs a full VACUUM; that operation can require another database-sized allocation and belongs to the explicit offline Compact command.

func (*Store) PutConnector

func (s *Store) PutConnector(ctx context.Context, v model.Connector) error

func (*Store) PutSink

func (s *Store) PutSink(ctx context.Context, v model.Sink) error

func (*Store) PutSource

func (s *Store) PutSource(ctx context.Context, v model.Source) error

func (*Store) ReplaceConfig

func (s *Store) ReplaceConfig(ctx context.Context, cfg model.Config) error

ReplaceConfig transactionally replaces the whole configuration.

func (*Store) StorageStats added in v1.2.6

func (s *Store) StorageStats(ctx context.Context) (StorageStats, error)

Jump to

Keyboard shortcuts

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