storage

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 14 Imported by: 0 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

View Source
var ErrInstanceBusy = errors.New("другой экземпляр qag уже использует эту БД")
View Source
var ErrMigration = errors.New("не удалось подготовить схему PostgreSQL; проверьте доступность БД, права и совместимость версии приложения")
View Source
var ErrSchemaVersion = errors.New("схема PostgreSQL несовместима с этой версией qag")
View Source
var ErrUnavailable = errors.New("PostgreSQL приложения недоступна; проверьте подключение и учётные данные")

Functions

This section is empty.

Types

type Namespace

type Namespace = dbscope.Namespace

type Store

type Store struct {
	Pool      *pgxpool.Pool
	Namespace dbscope.Namespace
	// contains filtered or unexported fields
}

func Open

func Open(ctx context.Context, databaseURL string, namespaces ...Namespace) (*Store, error)

func (*Store) AcquireInstance

func (s *Store) AcquireInstance(ctx context.Context) error

func (*Store) CheckImportPermissions

func (s *Store) CheckImportPermissions(ctx context.Context, ready bool) error

CheckImportPermissions is read-only, so dry-run never prepares schemas.

func (*Store) CheckSchema

func (s *Store) CheckSchema(ctx context.Context) (bool, error)

CheckSchema is read-only, including when the target has never been migrated.

func (*Store) Close

func (s *Store) Close()

func (*Store) InstanceLost

func (s *Store) InstanceLost() <-chan struct{}

func (*Store) Migrate

func (s *Store) Migrate(ctx context.Context) error

Migrate uses a transaction-scoped lock and checksums, so concurrent startup and repeated startup cannot partially apply or silently replace a migration.

func (*Store) Ping

func (s *Store) Ping(ctx context.Context) error

Jump to

Keyboard shortcuts

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