store

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 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 SchemaExecer) 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 SchemaExecer added in v1.1.0

type SchemaExecer interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
}

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