db

package
v0.0.0-...-34450e2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: Zlib Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureLatestVersion

func EnsureLatestVersion()

EnsureLatestVersion ensures that the database is at the latest version by running all migrations.

Types

type API

type API struct {
	Db PgxIface
}

func (*API) CreateRecord

func (c *API) CreateRecord(data *pb.Record) error

func (*API) ReturnRecord

func (c *API) ReturnRecord(id string) (*pb.Record, error)

func (*API) ReturnRecords

func (c *API) ReturnRecords(startDatetime *timestamppb.Timestamp, endDatetime *timestamppb.Timestamp, limit int64, offset int64) ([]*pb.Record, error)

type PgxIface

type PgxIface interface {
	Begin(context.Context) (pgx.Tx, error)
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	Ping(context.Context) error
	Prepare(context.Context, string, string) (*pgconn.StatementDescription, error)
	Close(context.Context) error
}

Jump to

Keyboard shortcuts

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