stemdb

package
v0.0.0-...-78a4636 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: MIT Imports: 4 Imported by: 0

README

stemdb

Работа с БД stem

Описание

Пакет может использоваться отдельно.

В разделе импорта указывается:

`"git.tad17.ru/itman/stem/stemdb"`

После этого можно использовать методы:

API

  • db := stemdb.Connect() - возвращает экземпляр db
  • ListAllBooks() - список всех книг (возможно с фильтром по удаленным и выбранным)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect() *sqlx.DB

The Connect function opens a connection to a MySQL database and returns the connection object.

Types

type Book

type Book struct {
	ID       int
	Author   string
	Seria    string
	Title    string
	Deleted  bool
	Selected bool
}

The above type represents a book with properties such as ID, author, series, title, and flags for deletion and selection. @property {int} ID - The ID property is an integer that represents the unique identifier of a book. @property {string} Author - The author of the book. @property {string} Seria - The "Seria" property in the Book struct represents the series to which the book belongs. It is a string that holds the name or identifier of the series. @property {string} Title - The title of the book. @property {bool} Deleted - The "Deleted" property is a boolean value that indicates whether the book has been marked as deleted or not. If the value is true, it means the book has been deleted. If the value is false, it means the book is not deleted. @property {bool} Selected - The "Selected" property is a boolean value that indicates whether the book is currently selected or not. It can be used to keep track of which books are currently being interacted with or displayed in a user interface.

func ListAllBooks

func ListAllBooks(options ...string) ([]Book, error)

возвращает список всех книг возможно использование фильтров в query, типа: ?deleted=deleted&selected=not selected The function `ListAllBooks` retrieves a list of books from a database based on optional conditions.

Jump to

Keyboard shortcuts

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