sqlite

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package sqlite provides the batteries-included durable Store (modernc.org/sqlite — pure Go, no cgo, per ADR-0006). It passes the same exported conformance suite as the memory backend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is the SQLite implementation of harness.Store.

func Open

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

Open opens (creating if needed) the database at path and verifies the schema version. When path is an existing directory, the database file is "harness.db" inside it.

func (*Store) AdmitSubmission

func (s *Store) AdmitSubmission(ctx context.Context, sub harness.Submission) (harness.Submission, error)

AdmitSubmission implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

func (*Store) AppendRecords

func (s *Store) AppendRecords(ctx context.Context, conversationID string, recs []harness.Record) error

AppendRecords implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

func (*Store) CancelSubmission added in v0.6.0

func (s *Store) CancelSubmission(ctx context.Context, submissionID, reason string) (wasRunning bool, err error)

CancelSubmission implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

func (*Store) ClaimSubmission

func (s *Store) ClaimSubmission(ctx context.Context, claim harness.SubmissionClaim) (harness.Submission, error)

ClaimSubmission implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

func (*Store) Close

func (s *Store) Close() error

Close releases the underlying database.

func (*Store) EnsureConversation

func (s *Store) EnsureConversation(ctx context.Context, candidate harness.Conversation) (harness.Conversation, bool, error)

EnsureConversation implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

func (*Store) FinalizeSettlement

func (s *Store) FinalizeSettlement(ctx context.Context, submissionID string) error

FinalizeSettlement implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

func (*Store) GetAttachment

func (s *Store) GetAttachment(ctx context.Context, digest string) (harness.Attachment, error)

GetAttachment implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

func (*Store) GetConversation

func (s *Store) GetConversation(ctx context.Context, key harness.SessionKey) (harness.Conversation, error)

GetConversation implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

func (*Store) GetSubmission

func (s *Store) GetSubmission(ctx context.Context, id string) (harness.Submission, error)

GetSubmission implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

func (*Store) ListAttempts

func (s *Store) ListAttempts(ctx context.Context, submissionID string) ([]harness.Attempt, error)

ListAttempts implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

func (*Store) ListByStatus

func (s *Store) ListByStatus(ctx context.Context, status harness.SubmissionStatus) ([]harness.Submission, error)

ListByStatus implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

func (*Store) ListChildSubmissions added in v0.6.0

func (s *Store) ListChildSubmissions(ctx context.Context, parentSubmissionID string) ([]harness.Submission, error)

ListChildSubmissions implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

func (*Store) ListExpiredLeases

func (s *Store) ListExpiredLeases(ctx context.Context, now time.Time) ([]harness.Submission, error)

ListExpiredLeases implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

func (*Store) ListExpiredWaits added in v0.6.0

func (s *Store) ListExpiredWaits(ctx context.Context, now time.Time) ([]harness.Submission, error)

ListExpiredWaits implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

func (*Store) ListRunnable

func (s *Store) ListRunnable(ctx context.Context) ([]harness.Submission, error)

ListRunnable implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

func (*Store) PutAttachment

func (s *Store) PutAttachment(ctx context.Context, mediaType string, data []byte) (harness.AttachmentRef, error)

PutAttachment implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

func (*Store) ReadRecords

func (s *Store) ReadRecords(ctx context.Context, conversationID string, afterID string) ([]harness.Record, error)

ReadRecords implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

func (*Store) ReleaseSubmission

func (s *Store) ReleaseSubmission(ctx context.Context, release harness.SubmissionRelease) error

ReleaseSubmission implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

func (*Store) RenewLease

func (s *Store) RenewLease(ctx context.Context, renewal harness.LeaseRenewal) error

RenewLease implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

func (*Store) ReserveSettlement

func (s *Store) ReserveSettlement(ctx context.Context, submissionID, attemptID string) error

ReserveSettlement implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

func (*Store) ResumeSubmission added in v0.6.0

func (s *Store) ResumeSubmission(ctx context.Context, submissionID string) error

ResumeSubmission implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

func (*Store) StartAttempt

func (s *Store) StartAttempt(ctx context.Context, attempt harness.Attempt) error

StartAttempt implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

func (*Store) WaitSubmission added in v0.6.0

func (s *Store) WaitSubmission(ctx context.Context, wait harness.SubmissionWait) error

WaitSubmission implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.

Jump to

Keyboard shortcuts

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