store

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package to manipulate database, with go types instead of direct SQL queries, ensure simplicity and safety.

Index

Constants

This section is empty.

Variables

View Source
var ErrDatabaseNil = fmt.Errorf("database cannot be nil")

Error when trying to use nil database in this module.

Functions

func AddTag

func AddTag(db *lazydb.LazyDB, tags ...string) error

Add tags to given LazyDB. This function support multiple tags insert at once.

If tag value is empty string, then it will be skipped.

func GetAllTags

func GetAllTags(db *lazydb.LazyDB) ([]string, error)

Get all tags from given LazyDB.

func GetGenreList

func GetGenreList(db *lazydb.LazyDB) ([]string, error)

Get all genre value that from database.

func GetPublisherList

func GetPublisherList(db *lazydb.LazyDB) ([]string, error)

Get all publisher value that from database.

func InsertGenre

func InsertGenre(db *lazydb.LazyDB, value ...string) error

Insert genre value from database.

func InsertMultiHistory

func InsertMultiHistory(db *lazydb.LazyDB, values ...HistoryVal) error

Insert values to database, which can include multiple record with different categories.

The string values & category values should be wrapped in `HistoryObj`.

If any error is occur during insert, the insert process will stop and return its error.

func InsertPublisher

func InsertPublisher(db *lazydb.LazyDB, value ...string) error

Insert publisher value from database.

Types

type HistoryVal

type HistoryVal struct {
	Category definitions.CategoryType // category to be inserted
	Value    string                   // value to be inserted
}

Container for history module, which wraps all necessary value will be used to insert value.

This type is designed for insert value with different category at a time.

Jump to

Keyboard shortcuts

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