Provides various database structures for storing data.
- Source:
Namespaces
Members
(static) databaseTypes
An array of available database types.
- Source:
Methods
(static) Documents(options) → {module:Databases.Databases-Documents}
Defines a Documents database.
Parameters:
Name | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Various options for configuring the Document store. Properties
|
- Source:
Returns:
A Documents function.
(static) Events() → {module:Databases.Databases-Events}
Defines an Events database.
- Source:
Returns:
A Events function.
(static) KeyValue() → {module:Databases.Databases-KeyValue}
Defines a KeyValue database.
- Source:
Returns:
A KeyValue function.
(static) KeyValueIndexed(storageopt) → {module:Databases.Databases-KeyValueIndexed}
Defines a KeyValueIndexed database.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
storage |
module:Storage |
<optional> |
LevelStorage | A compatible storage where the key/value pairs are indexed. |
- Source:
Returns:
A KeyValueIndexed function.
(static) useDatabaseType(database)
Add a new database type.
Parameters:
Name | Type | Description |
---|---|---|
database |
module:Databases | A Database-compatible module. |
- Source:
Throws:
-
Database type does not contain required field 'type'.
-
-
Database type '$' already added.
- Type
- store.type
-
Example
import { useDatabaseType } from 'orbitdb'
const CustomDBTypeModule = async (params) => {
const database = await Database(...params)
...
}
useDatabaseType(CustomDBTypeModule)