engine

package
v0.0.0-...-0194b68 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

Engine handles database operations such that queries and executes. This also handles backups and copying the data. Also collects metrics for node information.

func Open

func Open(path string) (*Engine, error)

Open creates a new database engine instance. It starts a read-only and a write connection.

func OpenMemory

func OpenMemory() (*Engine, error)

func (*Engine) Backup

func (eng *Engine) Backup(path string) error

Backup copies the data from connections to a given path.

func (*Engine) Close

func (eng *Engine) Close() error

Close the database connections

func (*Engine) Copy

func (eng *Engine) Copy(dst *Engine) error

func (*Engine) Exec

func (eng *Engine) Exec(req *pb.Request) ([]*pb.ExecRes, error)

func (*Engine) ExecString

func (eng *Engine) ExecString(str string) ([]*pb.ExecRes, error)

func (*Engine) FileSize

func (eng *Engine) FileSize() (int64, error)

FileSize size of the sqlite file on disk.

func (*Engine) IsMem

func (eng *Engine) IsMem() bool

func (*Engine) IsReadOnly

func (eng *Engine) IsReadOnly() bool

func (*Engine) Metric

func (eng *Engine) Metric() (map[string]any, error)

Metric gets some data from the database. Basically information about how much data has been used etc...

func (*Engine) Path

func (eng *Engine) Path() string

func (*Engine) Query

func (eng *Engine) Query(req *pb.Request) ([]*pb.QueryRes, error)

func (*Engine) QueryString

func (eng *Engine) QueryString(query string) ([]*pb.QueryRes, error)

func (*Engine) Serialize

func (eng *Engine) Serialize() ([]byte, error)

Serialize returns the database as bytes.

func (*Engine) Size

func (eng *Engine) Size() (int64, error)

Size returns the database size in bytes.

Jump to

Keyboard shortcuts

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