store

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(ctx context.Context, conn *pgx.Conn) error

Init schema

func IsNotInitialized

func IsNotInitialized(err error) bool

IsNotInitialized returns true if the error is due to the migrations table not existing

Types

type CreateParams

type CreateParams struct {
	ID       string
	Key      string
	Filename string
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type Queries

type Queries struct {
}

func New

func New() *Queries

func (*Queries) Create

func (q *Queries) Create(ctx context.Context, db DBTX, arg CreateParams) (RoachMigration, error)

func (*Queries) List

func (q *Queries) List(ctx context.Context, db DBTX, key string) ([]RoachMigration, error)

func (*Queries) ListForUpdate

func (q *Queries) ListForUpdate(ctx context.Context, db DBTX, key string) ([]RoachMigration, error)

func (*Queries) Update

func (q *Queries) Update(ctx context.Context, db DBTX, arg UpdateParams) (RoachMigration, error)

type RoachMigration

type RoachMigration struct {
	ID         string
	Key        string
	Filename   string
	Completed  bool
	Failed     bool
	FailReason sql.NullString
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

type UpdateParams

type UpdateParams struct {
	Completed  bool
	Failed     bool
	FailReason sql.NullString
	ID         string
}

Jump to

Keyboard shortcuts

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