models

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chunk

func Chunk(input []*Book, batchSize int) [][]*Book

func FetchBook

func FetchBook() goent.FetchFunc

FetchBook creates a FetchFunc for Book.

Types

type Book

type Book struct {
	ID           int64
	ISBN         string `goe:"unique"`
	Title        string
	Author       string
	Genre        string
	Quantity     int
	PublicizedAt time.Time
}

Book represents a book from a bookstore system.

func NewBook

func NewBook() *Book

func NewBookNoPtr

func NewBookNoPtr() Book

func NewBooks

func NewBooks(quantity int) []*Book

func NewBooksNoPtr

func NewBooksNoPtr(quantity int) []Book

func (*Book) GetID

func (t *Book) GetID() int64

implement goent.Entity interface GetID for Book

func (*Book) InsertValues

func (t *Book) InsertValues() []any

InsertValues returns a slice of values for bulk insert (excluding auto-increment primary key).

func (*Book) ScanDest

func (t *Book) ScanDest() []any

ScanDest returns a slice of pointers to Book fields for database scanning.

func (*Book) SetID

func (t *Book) SetID(id int64)

implement goent.Entity interface SetID for Book

func (*Book) TableName

func (*Book) TableName() string

func (*Book) UpdatePairs

func (t *Book) UpdatePairs() []goent.Pair

UpdatePairs returns a slice of Pair for updating non-primary key fields.

Jump to

Keyboard shortcuts

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