sqlite3

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DATABASEDRIVER = "sqlite3"

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	DB *sql.DB
}

func NewRepository

func NewRepository(migrationPath, databaseFile string) *Repository

func NewTestRepository

func NewTestRepository(migrationPath string) *Repository

func (*Repository) CreateMovie

func (m *Repository) CreateMovie(movie *models.Movie) error

CreateMovie creates movie entry in database from struct

func (*Repository) DeleteMovie

func (m *Repository) DeleteMovie(id int) error

DeleteMovie deletes given movie

func (*Repository) GetMovie

func (m *Repository) GetMovie(id int) (*models.Movie, error)

GetMovie selects movie with given id in struct

func (*Repository) GetMovies

func (m *Repository) GetMovies(params models.MovieSearchParameter) ([]models.Movie, error)

GetMovies returns all movies in from movies table

Jump to

Keyboard shortcuts

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