postgres

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateIndex

func CreateIndex(ctx context.Context, tx bun.Tx) error

CreateIndex - creates all needed indices in postgres database

func CreateTypes added in v0.0.3

func CreateTypes(ctx context.Context, conn *database.Bun) error

Types

type CelestialState

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

func NewCelestialState

func NewCelestialState(db *database.Bun) *CelestialState

func (*CelestialState) ByName

func (cs *CelestialState) ByName(ctx context.Context, name string) (result storage.CelestialState, err error)

func (*CelestialState) Save

func (cs *CelestialState) Save(ctx context.Context, state *storage.CelestialState) error

type CelestialTransaction

type CelestialTransaction struct {
	sdk.Transaction
}

func BeginCelestialTransaction

func BeginCelestialTransaction(ctx context.Context, tx sdk.Transactable) (CelestialTransaction, error)

func (CelestialTransaction) SaveCelestials

func (tx CelestialTransaction) SaveCelestials(ctx context.Context, celestials iter.Seq[storage.Celestial]) error

func (CelestialTransaction) UpdateState

func (tx CelestialTransaction) UpdateState(ctx context.Context, state *storage.CelestialState) error

func (CelestialTransaction) UpdateStatusForAddress added in v0.0.3

func (tx CelestialTransaction) UpdateStatusForAddress(ctx context.Context, addressId iter.Seq[uint64]) error

type Celestials

type Celestials struct {
	*database.Bun
}

func NewCelestials

func NewCelestials(db *database.Bun) *Celestials

func (*Celestials) ByAddressId

func (c *Celestials) ByAddressId(ctx context.Context, addressId uint64, limit, offset int) (result []storage.Celestial, err error)

func (*Celestials) ById

func (c *Celestials) ById(ctx context.Context, id string) (result storage.Celestial, err error)

func (*Celestials) Primary added in v0.0.3

func (c *Celestials) Primary(ctx context.Context, addressId uint64) (result storage.Celestial, err error)

Jump to

Keyboard shortcuts

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