reindexer

package
v1.77.5 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EQ     = reindexer.EQ     // =
	GT     = reindexer.GT     // >
	LT     = reindexer.LT     // <
	GE     = reindexer.GE     // >= (GT|EQ)
	LE     = reindexer.LE     // <= (LT|EQ)
	SET    = reindexer.SET    // one of set in []
	ALLSET = reindexer.ALLSET // all of set in []
	RANGE  = reindexer.RANGE  // value in RANGE from,to
	ANY    = reindexer.ANY    // any value
	EMPTY  = reindexer.EMPTY  // empty value or len(value array) == 0
	LIKE   = reindexer.LIKE   // string like pattern
)

Variables

View Source
var (
	ErrPrimaryKey = errors.New("primary key error")
	ErrNoAffected = errors.New("no affected rows")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr     string `desc:"database address (ip:port)"`
	Name     string `desc:"database name"`
	Username string
	Password string
	Builtin  bool `desc:"enable builtin mode"`
	// contains filtered or unexported fields
}

func (*Config) ValidAndRepair

func (c *Config) ValidAndRepair() error

type Conn added in v1.72.26

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

func Open

func Open(ctx context.Context, conf Config) (*Conn, error)

Open reindexer database client

func (*Conn) Close added in v1.72.26

func (db *Conn) Close() error

func (*Conn) Create added in v1.72.26

func (db *Conn) Create(ns string, item interface{}) (err error)

Create new item

func (*Conn) Delete added in v1.72.26

func (db *Conn) Delete(ns string, item interface{}) error

Delete item

func (*Conn) Deletes added in v1.72.26

func (db *Conn) Deletes(ctx context.Context, q Query) (err error)

Deletes items by query

func (*Conn) ExecSQL added in v1.73.3

func (db *Conn) ExecSQL(query string) *reindexer.Iterator

func (*Conn) Exists added in v1.72.26

func (db *Conn) Exists(ctx context.Context, q Query) (exist bool, err error)

Exists items by query

func (*Conn) Get added in v1.72.26

func (db *Conn) Get(ctx context.Context, q Query) (item interface{}, err error)

Get item by query

func (*Conn) Migrate added in v1.72.26

func (db *Conn) Migrate(namespaces map[string]interface{}, dropOnIndexesConflict bool) error

func (*Conn) Query added in v1.72.26

func (db *Conn) Query(ns string) Query

func (*Conn) TryDeletes added in v1.73.1

func (db *Conn) TryDeletes(ctx context.Context, q Query) (err error)

TryDeletes items by query

func (*Conn) Update added in v1.72.26

func (db *Conn) Update(ns string, item interface{}) (err error)

Update item

func (*Conn) Updates added in v1.72.26

func (db *Conn) Updates(ctx context.Context, q Query) error

Updates items by query

type Query

type Query = *reindexer.Query

Jump to

Keyboard shortcuts

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