postgres

package
v0.0.0-...-976adb4 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BooksDatabaseImpl

type BooksDatabaseImpl struct {
	DB *sql.DB
}

BooksDatabaseImpl contain direct access to the DB

func (BooksDatabaseImpl) CreateBook

func (dbImpl BooksDatabaseImpl) CreateBook(book model.Book) error

CreateBook create book using book parameter

func (BooksDatabaseImpl) DeleteBook

func (dbImpl BooksDatabaseImpl) DeleteBook(id string) error

DeleteBook delete the book corresponding to the giving ID parameter

func (BooksDatabaseImpl) GetBook

func (dbImpl BooksDatabaseImpl) GetBook(id string) (*model.Book, error)

GetBook return book with the parameter id, error otherwise

func (BooksDatabaseImpl) GetBooks

func (dbImpl BooksDatabaseImpl) GetBooks() ([]*model.Book, error)

GetBooks return all books

func (BooksDatabaseImpl) PutBook

func (dbImpl BooksDatabaseImpl) PutBook(book model.Book) error

PutBook update the book

Jump to

Keyboard shortcuts

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