Documentation
¶
Index ¶
- func NewSQLite(dbFilePath string, requiredVer uint) (*sql.DB, error)
- type SQLiteStore
- func (s *SQLiteStore) Begin(ctx context.Context) (domain.Store, error)
- func (s *SQLiteStore) Close()
- func (s *SQLiteStore) Commit() error
- func (s *SQLiteStore) EpisodeCount(ctx context.Context) (int, error)
- func (s *SQLiteStore) EpisodeCreate(ctx context.Context, episode *domain.Episode) error
- func (s *SQLiteStore) EpisodeGet(ctx context.Context, pageSize, pageNumber int) ([]*domain.Episode, error)
- func (s *SQLiteStore) EpisodeGetByUrl(ctx context.Context, url string) ([]*domain.Episode, error)
- func (s *SQLiteStore) Rollback() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SQLiteStore ¶
type SQLiteStore struct {
// contains filtered or unexported fields
}
SQLiteStore is a SQLite implementation of the Store interface.
func NewSQLiteStore ¶
func NewSQLiteStore(db *sql.DB) *SQLiteStore
NewSQLiteStore creates a new SQLiteStore instance.
func (*SQLiteStore) EpisodeCount ¶ added in v1.0.0
func (s *SQLiteStore) EpisodeCount(ctx context.Context) (int, error)
EpisodeCount returns the total count of episodes in the store.
func (*SQLiteStore) EpisodeCreate ¶
EpisodeCreate creates a new episode in the store.
func (*SQLiteStore) EpisodeGet ¶ added in v1.0.0
func (s *SQLiteStore) EpisodeGet(ctx context.Context, pageSize, pageNumber int) ([]*domain.Episode, error)
EpisodeGet returns all episodes from the store in descending order by creation date. Supports pagination via pageSize and pageNumber parameters. Zero values for pageSize and pageNumber will return all episodes without pagination.
func (*SQLiteStore) EpisodeGetByUrl ¶ added in v1.0.0
EpisodeGetByUrl returns episodes matching the given original or canonical URL.
func (*SQLiteStore) Rollback ¶
func (s *SQLiteStore) Rollback() error
Rollback aborts the transaction.