sqlitestorage

package
v5.0.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package sqlitestorage implements the storage.Backend interface using an in-memory SQLite database with periodic disk dumps via VACUUM INTO. It wraps the GORM backend via composition — the only SQLite-specific concerns are: (a) creating the in-memory DB, (b) skipping ProjectileEvent (no PostGIS), (c) periodic disk dump, and (d) schema migration without PostGIS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	*pgstorage.Backend
	// contains filtered or unexported fields
}

Backend wraps the GORM backend for SQLite-specific behavior.

func New

func New(cfg Config, entityCache *cache.EntityCache, markerCache *cache.MarkerCache, logManager *logging.SlogManager) (*Backend, error)

New creates a new SQLite storage backend.

func (*Backend) Close

func (b *Backend) Close() error

Close stops the dump goroutine and closes the embedded GORM backend.

func (*Backend) Init

func (b *Backend) Init() error

Init initializes the embedded GORM backend and starts the dump goroutine.

func (*Backend) RecordProjectileEvent

func (b *Backend) RecordProjectileEvent(e *core.ProjectileEvent) error

RecordProjectileEvent is a no-op — SQLite doesn't support LineStringZM (PostGIS geometry).

type Config

type Config struct {
	DumpInterval time.Duration
	DumpPath     string // Path for periodic VACUUM INTO dumps
}

Config holds configuration for the SQLite storage backend.

Jump to

Keyboard shortcuts

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