storage

package
v0.0.0-...-917d98f Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBConfig

type DBConfig struct {
	Username string
	Password string
	Host     string
	Port     string
	DBName   string
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

wrapper around a sqlx.DB, used for performing database operations

func NewStore

func NewStore(cfg DBConfig) (*Store, error)

func (*Store) CreateStudent

func (s *Store) CreateStudent(name string) (*models.Student, error)

func (*Store) DeleteStudentByID

func (s *Store) DeleteStudentByID(id uuid.UUID) (found bool, err error)

func (*Store) GetStudentByID

func (s *Store) GetStudentByID(id uuid.UUID) (student *models.Student, found bool, err error)

func (*Store) UpdateStudent

func (s *Store) UpdateStudent(student *models.Student) (updatedStudent *models.Student, found bool, err error)

Jump to

Keyboard shortcuts

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