store

package
v0.0.0-...-142f14e Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	DbHandle *sql.DB
}

func ConnectToDatabase

func ConnectToDatabase(ctx context.Context, config *config.Config) (*Repository, func(), error)

To be able to close *sql.DB before finishing application process, this function needs to return a function which executes *sql.DB.Close()

func (*Repository) DeleteSentence

func (r *Repository) DeleteSentence(ctx context.Context, sentenceID int64) (int64, error)

func (*Repository) InsertNewSentence

func (r *Repository) InsertNewSentence(ctx context.Context, sentence *entity.Sentence) (int64, error)

Insert a new sentence into db

func (*Repository) SelectSentenceById

func (r *Repository) SelectSentenceById(ctx context.Context, sentenceID int64) (entity.Sentence, error)

func (*Repository) SelectSentenceList

func (r *Repository) SelectSentenceList(ctx context.Context) ([]entity.Sentence, error)

func (*Repository) UpdateSentence

func (r *Repository) UpdateSentence(ctx context.Context, sentenceID int64, body string) (int64, error)

Jump to

Keyboard shortcuts

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