erecord

package
v1.0.77 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InMemoryStore

func InMemoryStore() (record.Store, error)

InMemoryStore creates an in-memory SQLite store for testing

func New

func New(path string, opts Options) (record.Store, error)

New creates a new SQLite record store at the given path

Types

type Builder

type Builder Options

Builder implements record.Builder using Ent/SQLite

func (Builder) Build

func (b Builder) Build(path string) (record.Store, error)

type Options

type Options struct {
	CacheConnections   bool
	MaxConnections     int
	MaxIdleConnections int
	MaxLifetime        time.Duration
}

Options configures the SQLite record store

type Store

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

Store implements record.Store using Ent ORM with SQLite

func (*Store) CID

func (s *Store) CID(source source.ID, platformID string) resource.CID

func (*Store) CleanupCreators

func (s *Store) CleanupCreators() (int, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) Count

func (s *Store) Count(filter resource.Filter) (int, error)

func (*Store) Delete

func (s *Store) Delete(rids ...resource.RID) (int, error)

func (*Store) FindCreatorByCID

func (s *Store) FindCreatorByCID(cid resource.CID) (resource.Creator, error)

func (*Store) FindCreatorByNickname

func (s *Store) FindCreatorByNickname(source source.ID, nickname string) (resource.Creator, error)

func (*Store) FindPagedRIDs

func (s *Store) FindPagedRIDs(filter resource.Filter, offset int, limit int) ([]resource.RID, error)

func (*Store) FindRecord

func (s *Store) FindRecord(rid resource.RID) (*resource.Record, error)

func (*Store) FindRecords

func (s *Store) FindRecords(rids ...resource.RID) (resource.Box[resource.Record], error)

func (*Store) FindTagNames

func (s *Store) FindTagNames(tids ...resource.TID) ([]string, error)

func (*Store) FindURLs

func (s *Store) FindURLs(normalizedURLs ...string) ([]string, error)

func (*Store) RestoreRecord

func (s *Store) RestoreRecord(rec *resource.Record, characterCard *png.CharacterCard) (resource.RID, error)

func (*Store) SaveRecord

func (s *Store) SaveRecord(metadata *models.Metadata, characterCard *png.CharacterCard, time timestamp.Nano, importIndex ...int) (resource.RID, error)

func (*Store) TagNames

func (s *Store) TagNames() ([]string, error)

func (*Store) ToggleFavorite

func (s *Store) ToggleFavorite(rid resource.RID) error

func (*Store) UpdateExportData

func (s *Store) UpdateExportData(rid resource.RID, exportData resource.ExportData) error

func (*Store) UpdateFavoriteData

func (s *Store) UpdateFavoriteData(favorite bool, rids ...resource.RID) error

func (*Store) UpdateSyncData

func (s *Store) UpdateSyncData(rid resource.RID, syncData resource.SyncData) error

func (*Store) UpsertCreator

func (s *Store) UpsertCreator(source source.ID, creatorInfo models.CreatorInfo) (resource.CID, error)

func (*Store) UpsertTags

func (s *Store) UpsertTags(tags []models.Tag) error

func (*Store) WithContext

func (s *Store) WithContext(ctx context.Context) record.CtxStore

func (*Store) WithTx

func (s *Store) WithTx(op func(store record.TxStore) error) error

Directories

Path Synopsis
ent

Jump to

Keyboard shortcuts

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