Documentation
¶
Index ¶
- func InMemoryStore() (record.Store, error)
- func New(path string, opts Options) (record.Store, error)
- type Builder
- type Options
- type Store
- func (s *Store) CID(source source.ID, platformID string) resource.CID
- func (s *Store) CleanupCreators() (int, error)
- func (s *Store) Close() error
- func (s *Store) Count(filter resource.Filter) (int, error)
- func (s *Store) Delete(rids ...resource.RID) (int, error)
- func (s *Store) FindCreatorByCID(cid resource.CID) (resource.Creator, error)
- func (s *Store) FindCreatorByNickname(source source.ID, nickname string) (resource.Creator, error)
- func (s *Store) FindPagedRIDs(filter resource.Filter, offset int, limit int) ([]resource.RID, error)
- func (s *Store) FindRecord(rid resource.RID) (*resource.Record, error)
- func (s *Store) FindRecords(rids ...resource.RID) (resource.Box[resource.Record], error)
- func (s *Store) FindTagNames(tids ...resource.TID) ([]string, error)
- func (s *Store) FindURLs(normalizedURLs ...string) ([]string, error)
- func (s *Store) RestoreRecord(rec *resource.Record, characterCard *png.CharacterCard) (resource.RID, error)
- func (s *Store) SaveRecord(metadata *models.Metadata, characterCard *png.CharacterCard, ...) (resource.RID, error)
- func (s *Store) TagNames() ([]string, error)
- func (s *Store) ToggleFavorite(rid resource.RID) error
- func (s *Store) UpdateExportData(rid resource.RID, exportData resource.ExportData) error
- func (s *Store) UpdateFavoriteData(favorite bool, rids ...resource.RID) error
- func (s *Store) UpdateSyncData(rid resource.RID, syncData resource.SyncData) error
- func (s *Store) UpsertCreator(source source.ID, creatorInfo models.CreatorInfo) (resource.CID, error)
- func (s *Store) UpsertTags(tags []models.Tag) error
- func (s *Store) WithContext(ctx context.Context) record.CtxStore
- func (s *Store) WithTx(op func(store record.TxStore) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InMemoryStore ¶
InMemoryStore creates an in-memory SQLite store for testing
Types ¶
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) CleanupCreators ¶
func (*Store) FindCreatorByCID ¶
func (*Store) FindCreatorByNickname ¶
func (*Store) FindPagedRIDs ¶
func (*Store) FindRecords ¶
func (*Store) RestoreRecord ¶
func (*Store) SaveRecord ¶
func (*Store) UpdateExportData ¶
func (*Store) UpdateFavoriteData ¶
func (*Store) UpdateSyncData ¶
func (*Store) UpsertCreator ¶
Click to show internal directories.
Click to hide internal directories.