models

package
v0.0.0-...-9742f5a Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 16 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 RawBlockColumns = struct {
	Blockid string
	Height  string
	Bytes   string
}{
	Blockid: "blockid",
	Height:  "height",
	Bytes:   "bytes",
}
View Source
var RawBlockRels = struct {
}{}

RawBlockRels is where relationship names are stored.

View Source
var RawBlockWhere = struct {
	Blockid whereHelper__byte
	Height  whereHelperint64
	Bytes   whereHelper__byte
}{
	Blockid: whereHelper__byte{/* contains filtered or unexported fields */},
	Height:  whereHelperint64{/* contains filtered or unexported fields */},
	Bytes:   whereHelper__byte{/* contains filtered or unexported fields */},
}
View Source
var RawTXColumns = struct {
	Txid  string
	Bytes string
}{
	Txid:  "txid",
	Bytes: "bytes",
}
View Source
var RawTXRels = struct {
}{}

RawTXRels is where relationship names are stored.

View Source
var RawTXWhere = struct {
	Txid  whereHelpermodels_TXID
	Bytes whereHelper__byte
}{
	Txid:  whereHelpermodels_TXID{/* contains filtered or unexported fields */},
	Bytes: whereHelper__byte{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	RawBlock string
	RawTX    string
}{
	RawBlock: "raw_block",
	RawTX:    "raw_tx",
}

Functions

func AddRawBlockHook

func AddRawBlockHook(hookPoint boil.HookPoint, rawBlockHook RawBlockHook)

AddRawBlockHook registers your hook function for all future operations.

func AddRawTXHook

func AddRawTXHook(hookPoint boil.HookPoint, rawTXHook RawTXHook)

AddRawTXHook 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 RawBlockExists

func RawBlockExists(ctx context.Context, exec boil.ContextExecutor, blockid []byte) (bool, error)

RawBlockExists checks if the RawBlock row exists.

func RawBlocks

func RawBlocks(mods ...qm.QueryMod) rawBlockQuery

RawBlocks retrieves all the records using an executor.

func RawTXExists

func RawTXExists(ctx context.Context, exec boil.ContextExecutor, txid models.TXID) (bool, error)

RawTXExists checks if the RawTX row exists.

func RawTxes

func RawTxes(mods ...qm.QueryMod) rawTXQuery

RawTxes 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 RawBlock

type RawBlock struct {
	Blockid []byte `boil:"blockid" json:"blockid" toml:"blockid" yaml:"blockid"`
	Height  int64  `boil:"height" json:"height" toml:"height" yaml:"height"`
	Bytes   []byte `boil:"bytes" json:"bytes" toml:"bytes" yaml:"bytes"`

	R *rawBlockR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L rawBlockL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

RawBlock is an object representing the database table.

func FindRawBlock

func FindRawBlock(ctx context.Context, exec boil.ContextExecutor, blockid []byte, selectCols ...string) (*RawBlock, error)

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

func (*RawBlock) Delete

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

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

func (*RawBlock) Insert

func (o *RawBlock) 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 (*RawBlock) Reload

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

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

func (*RawBlock) Update

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

Update uses an executor to update the RawBlock. 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 (*RawBlock) Upsert

func (o *RawBlock) Upsert(ctx context.Context, exec boil.ContextExecutor, 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 RawBlockHook

type RawBlockHook func(context.Context, boil.ContextExecutor, *RawBlock) error

RawBlockHook is the signature for custom RawBlock hook methods

type RawBlockSlice

type RawBlockSlice []*RawBlock

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

func (RawBlockSlice) DeleteAll

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

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

func (*RawBlockSlice) ReloadAll

func (o *RawBlockSlice) 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 (RawBlockSlice) UpdateAll

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

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

type RawTX

type RawTX struct {
	Txid  models.TXID `boil:"txid" json:"txid" toml:"txid" yaml:"txid"`
	Bytes []byte      `boil:"bytes" json:"bytes" toml:"bytes" yaml:"bytes"`

	R *rawTXR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L rawTXL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

RawTX is an object representing the database table.

func FindRawTX

func FindRawTX(ctx context.Context, exec boil.ContextExecutor, txid models.TXID, selectCols ...string) (*RawTX, error)

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

func (*RawTX) Delete

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

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

func (*RawTX) Insert

func (o *RawTX) 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 (*RawTX) Reload

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

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

func (*RawTX) Update

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

Update uses an executor to update the RawTX. 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 (*RawTX) Upsert

func (o *RawTX) Upsert(ctx context.Context, exec boil.ContextExecutor, 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 RawTXHook

type RawTXHook func(context.Context, boil.ContextExecutor, *RawTX) error

RawTXHook is the signature for custom RawTX hook methods

type RawTXSlice

type RawTXSlice []*RawTX

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

func (RawTXSlice) DeleteAll

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

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

func (*RawTXSlice) ReloadAll

func (o *RawTXSlice) 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 (RawTXSlice) UpdateAll

func (o RawTXSlice) 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