postgresql

package
v0.17.5 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: Unlicense Imports: 13 Imported by: 14

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 PostgresBackend

type PostgresBackend struct {
	sync.Mutex
	*sqlx.DB
	DatabaseURL             string
	QueryLimit              int
	QueryIDsLimit           int
	QueryAuthorsLimit       int
	QueryKindsLimit         int
	QueryTagsLimit          int
	KeepRecentEvents        bool
	FullTextSearchConfig    string // text search configuration for to_tsvector/to_tsquery, defaults to "simple"
	FullTextSearchMaxLength int    // maximum content length for full-text search, 0 means no limit
	FullTextSearchColumn    string // column to search in, defaults to "content"
}

func (*PostgresBackend) AfterSave

func (b *PostgresBackend) AfterSave(evt *nostr.Event)

func (*PostgresBackend) BeforeSave

func (b *PostgresBackend) BeforeSave(ctx context.Context, evt *nostr.Event)

func (*PostgresBackend) Close

func (b *PostgresBackend) Close()

func (*PostgresBackend) CountEvents

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

func (*PostgresBackend) DeleteEvent

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

func (*PostgresBackend) Init

func (b *PostgresBackend) Init() error

func (*PostgresBackend) QueryEvents

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

func (*PostgresBackend) ReplaceEvent added in v0.15.0

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

func (*PostgresBackend) SaveEvent

func (b *PostgresBackend) 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