datastore

package
v0.0.0-...-d386c04 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotReady         = errors.New("DATASTORE.NOT_READY.ERROR")
	ErrNotLive          = errors.New("DATASTORE.NOT_LIVE.ERROR")
	ErrAlreadyConnected = errors.New("DATASTORE.ALREADY_CONNECTED.ERROR")
	ErrNotConnected     = errors.New("DATASTORE.NOT_CONNECTED.ERROR")
	ErrRecordNotFound   = errors.New("DATASTORE.RECORD.NOT_FOUND.ERROR")
)

Functions

func NewSqlLogger

func NewSqlLogger(log logging.Logger) logger.Interface

func SqlApplyScanQuery

func SqlApplyScanQuery(tx *gorm.DB, query *entities.ScanningQuery, condition *ScanningCondition) *gorm.DB

Types

type Datastore

type Datastore interface {
	patterns.Connectable
	Client() any
}

func New

func New(provider configuration.Provider) (Datastore, error)

func NewSQL

func NewSQL(conf *config.Config, logger logging.Logger) (Datastore, error)

type ScanningCondition

type ScanningCondition struct {
	PrimaryKeyNs  string
	PrimaryKeyCol string
}

type SqlLogger

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

func (SqlLogger) Error

func (logger SqlLogger) Error(ctx context.Context, msg string, args ...interface{})

func (SqlLogger) Info

func (logger SqlLogger) Info(ctx context.Context, msg string, args ...interface{})

func (SqlLogger) LogMode

func (logger SqlLogger) LogMode(logger.LogLevel) logger.Interface

func (SqlLogger) Trace

func (logger SqlLogger) Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error)

func (SqlLogger) Warn

func (logger SqlLogger) Warn(ctx context.Context, msg string, args ...interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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