preload_test

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PreloadAuthor

type PreloadAuthor struct {
	models.Model `table:"preload_authors" json:"-"`
	ID           uint64                                            `json:"id"`
	Name         string                                            `json:"name"`
	CreatedAt    drivers.DateTime                                  `json:"created_at" attrs:"readonly"`
	UpdatedAt    drivers.DateTime                                  `json:"updated_at" attrs:"readonly"`
	Books        *queries.RelM2M[*PreloadBook, *PreloadAuthorBook] `json:"-"`
	Profile      *PreloadAuthorProfile                             `json:"profile,omitempty" attrs:"-"`
}

func (*PreloadAuthor) BeforeCreate

func (pa *PreloadAuthor) BeforeCreate(ctx context.Context) error

func (*PreloadAuthor) BeforeSave

func (pa *PreloadAuthor) BeforeSave(ctx context.Context) error

func (*PreloadAuthor) FieldDefs

func (pa *PreloadAuthor) FieldDefs() attrs.Definitions

type PreloadAuthorBook

type PreloadAuthorBook struct {
	models.Model `table:"preload_author_books" json:"-"`
	Author       *PreloadAuthor `json:"author_id"`
	Book         *PreloadBook   `json:"book_id"`
}

func (*PreloadAuthorBook) FieldDefs

func (pab *PreloadAuthorBook) FieldDefs() attrs.Definitions

func (*PreloadAuthorBook) SourceField

func (pab *PreloadAuthorBook) SourceField() string

func (*PreloadAuthorBook) TargetField

func (pab *PreloadAuthorBook) TargetField() string

func (*PreloadAuthorBook) UniqueTogether

func (pab *PreloadAuthorBook) UniqueTogether() [][]string

type PreloadAuthorProfile

type PreloadAuthorProfile struct {
	models.Model `table:"preload_author_profiles" json:"-"`
	ID           uint64         `json:"id" attrs:"primary;readonly"`
	Email        *drivers.Email `json:"email" attrs:"null;blank;max_length:254"`
	FirstName    string         `json:"first_name" attrs:"max_length:50"`
	LastName     string         `json:"last_name" attrs:"max_length:50"`
	Author       *PreloadAuthor `json:"author" attrs:"-"`
}

func (*PreloadAuthorProfile) BeforeSave

func (pap *PreloadAuthorProfile) BeforeSave(ctx context.Context) error

func (*PreloadAuthorProfile) FieldDefs

func (pap *PreloadAuthorProfile) FieldDefs() attrs.Definitions

type PreloadBook

type PreloadBook struct {
	models.Model `table:"preload_books" json:"-"`
	ID           uint64                                        `json:"id"`
	Title        string                                        `json:"title"`
	Authors      *queries.RelM2M[attrs.Definer, attrs.Definer] `json:"-"`
}

func (*PreloadBook) FieldDefs

func (pb *PreloadBook) FieldDefs() attrs.Definitions

Jump to

Keyboard shortcuts

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