sql

package
v0.0.0-...-ace544b Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package sql provides a database for the library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

func NewDatabase

func NewDatabase(ctx context.Context, driverName, url string) (*Database, error)

func (*Database) CreateBooks

func (d *Database) CreateBooks(ctx context.Context, books ...book.Book) ([]book.Book, error)

func (*Database) DeleteBook

func (d *Database) DeleteBook(ctx context.Context, id string) error

func (*Database) ReadAdminPassword

func (d *Database) ReadAdminPassword(ctx context.Context) (hashedPassword []byte, err error)

func (*Database) ReadBook

func (d *Database) ReadBook(ctx context.Context, id string) (*book.Book, error)

func (*Database) ReadBookHeaders

func (d *Database) ReadBookHeaders(ctx context.Context, filter book.Filter, limit, offset int) ([]book.Header, error)

func (*Database) ReadBookSubjects

func (d *Database) ReadBookSubjects(ctx context.Context, limit, offset int) ([]book.Subject, error)

func (*Database) UpdateAdminPassword

func (d *Database) UpdateAdminPassword(ctx context.Context, hashedPassword string) error

func (*Database) UpdateBook

func (d *Database) UpdateBook(ctx context.Context, b book.Book, updateImage bool) error

Directories

Path Synopsis
Package mock provides a mock sql driver for tests.
Package mock provides a mock sql driver for tests.

Jump to

Keyboard shortcuts

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