Documentation
¶
Overview ¶
Package postgres implements peng's store.Store interface for PostgreSQL, backed by sqlc-generated query code.
Generated files (db.go, models.go, queries.sql.go) come from running sqlc against the repo-root sqlc.yaml — do not edit them by hand. The adapter in store.go bridges the generated *Queries type to the store.Store interface peng operates against.
Index ¶
- type DBTX
- type InsertMigrationParams
- type InsertSeedParams
- type PengMigration
- type PengSeed
- type Queries
- func (q *Queries) DeleteMigration(ctx context.Context, version string) error
- func (q *Queries) DeleteSeed(ctx context.Context, version string) error
- func (q *Queries) GetMigration(ctx context.Context, version string) (PengMigration, error)
- func (q *Queries) GetSeed(ctx context.Context, version string) (PengSeed, error)
- func (q *Queries) InsertMigration(ctx context.Context, arg InsertMigrationParams) error
- func (q *Queries) InsertSeed(ctx context.Context, arg InsertSeedParams) error
- func (q *Queries) ListMigrations(ctx context.Context) ([]PengMigration, error)
- func (q *Queries) ListSeeds(ctx context.Context) ([]PengSeed, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type Store
- func (*Store) DeleteMigration(ctx context.Context, db DBTX, version string) error
- func (*Store) DeleteSeed(ctx context.Context, db DBTX, version string) error
- func (*Store) EnsureTables(ctx context.Context, db DBTX) error
- func (*Store) GetMigration(ctx context.Context, db DBTX, version string) (*peng.MigrationRecord, error)
- func (*Store) GetSeed(ctx context.Context, db DBTX, version string) (*peng.SeedRecord, error)
- func (*Store) InsertMigration(ctx context.Context, db DBTX, version, name string, durationMs int64, ...) error
- func (*Store) InsertSeed(ctx context.Context, db DBTX, version, name string, durationMs int64) error
- func (*Store) ListMigrations(ctx context.Context, db DBTX) ([]peng.MigrationRecord, error)
- func (*Store) ListSeeds(ctx context.Context, db DBTX) ([]peng.SeedRecord, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InsertMigrationParams ¶
type InsertSeedParams ¶
type PengMigration ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) DeleteMigration ¶
func (*Queries) DeleteSeed ¶
func (*Queries) GetMigration ¶
func (*Queries) InsertMigration ¶
func (q *Queries) InsertMigration(ctx context.Context, arg InsertMigrationParams) error
func (*Queries) InsertSeed ¶
func (q *Queries) InsertSeed(ctx context.Context, arg InsertSeedParams) error
func (*Queries) ListMigrations ¶
func (q *Queries) ListMigrations(ctx context.Context) ([]PengMigration, error)
type Store ¶
type Store struct{}
Store implements peng/pg's Store interface for PostgreSQL.
func NewStore ¶
func NewStore() *Store
NewStore returns a Postgres Store. The zero value is also usable.
func (*Store) DeleteMigration ¶
func (*Store) DeleteSeed ¶
func (*Store) GetMigration ¶
func (*Store) InsertMigration ¶
func (*Store) InsertSeed ¶
func (*Store) ListMigrations ¶
Click to show internal directories.
Click to hide internal directories.