sqlite

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package sqlite provides the official durable SQLite implementation of the Agent remote-worker Journal port.

Index

Constants

View Source
const (

	// DefaultMaxPendingRecords and DefaultMaxPendingBytes bound all Journal
	// records which still retain payloads: assignments, outbound events, and
	// application-facing rejections. Tombstones do not consume the quota.
	DefaultMaxPendingRecords = 4096
	DefaultMaxPendingBytes   = int64(512 << 20)
)

Variables

View Source
var (
	// ErrDatabaseInUse means another live process or Resource owns the same
	// file-backed Journal. Sharing one SQLite file between Journal instances is
	// deliberately unsupported.
	ErrDatabaseInUse = errors.New("Agent worker Journal database is already held by another live owner")

	// ErrUnsupportedSchema rejects migration and accidental database sharing.
	// The adapter is pre-release and intentionally accepts only an empty database
	// or its exact current schema.
	ErrUnsupportedSchema = errors.New("unsupported Agent worker Journal sqlite schema; use a dedicated database")
)

Functions

func Open

Open constructs an owned SQLite Journal Resource. Config.Path may be an ordinary filesystem path or an independent :memory: database. Shared-memory SQLite DSNs are rejected because they cannot satisfy the adapter's single-owner lifecycle guarantee. ctx bounds construction only and is not retained.

Types

type Config

type Config struct {
	Path              string
	MaxPendingRecords int
	MaxPendingBytes   int64
}

Config selects one dedicated worker Journal persistence identity and its live-payload budget. A zero quota selects the documented default. Quotas are operational rather than durable: reopening with a lower value is allowed; an existing over-budget backlog can always settle or compact, while new assignment/event records are rejected with workerws.ErrJournalLimit.

Jump to

Keyboard shortcuts

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