models

package
v0.0.0-...-d0dd730 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2019 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DividendColumns = struct {
	ID             string
	SnapshotID     string
	AccountID      string
	BalanceLimit   string
	Balance        string
	DividendAmount string
}{
	ID:             "id",
	SnapshotID:     "snapshot_id",
	AccountID:      "account_id",
	BalanceLimit:   "balance_limit",
	Balance:        "balance",
	DividendAmount: "dividend_amount",
}
View Source
var DividendRels = struct {
	Snapshot string
}{
	Snapshot: "Snapshot",
}

DividendRels is where relationship names are stored.

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 SnapshotColumns = struct {
	ID        string
	AssetCode string
	Issuer    string
	CreatedAt string
	UpdatedAt string
	UpdatedBy string
}{
	ID:        "id",
	AssetCode: "asset_code",
	Issuer:    "issuer",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
	UpdatedBy: "updated_by",
}
View Source
var SnapshotRels = struct {
	Dividends string
}{
	Dividends: "Dividends",
}

SnapshotRels is where relationship names are stored.

View Source
var TableNames = struct {
	Dividend string
	Snapshot string
}{
	Dividend: "dividend",
	Snapshot: "snapshot",
}

Functions

func AddDividendHook

func AddDividendHook(hookPoint boil.HookPoint, dividendHook DividendHook)

AddDividendHook registers your hook function for all future operations.

func AddSnapshotHook

func AddSnapshotHook(hookPoint boil.HookPoint, snapshotHook SnapshotHook)

AddSnapshotHook registers your hook function for all future operations.

func DividendExists

func DividendExists(exec boil.Executor, iD int) (bool, error)

DividendExists checks if the Dividend row exists.

func Dividends

func Dividends(mods ...qm.QueryMod) dividendQuery

Dividends retrieves all the records using an executor.

func NewQuery

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

NewQuery initializes a new Query using the passed in QueryMods

func SnapshotExists

func SnapshotExists(exec boil.Executor, iD int) (bool, error)

SnapshotExists checks if the Snapshot row exists.

func Snapshots

func Snapshots(mods ...qm.QueryMod) snapshotQuery

Snapshots retrieves all the records using an executor.

Types

type Dividend

type Dividend struct {
	ID             int        `boil:"id" json:"id" toml:"id" yaml:"id"`
	SnapshotID     int        `boil:"snapshot_id" json:"snapshot_id" toml:"snapshot_id" yaml:"snapshot_id"`
	AccountID      string     `boil:"account_id" json:"account_id" toml:"account_id" yaml:"account_id"`
	BalanceLimit   int64      `boil:"balance_limit" json:"balance_limit" toml:"balance_limit" yaml:"balance_limit"`
	Balance        int64      `boil:"balance" json:"balance" toml:"balance" yaml:"balance"`
	DividendAmount null.Int64 `boil:"dividend_amount" json:"dividend_amount,omitempty" toml:"dividend_amount" yaml:"dividend_amount,omitempty"`

	R *dividendR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L dividendL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Dividend is an object representing the database table.

func FindDividend

func FindDividend(exec boil.Executor, iD int, selectCols ...string) (*Dividend, error)

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

func (*Dividend) Delete

func (o *Dividend) Delete(exec boil.Executor) (int64, error)

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

func (*Dividend) Insert

func (o *Dividend) Insert(exec boil.Executor, columns boil.Columns) error

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

func (*Dividend) Reload

func (o *Dividend) Reload(exec boil.Executor) error

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

func (*Dividend) SetSnapshot

func (o *Dividend) SetSnapshot(exec boil.Executor, insert bool, related *Snapshot) error

SetSnapshot of the dividend to the related item. Sets o.R.Snapshot to related. Adds o to related.R.Dividends.

func (*Dividend) Snapshot

func (o *Dividend) Snapshot(mods ...qm.QueryMod) snapshotQuery

Snapshot pointed to by the foreign key.

func (*Dividend) Update

func (o *Dividend) Update(exec boil.Executor, columns boil.Columns) (int64, error)

Update uses an executor to update the Dividend. 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.

func (*Dividend) Upsert

func (o *Dividend) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error

Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.

type DividendHook

type DividendHook func(boil.Executor, *Dividend) error

DividendHook is the signature for custom Dividend hook methods

type DividendSlice

type DividendSlice []*Dividend

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

func (DividendSlice) DeleteAll

func (o DividendSlice) DeleteAll(exec boil.Executor) (int64, error)

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

func (*DividendSlice) ReloadAll

func (o *DividendSlice) ReloadAll(exec boil.Executor) error

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

func (DividendSlice) UpdateAll

func (o DividendSlice) UpdateAll(exec boil.Executor, cols M) (int64, error)

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

type M

type M map[string]interface{}

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

type Snapshot

type Snapshot struct {
	ID        int       `boil:"id" json:"id" toml:"id" yaml:"id"`
	AssetCode string    `boil:"asset_code" json:"asset_code" toml:"asset_code" yaml:"asset_code"`
	Issuer    string    `boil:"issuer" json:"issuer" toml:"issuer" yaml:"issuer"`
	CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	UpdatedAt time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"`
	UpdatedBy string    `boil:"updated_by" json:"updated_by" toml:"updated_by" yaml:"updated_by"`

	R *snapshotR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L snapshotL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Snapshot is an object representing the database table.

func FindSnapshot

func FindSnapshot(exec boil.Executor, iD int, selectCols ...string) (*Snapshot, error)

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

func (*Snapshot) AddDividends

func (o *Snapshot) AddDividends(exec boil.Executor, insert bool, related ...*Dividend) error

AddDividends adds the given related objects to the existing relationships of the snapshot, optionally inserting them as new records. Appends related to o.R.Dividends. Sets related.R.Snapshot appropriately.

func (*Snapshot) Delete

func (o *Snapshot) Delete(exec boil.Executor) (int64, error)

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

func (*Snapshot) Dividends

func (o *Snapshot) Dividends(mods ...qm.QueryMod) dividendQuery

Dividends retrieves all the dividend's Dividends with an executor.

func (*Snapshot) Insert

func (o *Snapshot) Insert(exec boil.Executor, columns boil.Columns) error

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

func (*Snapshot) Reload

func (o *Snapshot) Reload(exec boil.Executor) error

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

func (*Snapshot) Update

func (o *Snapshot) Update(exec boil.Executor, columns boil.Columns) (int64, error)

Update uses an executor to update the Snapshot. 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.

func (*Snapshot) Upsert

func (o *Snapshot) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error

Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.

type SnapshotHook

type SnapshotHook func(boil.Executor, *Snapshot) error

SnapshotHook is the signature for custom Snapshot hook methods

type SnapshotSlice

type SnapshotSlice []*Snapshot

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

func (SnapshotSlice) DeleteAll

func (o SnapshotSlice) DeleteAll(exec boil.Executor) (int64, error)

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

func (*SnapshotSlice) ReloadAll

func (o *SnapshotSlice) ReloadAll(exec boil.Executor) error

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

func (SnapshotSlice) UpdateAll

func (o SnapshotSlice) UpdateAll(exec boil.Executor, 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