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: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BlockColumns = struct {
	ID     string
	Height string
	Bytes  string
}{
	ID:     "id",
	Height: "height",
	Bytes:  "bytes",
}
View Source
var BlockRels = struct {
}{}

BlockRels is where relationship names are stored.

View Source
var BlockWhere = struct {
	ID     whereHelperint64
	Height whereHelperint64
	Bytes  whereHelperstring
}{
	ID:     whereHelperint64{/* contains filtered or unexported fields */},
	Height: whereHelperint64{/* contains filtered or unexported fields */},
	Bytes:  whereHelperstring{/* contains filtered or unexported fields */},
}
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 TableNames = struct {
	Blocks string
	Utxo   string
}{
	Blocks: "blocks",
	Utxo:   "utxo",
}
View Source
var UtxoColumns = struct {
	ID           string
	Txid         string
	Idx          string
	Amount       string
	ScriptPubkey string
}{
	ID:           "id",
	Txid:         "txid",
	Idx:          "idx",
	Amount:       "amount",
	ScriptPubkey: "script_pubkey",
}
View Source
var UtxoRels = struct {
}{}

UtxoRels is where relationship names are stored.

View Source
var UtxoWhere = struct {
	ID           whereHelperint64
	Txid         whereHelperstring
	Idx          whereHelperint64
	Amount       whereHelperint64
	ScriptPubkey whereHelperstring
}{
	ID:           whereHelperint64{/* contains filtered or unexported fields */},
	Txid:         whereHelperstring{/* contains filtered or unexported fields */},
	Idx:          whereHelperint64{/* contains filtered or unexported fields */},
	Amount:       whereHelperint64{/* contains filtered or unexported fields */},
	ScriptPubkey: whereHelperstring{/* contains filtered or unexported fields */},
}

Functions

func AddBlockHook

func AddBlockHook(hookPoint boil.HookPoint, blockHook BlockHook)

AddBlockHook registers your hook function for all future operations.

func AddUtxoHook

func AddUtxoHook(hookPoint boil.HookPoint, utxoHook UtxoHook)

AddUtxoHook registers your hook function for all future operations.

func BlockExists

func BlockExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)

BlockExists checks if the Block row exists.

func Blocks

func Blocks(mods ...qm.QueryMod) blockQuery

Blocks 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 UtxoExists

func UtxoExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)

UtxoExists checks if the Utxo row exists.

func Utxos

func Utxos(mods ...qm.QueryMod) utxoQuery

Utxos retrieves all the records using an executor.

Types

type Block

type Block struct {
	ID     int64  `boil:"id" json:"id" toml:"id" yaml:"id"`
	Height int64  `boil:"height" json:"height" toml:"height" yaml:"height"`
	Bytes  string `boil:"bytes" json:"bytes" toml:"bytes" yaml:"bytes"`

	R *blockR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L blockL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Block is an object representing the database table.

func FindBlock

func FindBlock(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*Block, error)

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

func (*Block) Delete

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

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

func (*Block) Insert

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

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

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

func (*Block) Update

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

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

type BlockHook func(context.Context, boil.ContextExecutor, *Block) error

BlockHook is the signature for custom Block hook methods

type BlockSlice

type BlockSlice []*Block

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

func (BlockSlice) DeleteAll

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

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

func (*BlockSlice) ReloadAll

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

func (o BlockSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, 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 Utxo

type Utxo struct {
	ID           int64  `boil:"id" json:"id" toml:"id" yaml:"id"`
	Txid         string `boil:"txid" json:"txid" toml:"txid" yaml:"txid"`
	Idx          int64  `boil:"idx" json:"idx" toml:"idx" yaml:"idx"`
	Amount       int64  `boil:"amount" json:"amount" toml:"amount" yaml:"amount"`
	ScriptPubkey string `boil:"script_pubkey" json:"script_pubkey" toml:"script_pubkey" yaml:"script_pubkey"`

	R *utxoR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L utxoL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Utxo is an object representing the database table.

func FindUtxo

func FindUtxo(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*Utxo, error)

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

func (*Utxo) Delete

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

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

func (*Utxo) Insert

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

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

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

func (*Utxo) Update

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

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

type UtxoHook func(context.Context, boil.ContextExecutor, *Utxo) error

UtxoHook is the signature for custom Utxo hook methods

type UtxoSlice

type UtxoSlice []*Utxo

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

func (UtxoSlice) DeleteAll

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

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

func (*UtxoSlice) ReloadAll

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

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