storagedb

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2025 License: AGPL-3.0, AGPL-3.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string
const (
	PERSIST_ACTION_NONE   Action = "None"   // Фиктивная пустая action
	PERSIST_ACTION_GET    Action = "Get"    // Запрос одного объекта
	PERSIST_ACTION_CREATE Action = "Create" // Создание объекта
	PERSIST_ACTION_UPDATE Action = "Update" // Обновление объекта
	PERSIST_ACTION_DELETE Action = "Delete" // Удаление объекта
	PERSIST_ACTION_MERGE  Action = "Merge"  // Слияние объекта
)

type Config

type Config struct {
	DbMapCfg map[string]*_sql.Config `yaml:"storages" json:"storage"`
}

Config конфигурационные настройки

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service represent DB API services

func New

func New(ctx context.Context, errCh chan<- error, cfg *Config) (*Service, error)

New create API service

func (*Service) Shutdown

func (s *Service) Shutdown() (err error)

Shutdown shutting down service

func (*Service) StorageServiceMap

func (s *Service) StorageServiceMap() map[string]_storage.Service

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

Storage represent DB API service

func (*Storage) Begin

func (s *Storage) Begin(ctx context.Context, requestID uint64) (txId uint64, err error)

func (*Storage) Commit

func (s *Storage) Commit(requestID uint64, txId uint64) (err error)

func (*Storage) Create

func (s *Storage) Create(ctx context.Context, requestID uint64, txId uint64, rowIn *_meta.Object, rowOut *_meta.Object) (err error)

Create создать строку в БД

func (*Storage) Execute

func (s *Storage) Execute(ctx context.Context, requestID uint64, txId uint64, sqlQuery string, args ...interface{}) (err error)

Execute выполнить код в БД

func (*Storage) ExecuteScan

func (s *Storage) ExecuteScan(ctx context.Context, requestID uint64, txId uint64, dest []interface{}, sqlQuery string, args ...interface{}) (exists bool, err error)

ExecuteScan выполнить код в БД и вернуть результат

func (*Storage) Get

func (s *Storage) Get(ctx context.Context, requestID uint64, txId uint64, rowOut *_meta.Object, key *_meta.Key, keyArgs ...interface{}) (exists bool, err error)

Get извлечь данные из БД

func (*Storage) GetTxFromCache

func (s *Storage) GetTxFromCache(txId uint64) (tx *_sql.Tx, err error)

func (*Storage) Rollback

func (s *Storage) Rollback(requestID uint64, txId uint64) (err error)

func (*Storage) Select

func (s *Storage) Select(ctx context.Context, requestID uint64, txId uint64, rowsOut *_meta.Object, key *_meta.Key, keyArgs ...interface{}) (exists bool, err error)

Select извлечь данные из БД

func (*Storage) Update

func (s *Storage) Update(ctx context.Context, requestID uint64, txId uint64, rowIn *_meta.Object, rowOut *_meta.Object) (err error)

Update обновить строку в БД

Jump to

Keyboard shortcuts

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