record

package
v2.16.8 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultRecord

type DefaultRecord struct{}

DefaultRecord implements the Key() as "id"

func (*DefaultRecord) Key

func (record *DefaultRecord) Key() string

Key returns "ID" as the default Primary Key

type ListOptions

type ListOptions struct {
	Limit  uint
	Offset uint
}

ListOptions provide limit and filtering capabilities for the List function

func NewListOptions

func NewListOptions[T constraints.Integer](limit T, offset T) *ListOptions

NewListOptions generates a ListOptions

type PrimaryKeyValue

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

PrimaryKeyValue limits keys to string or int

func NewPrimaryKey

func NewPrimaryKey(value interface{}) (pk PrimaryKeyValue)

NewPrimaryKey returns a populated PrimaryKeyValue

func (PrimaryKeyValue) Value

func (pk PrimaryKeyValue) Value() interface{}

Value returns the string or integer value for a Record

type Record

type Record interface {
	// Initialize sets any expected values on a Record during Create
	Initialize()
	// PrimaryKey returns the value of the primary key of the Record
	PrimaryKey() PrimaryKeyValue
	// Key returns the name of the primary key of the Record
	Key() string
	// Meta returns the meta object for this Record
	Meta() qb.Table
}

Record defines a database enabled record

Jump to

Keyboard shortcuts

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