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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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