Documentation
¶
Overview ¶
Package store owns the SQLite database: schema migrations, config entity CRUD, and the connection shared with the queue implementation.
Index ¶
- type StorageStats
- type Store
- func (s *Store) Close() error
- func (s *Store) Compact(ctx context.Context) error
- func (s *Store) ConfigureResources(ctx context.Context, resources model.ResourceConfig) error
- func (s *Store) DB() *sql.DB
- func (s *Store) DeleteConnector(ctx context.Context, id string) error
- func (s *Store) DeleteSink(ctx context.Context, id string) error
- func (s *Store) DeleteSource(ctx context.Context, id string) error
- func (s *Store) GetConnector(ctx context.Context, id string) (model.Connector, error)
- func (s *Store) GetSink(ctx context.Context, id string) (model.Sink, error)
- func (s *Store) GetSource(ctx context.Context, id string) (model.Source, error)
- func (s *Store) IsEmpty(ctx context.Context) (bool, error)
- func (s *Store) KnownConnectorIDs(ctx context.Context) ([]string, error)
- func (s *Store) ListConnectors(ctx context.Context) ([]model.Connector, error)
- func (s *Store) ListSinks(ctx context.Context) ([]model.Sink, error)
- func (s *Store) ListSources(ctx context.Context) ([]model.Source, error)
- func (s *Store) LoadConfig(ctx context.Context) (model.Config, error)
- func (s *Store) Maintain(ctx context.Context) error
- func (s *Store) PutConnector(ctx context.Context, v model.Connector) error
- func (s *Store) PutSink(ctx context.Context, v model.Sink) error
- func (s *Store) PutSource(ctx context.Context, v model.Source) error
- func (s *Store) ReplaceConfig(ctx context.Context, cfg model.Config) error
- func (s *Store) StorageStats(ctx context.Context) (StorageStats, error)
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 (*Store) Compact ¶ added in v1.2.6
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
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) DeleteConnector ¶
func (*Store) GetConnector ¶ added in v1.2.3
func (*Store) KnownConnectorIDs ¶
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 (*Store) ListSources ¶ added in v1.2.3
func (*Store) Maintain ¶ added in v1.2.6
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 (*Store) ReplaceConfig ¶
ReplaceConfig transactionally replaces the whole configuration.
func (*Store) StorageStats ¶ added in v1.2.6
func (s *Store) StorageStats(ctx context.Context) (StorageStats, error)