models

package
v0.0.0-...-1cdca24 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSyncFail = errors.New("models: failed to synchronize data after insert")

ErrSyncFail occurs during insert when the record could not be retrieved in order to populate default value information. This usually happens when LastInsertId fails or there was a primary key configuration that was not resolvable.

View Source
var PeriodColumns = struct {
	SampleRate string
	BufferSize string
	Frequency  string
	Period     string
}{
	SampleRate: "sample_rate",
	BufferSize: "buffer_size",
	Frequency:  "frequency",
	Period:     "period",
}
View Source
var PeriodRels = struct {
}{}

PeriodRels is where relationship names are stored.

View Source
var PeriodWhere = struct {
	SampleRate whereHelperint64
	BufferSize whereHelperint64
	Frequency  whereHelperint64
	Period     whereHelperfloat64
}{
	SampleRate: whereHelperint64{/* contains filtered or unexported fields */},
	BufferSize: whereHelperint64{/* contains filtered or unexported fields */},
	Frequency:  whereHelperint64{/* contains filtered or unexported fields */},
	Period:     whereHelperfloat64{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Period string
}{
	Period: "period",
}

Functions

func AddPeriodHook

func AddPeriodHook(hookPoint boil.HookPoint, periodHook PeriodHook)

AddPeriodHook registers your hook function for all future operations.

func NewQuery

func NewQuery(mods ...qm.QueryMod) *queries.Query

NewQuery initializes a new Query using the passed in QueryMods

func PeriodExists

func PeriodExists(ctx context.Context, exec boil.ContextExecutor, sampleRate int64, bufferSize int64, frequency int64) (bool, error)

PeriodExists checks if the Period row exists.

func Periods

func Periods(mods ...qm.QueryMod) periodQuery

Periods retrieves all the records using an executor.

Types

type M

type M map[string]interface{}

M type is for providing columns and column values to UpdateAll.

type Period

type Period struct {
	SampleRate int64   `boil:"sample_rate" json:"sample_rate" toml:"sample_rate" yaml:"sample_rate"`
	BufferSize int64   `boil:"buffer_size" json:"buffer_size" toml:"buffer_size" yaml:"buffer_size"`
	Frequency  int64   `boil:"frequency" json:"frequency" toml:"frequency" yaml:"frequency"`
	Period     float64 `boil:"period" json:"period" toml:"period" yaml:"period"`

	R *periodR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L periodL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Period is an object representing the database table.

func FindPeriod

func FindPeriod(ctx context.Context, exec boil.ContextExecutor, sampleRate int64, bufferSize int64, frequency int64, selectCols ...string) (*Period, error)

FindPeriod retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.

func (*Period) Delete

func (o *Period) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)

Delete deletes a single Period record with an executor. Delete will match against the primary key column to find the record to delete.

func (*Period) Insert

func (o *Period) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error

Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.

func (*Period) Reload

func (o *Period) Reload(ctx context.Context, exec boil.ContextExecutor) error

Reload refetches the object from the database using the primary keys with an executor.

func (*Period) Update

func (o *Period) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

Update uses an executor to update the Period. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.

type PeriodHook

type PeriodHook func(context.Context, boil.ContextExecutor, *Period) error

PeriodHook is the signature for custom Period hook methods

type PeriodSlice

type PeriodSlice []*Period

PeriodSlice is an alias for a slice of pointers to Period. This should generally be used opposed to []Period.

func (PeriodSlice) DeleteAll

func (o PeriodSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)

DeleteAll deletes all rows in the slice, using an executor.

func (*PeriodSlice) ReloadAll

func (o *PeriodSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error

ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.

func (PeriodSlice) UpdateAll

func (o PeriodSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

UpdateAll updates all rows with the specified column values, using an executor.

Jump to

Keyboard shortcuts

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