sqlite3

package
v0.17.14 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Unlicense Imports: 13 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TooManyIDs       = errors.New("too many ids")
	TooManyAuthors   = errors.New("too many authors")
	TooManyKinds     = errors.New("too many kinds")
	TooManyTagValues = errors.New("too many tag values")
	EmptyTagSet      = errors.New("empty tag set")
)

Functions

This section is empty.

Types

type SQLite3Backend

type SQLite3Backend struct {
	sync.Mutex
	*sqlx.DB
	DatabaseURL       string
	QueryLimit        int
	QueryIDsLimit     int
	QueryAuthorsLimit int
	QueryKindsLimit   int
	QueryTagsLimit    int
}

func (*SQLite3Backend) Close

func (b *SQLite3Backend) Close()

func (*SQLite3Backend) CountEvents

func (b *SQLite3Backend) CountEvents(ctx context.Context, filter nostr.Filter) (int64, error)

func (*SQLite3Backend) CountEventsFilters added in v0.17.13

func (b *SQLite3Backend) CountEventsFilters(ctx context.Context, filters nostr.Filters) (int64, error)

CountEventsFilters counts the events matching any of the filters, counting an event that matches more than one of them only once. NIP-45 OR's the filters together into a single count, so summing a per-filter count would report overlapping filters more than once. The union is evaluated by the database: pulling the ids back to deduplicate them here would cost one id per stored event.

func (*SQLite3Backend) DeleteEvent

func (b *SQLite3Backend) DeleteEvent(ctx context.Context, evt *nostr.Event) error

func (*SQLite3Backend) Init

func (b *SQLite3Backend) Init() error

func (*SQLite3Backend) QueryEvents

func (b *SQLite3Backend) QueryEvents(ctx context.Context, filter nostr.Filter) (ch chan *nostr.Event, err error)

func (*SQLite3Backend) ReplaceEvent added in v0.15.0

func (b *SQLite3Backend) ReplaceEvent(ctx context.Context, evt *nostr.Event) error

func (*SQLite3Backend) SaveEvent

func (b *SQLite3Backend) SaveEvent(ctx context.Context, evt *nostr.Event) error

Jump to

Keyboard shortcuts

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