localdb

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SCHEMA_KEY = "/_schema_"

	DB_KV_FILE   = "db.bbolt"
	META_KV_FILE = "meta.buntdb"

	OS_DB_DIR = 0700
)

Variables

View Source
var (
	LOCAL_DB_PROPNAMES        = []string{"update_schema", "close"}
	JSON_SERIALIZATION_CONFIG = core.JSONSerializationConfig{ReprConfig: core.ALL_VISIBLE_REPR_CONFIG}

	ErrOpenDatabase = errors.New("database is already open by the current process or another one")
)

Functions

This section is empty.

Types

type LocalDatabase

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

A LocalDatabase is a database thats stores data on the OS filesystem.

func OpenDatabase

func OpenDatabase(ctx *core.Context, r core.ResourceName, restrictedAccess bool) (*LocalDatabase, error)

OpenDatabase opens a local database, read, create & write permissions are required.

func (*LocalDatabase) BaseURL

func (ldb *LocalDatabase) BaseURL() core.URL

func (*LocalDatabase) Close

func (ldb *LocalDatabase) Close(ctx *core.Context) error

func (*LocalDatabase) Get

func (ldb *LocalDatabase) Get(ctx *core.Context, key core.Path) (core.Value, core.Bool)

func (*LocalDatabase) GetSerialized

func (ldb *LocalDatabase) GetSerialized(ctx *core.Context, key core.Path) (string, bool)

func (*LocalDatabase) Has

func (ldb *LocalDatabase) Has(ctx *core.Context, key core.Path) bool

func (*LocalDatabase) Insert

func (ldb *LocalDatabase) Insert(ctx *core.Context, key core.Path, value core.Serializable)

func (*LocalDatabase) InsertSerialized

func (ldb *LocalDatabase) InsertSerialized(ctx *core.Context, key core.Path, serialized string)

func (*LocalDatabase) LoadTopLevelEntities

func (ldb *LocalDatabase) LoadTopLevelEntities(ctx *core.Context) (map[string]core.Serializable, error)

func (*LocalDatabase) Remove

func (ldb *LocalDatabase) Remove(ctx *core.Context, key core.Path)

func (*LocalDatabase) Resource

func (ldb *LocalDatabase) Resource() core.SchemeHolder

func (*LocalDatabase) Schema

func (ldb *LocalDatabase) Schema() *core.ObjectPattern

func (*LocalDatabase) Set

func (ldb *LocalDatabase) Set(ctx *core.Context, key core.Path, value core.Serializable)

func (*LocalDatabase) SetSerialized

func (ldb *LocalDatabase) SetSerialized(ctx *core.Context, key core.Path, serialized string)

func (*LocalDatabase) UpdateSchema

func (ldb *LocalDatabase) UpdateSchema(ctx *core.Context, schema *core.ObjectPattern, handlers core.MigrationOpHandlers)

type LocalDatabaseConfig

type LocalDatabaseConfig struct {
	OsFsDir    core.Path
	Host       core.Host
	InMemory   bool
	Restricted bool
}

Jump to

Keyboard shortcuts

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