store

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	sqlc.Querier
	// contains filtered or unexported fields
}

func NewStore

func NewStore(db *pgxpool.Pool, querier sqlc.Querier) *Store

func (*Store) Close

func (s *Store) Close()

func (*Store) DB added in v1.1.0

func (s *Store) DB() *pgxpool.Pool

func (*Store) GetLatestSensorDataBySensorID added in v1.1.0

func (s *Store) GetLatestSensorDataBySensorID(ctx context.Context, id string) (*entities.SensorData, error)

This function provides the latest data from a specific sensor

func (*Store) HandleError

func (s *Store) HandleError(err error) error

TODO: Improve error handling

func (*Store) MapClusterFields added in v1.1.0

func (s *Store) MapClusterFields(ctx context.Context, tc *entities.TreeCluster) error

This function is required as soon as you want to add data to the tree cluster object from the database, e.g. the linked region or the linked trees. As this function is required in different repositories, it has been outsourced.

func (*Store) MapSensorFields added in v1.1.0

func (s *Store) MapSensorFields(ctx context.Context, sn *entities.Sensor) error

This function is required as soon as you want to add the data to the sensor object

func (*Store) WithTx

func (s *Store) WithTx(ctx context.Context, fn func(*Store) error) error

Jump to

Keyboard shortcuts

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