dao

package
v0.0.0-...-d3f7758 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-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 DinosaurDao

type DinosaurDao interface {
	Get(ctx context.Context, id string) (*api.Dinosaur, error)
	Create(ctx context.Context, dinosaur *api.Dinosaur) (*api.Dinosaur, error)
	Replace(ctx context.Context, dinosaur *api.Dinosaur) (*api.Dinosaur, error)
	Delete(ctx context.Context, id string) error
	FindByIDs(ctx context.Context, ids []string) (api.DinosaurList, error)
	FindBySpecies(ctx context.Context, species string) (api.DinosaurList, error)
	All(ctx context.Context) (api.DinosaurList, error)
}

func NewDinosaurDao

func NewDinosaurDao(sessionFactory *db.SessionFactory) DinosaurDao

type EventDao

type EventDao interface {
	Get(ctx context.Context, id string) (*api.Event, error)
	Create(ctx context.Context, event *api.Event) (*api.Event, error)
	Replace(ctx context.Context, event *api.Event) (*api.Event, error)
	Delete(ctx context.Context, id string) error
	FindByIDs(ctx context.Context, ids []string) (api.EventList, error)
	All(ctx context.Context) (api.EventList, error)
}

func NewEventDao

func NewEventDao(sessionFactory *db.SessionFactory) EventDao

type GenericDao

type GenericDao interface {
	Fetch(offset int, limit int, resourceList interface{}) error

	GetInstanceDao(ctx context.Context, model interface{}) GenericDao
	Preload(preload string)
	OrderBy(orderBy string)
	Joins(sql string)
	Group(sql string)
	Where(where Where)
	Count(model interface{}, total *int64)
	Validate(resourceList interface{}) error

	GetTableName() string
	GetTableRelation(fieldName string) (TableRelation, bool)
}

func NewGenericDao

func NewGenericDao(sessionFactory *db.SessionFactory) GenericDao

type TableRelation

type TableRelation struct {
	TableName         string
	ColumnName        string
	ForeignTableName  string
	ForeignColumnName string
}

represents a relationship between two tables. They can be joined, ON TableName.ColumnName = ForeignTableName.ForeignColumnName

type Where

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

func NewWhere

func NewWhere(sql string, values []any) Where

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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