db

package
v0.0.0-...-8f55857 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(dbName string, dsn string) *sqlx.DB

Types

type PostgresStore

type PostgresStore struct {
	DB *sqlx.DB
}

func (*PostgresStore) ApplyMigrations

func (s *PostgresStore) ApplyMigrations(migrations embed.FS) error

func (*PostgresStore) ExecCustom

func (s *PostgresStore) ExecCustom(query string, args ...interface{}) error

func (*PostgresStore) GetByCategory

func (s *PostgresStore) GetByCategory(category string) (models.ComboDBMediaItem, error)

func (*PostgresStore) GetCustom

func (s *PostgresStore) GetCustom(query string, args ...interface{}) (models.ComboDBMediaItem, error)

func (*PostgresStore) GetNewest

func (s *PostgresStore) GetNewest() (models.ComboDBMediaItem, error)

func (*PostgresStore) GetRecent

func (s *PostgresStore) GetRecent() ([]models.ComboDBMediaItem, error)

func (*PostgresStore) Insert

func (s *PostgresStore) Insert(item models.MediaItem) error

type SqliteStore

type SqliteStore struct {
	DB *sqlx.DB
}

func (*SqliteStore) ApplyMigrations

func (s *SqliteStore) ApplyMigrations(migrations embed.FS) error

func (*SqliteStore) ExecCustom

func (s *SqliteStore) ExecCustom(query string, args ...interface{}) error

func (*SqliteStore) GetByCategory

func (s *SqliteStore) GetByCategory(category string) (models.ComboDBMediaItem, error)

func (*SqliteStore) GetCustom

func (s *SqliteStore) GetCustom(query string, args ...interface{}) (models.ComboDBMediaItem, error)

func (*SqliteStore) GetNewest

func (s *SqliteStore) GetNewest() (models.ComboDBMediaItem, error)

func (*SqliteStore) GetRecent

func (s *SqliteStore) GetRecent() ([]models.ComboDBMediaItem, error)

func (*SqliteStore) Insert

func (s *SqliteStore) Insert(item models.MediaItem) error

type Store

type Store interface {
	ApplyMigrations(migrations embed.FS) error
	GetRecent() ([]models.ComboDBMediaItem, error)
	GetNewest() (models.ComboDBMediaItem, error)
	GetByCategory(category string) (models.ComboDBMediaItem, error)
	Insert(item models.MediaItem) error
	GetCustom(query string, args ...interface{}) (models.ComboDBMediaItem, error)
	ExecCustom(query string, args ...interface{}) error
}

func NewPostgresStore

func NewPostgresStore(dsn string) (Store, error)

func NewSqliteStore

func NewSqliteStore(dsn string) (Store, error)

Jump to

Keyboard shortcuts

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