database

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const OrderASC = "ASC"
View Source
const OrderDESC = "DESC"

Variables

This section is empty.

Functions

func InTransaction

func InTransaction[R any](ctx context.Context, db *Database, fn func(ctx context.Context, tx Executor) (R, error)) (R, error)

Types

type Database

type Database struct {
	bob.DB
	EnableDebugLogging bool
}

func (*Database) InTransaction

func (db *Database) InTransaction(ctx context.Context, fn func(ctx context.Context, tx Executor) error) error

type Executor added in v0.8.2

type Executor interface {
	scan.Queryer
	ExecContext(context.Context, string, ...any) (sql.Result, error)
}

type GetAssetQuery added in v0.3.0

type GetAssetQuery struct {
	ID               int64
	Tag              string
	IncludePurchases bool
	IncludeParts     bool
	IncludeFiles     bool
	IncludeParent    bool
	IncludeChildren  bool
}

type ListAssetsQuery added in v0.3.0

type ListAssetsQuery struct {
	SearchRaw    string
	SearchFields map[string]string

	IDs []int64

	Page     int
	PageSize int

	OrderBy  string
	OrderDir string

	AssetType string

	IncludePurchases bool
	IncludeParts     bool
	IncludeFiles     bool
	IncludeParent    bool
	IncludeChildren  bool
}

type ListCategoriesQuery added in v0.3.0

type ListCategoriesQuery struct {
	Search   string
	Page     int
	PageSize int
}

type ListCustomAttrsQuery added in v0.3.0

type ListCustomAttrsQuery struct {
	Search   string
	Page     int
	PageSize int
}

type ListFilesQuery added in v0.3.0

type ListFilesQuery struct {
	AssetID  int64
	Page     int
	PageSize int
	Hashes   [][]byte
}

type ListLocationsQuery added in v0.3.0

type ListLocationsQuery struct {
	Search   string
	Page     int
	PageSize int
}

type ListManufacturersQuery added in v0.3.0

type ListManufacturersQuery struct {
	Search   string
	Page     int
	PageSize int
}

type ListModelsQuery added in v0.3.0

type ListModelsQuery struct {
	Search   string
	Page     int
	PageSize int
}

type ListPositionCodesQuery added in v0.3.0

type ListPositionCodesQuery struct {
	Search   string
	Page     int
	PageSize int
}

type ListSuppliersQuery added in v0.3.0

type ListSuppliersQuery struct {
	Search   string
	Page     int
	PageSize int
}

type ListTagsQuery added in v0.3.0

type ListTagsQuery struct {
	Search   string
	InUse    *bool
	Page     int
	PageSize int
	OrderBy  string
	OrderDir string
}

type ListUsersQuery added in v0.3.0

type ListUsersQuery struct {
	Search   string
	Page     int
	PageSize int
	OrderBy  string
	OrderDir string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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