LightDB

lightdb.LightDB

The database to be implemented. stores may be used without a LightDB instance, but with drastically diminished functionality. It is always ideal for stores to be associated with a database.

Attributes

Graph
Supertypes
trait Disposable
class Object
trait Matchable
class Any
Show all

Members list

Type members

Classlikes

object stored

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
stored.type

Types

type S[Doc <: Document[Doc], Model <: DocumentModel[Doc]] = storeManager.S[Doc, Model]
type SM <: StoreManager

Value members

Abstract methods

def directory: Option[Path]

The base directory for this database. If None, the database is expected to operate entirely in memory.

The base directory for this database. If None, the database is expected to operate entirely in memory.

Attributes

List of upgrades that should be applied at the start of this database.

List of upgrades that should be applied at the start of this database.

Attributes

Concrete methods

def disposed: Boolean

True if this database has been disposed.

True if this database has been disposed.

Attributes

override protected def doDispose(): Task[Unit]

Attributes

Definition Classes
override protected def initialize(): Task[Unit]

Define initialization functionality here, but never call directly.

Define initialization functionality here, but never call directly.

Attributes

Definition Classes
def multiStore[Key, Doc <: Document[LazyRef(...)], Model <: DocumentModel[Doc]](model: Model, nameFromKey: Key => String): MultiStore[Key, Doc, Model, SM]
def multiStoreCustom[Key, Doc <: Document[LazyRef(...)], Model <: DocumentModel[Doc], SM <: StoreManager](model: Model, storeManager: SM, nameFromKey: Key => String): MultiStore[Key, Doc, Model, SM]
def name: String

Identifiable name for this database. Defaults to using the class name.

Identifiable name for this database. Defaults to using the class name.

Attributes

def optimize(stores: List[Store[_, _]]): Task[Unit]

Offers each store the ability to optimize the store.

Offers each store the ability to optimize the store.

Attributes

def reIndex(stores: List[Store[_, _]]): Task[Int]

Offers each store the ability to re-index data if supported. Only stores that separate storage and indexing (like SplitStore) will do any work. Returns the number of stores that were re-indexed. Provide the list of the stores to re-index or all stores will be invoked.

Offers each store the ability to re-index data if supported. Only stores that separate storage and indexing (like SplitStore) will do any work. Returns the number of stores that were re-indexed. Provide the list of the stores to re-index or all stores will be invoked.

Attributes

def reverseStore[E <: EdgeDocument[LazyRef(...), F, T], F <: Document[LazyRef(...)], T <: Document[LazyRef(...)], M <: DocumentModel[E], RM <: EdgeModel[ReverseEdgeDocument[E, F, T], T, F]](model: RM, forward: storeManager.S[E, M]): storeManager.S[ReverseEdgeDocument[E, F, T], RM]
def store[Doc <: Document[LazyRef(...)], Model <: DocumentModel[Doc]](model: Model, name: Option[String]): storeManager.S[Doc, Model]

Create a new store and associate it with this database. It is preferable that all stores be created before the database is initialized, but stores that are added after init will automatically be initialized during this method call.

Create a new store and associate it with this database. It is preferable that all stores be created before the database is initialized, but stores that are added after init will automatically be initialized during this method call.

Value parameters

model

the model to use for this store

name

the store's name (defaults to None meaning it will be generated based on the model name)

Attributes

def storeCustom[Doc <: Document[LazyRef(...)], Model <: DocumentModel[Doc], SM <: StoreManager](model: Model, storeManager: SM, name: Option[String]): storeManager.S[Doc, Model]

Create a new store and associate it with this database. It is preferable that all stores be created before the database is initialized, but stores that are added after init will automatically be initialized during this method call.

Create a new store and associate it with this database. It is preferable that all stores be created before the database is initialized, but stores that are added after init will automatically be initialized during this method call.

Value parameters

model

the model to use for this store

name

the store's name (defaults to None meaning it will be generated based on the model name)

storeManager

specify the StoreManager

Attributes

def stores: List[Store[_, _ <: DocumentModel[_]]]

All stores registered with this database

All stores registered with this database

Attributes

def storesByNames(storeNames: String*): List[Store[_, _]]

Returns a list of matching store names based on the provided names

Returns a list of matching store names based on the provided names

Attributes

def truncate(): Task[Unit]
protected def truncateOnInit: Boolean

Automatically truncates all stores in the database during initialization if this is set to true. Defaults to false.

Automatically truncates all stores in the database during initialization if this is set to true. Defaults to false.

Attributes

Inherited methods

def apply[T](key: DBFeatureKey[T]): T

Attributes

Inherited from:
FeatureSupport
def featureMap: Map[DBFeatureKey[Any], Any]

Attributes

Inherited from:
FeatureSupport
def features: Iterable[Any]

Attributes

Inherited from:
FeatureSupport
def get[T](key: DBFeatureKey[T]): Option[T]

Attributes

Inherited from:
FeatureSupport
def getOrCreate[T](key: DBFeatureKey[T], create: => T): T

Attributes

Inherited from:
FeatureSupport
def isDisposes: Boolean

Attributes

Inherited from:
Disposable
def isInitialized: Boolean

Attributes

Inherited from:
Initializable
def put[T](key: DBFeatureKey[T], value: T): Unit

Attributes

Inherited from:
FeatureSupport

Abstract fields

Default StoreManager to use for stores that do not specify a Store.

Default StoreManager to use for stores that do not specify a Store.

Attributes

Concrete fields

lazy protected val appliedUpgrades: StoredValue[Set[String]]
lazy val backingStore: Store[KeyValue, KeyValue.type]

Backing key/value store used for persistent internal settings, StoredValues, and general key/value storage.

Backing key/value store used for persistent internal settings, StoredValues, and general key/value storage.

Attributes

lazy protected val databaseInitialized: StoredValue[Boolean]

Inherited fields

lazy val dispose: Task[Unit]

Calls doDispose() exactly one time. Safe to call multiple times.

Calls doDispose() exactly one time. Safe to call multiple times.

Attributes

Inherited from:
Disposable
lazy val init: Task[Unit]

Calls initialize() exactly one time. Safe to call multiple times.

Calls initialize() exactly one time. Safe to call multiple times.

Attributes

Inherited from:
Initializable