Help us shape the future of Go! Take the 2026 Go Developer Survey

sqlite

package
v0.12.19 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLiteBackend

type SQLiteBackend struct {
	log.CommonBackend
	// Tables defines the table names to use for senders, severities, and logs.
	Tables SQLiteTables
	// contains filtered or unexported fields
}

SQLiteBackend stores log entries in a SQLite database with normalized tables.

func (*SQLiteBackend) Initialize

func (back *SQLiteBackend) Initialize(dbpath string) error

Initialize opens the database, ensures tables exist, and prepares statements.

func (*SQLiteBackend) NotifyAboutSender

func (back *SQLiteBackend) NotifyAboutSender(sender string)

NotifyAboutSender caches the sender row id, inserting it when necessary.

func (*SQLiteBackend) NotifyAboutSeverity

func (back *SQLiteBackend) NotifyAboutSeverity(severity *log.Severity)

NotifyAboutSeverity caches the severity row id, inserting it when necessary.

func (*SQLiteBackend) Shutdown

func (back *SQLiteBackend) Shutdown()

Shutdown vacuums the database to reclaim space.

func (*SQLiteBackend) Vacuum

func (back *SQLiteBackend) Vacuum()

Vacuum runs the SQLite VACUUM command. It is recommended at program termination.

func (*SQLiteBackend) Write

func (back *SQLiteBackend) Write(entry log.Entry) error

Write inserts the entry into the log table after ensuring gate compliance.

type SQLiteTables

type SQLiteTables struct {
	// Severities is the table storing severity metadata.
	Severities string
	// Senders is the table storing sender metadata.
	Senders string
	// Log is the table storing the actual log entries.
	Log string
	// Packages stores package names to eliminate duplication.
	Packages string
	// Files stores file paths to eliminate duplication.
	Files string
	// Meta stores JSON blobs describing entry metadata.
	Meta string
}

SQLiteTables lists the names of the supporting tables.

Source Files

  • Backend.go
  • Compliance.go
  • Configuration.go
  • migrations_embed.go
  • migrations_runner.go

Jump to

Keyboard shortcuts

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